func (r *AccountRepository) All(offset, limit int) (core.Accounts, error) { rows, err := dat.All(r, offset, limit) if err != nil { log.Printf("Error retrieving Accounts %d to %d: %s", offset, limit, err) } accountsCol := core.Accounts{} if err = rows.All(&accountsCol); err != nil { log.Printf("Error decoding rows into slice of accounts: %s", err) } rows.Close() return accountsCol, err }
func (r *PostRepository) All(offset, limit int) (core.Posts, error) { rows, err := dat.All(r, offset, limit) if err != nil { log.Printf("Error retrieving posts %d to %d: %s", offset, limit, err) return core.Posts{}, err } defer rows.Close() postsCol := core.Posts{} if err = rows.All(&postsCol); err != nil { log.Printf("Error decoding rows into slice of posts: %s", err) return core.Posts{}, err } return postsCol, err }
func (r *TopicRepository) All(offset, limit int) (core.Topics, error) { rows, err := dat.All(r, offset, limit) if err != nil { log.Printf("Error retrieving topics %d to %d: %s", offset, limit, err) return core.Topics{}, err } defer rows.Close() topicsCol := core.Topics{} if err = rows.All(&topicsCol); err != nil { log.Printf("Error decoding rows into slice of topics: %s", err) return core.Topics{}, err } return topicsCol, err }