func (r *AccountRepository) Find(username string) (*core.Account, error) { cursor, err := dat.Match(r, "username", username) if err != nil { log.Printf("Error retrieving account %s: %s", username, err) } defer cursor.Close() account := &core.Account{} cursor.One(account) return account, err }
func (r *ClientRepository) Find(key string) (*Client, error) { cursor, err := dat.Match(r, "key", key) if err != nil { log.Printf("Error retrieving client %s: %s", key, err) } defer cursor.Close() client := &Client{} cursor.One(client) return client, err }