// Followers returns a list of user followers.
//
// Users.Next can be used to paginate
//
// See example: examples/user/followers.go
518351
func (user *User) Followers() *Users {
	users := &Users{}
	users.inst = user.inst
	users.endpoint = fmt.Sprintf(urlFollowers, user.ID)
	return users
}
721799
func (c *Client) ListUsers() (rec []UserInfo, err error) {
	req, err := newGETRequest(c, "users/")
	if err != nil {
		return []UserInfo{}, err
	}

	if err = executeAndParseRequest(c, req, &rec); err != nil {
		return []UserInfo{}, err
	}

	return rec, nil
}
829862
func (it *Optional) Next(ctx context.Context) bool {
	clog.Errorf("Nexting an un-nextable iterator: %T", it)
	return false
}
308406
func (p *Pager) Next() *Pager {
	if !p.HasNext() {
		return nil
	}
	return p.pagers[p.PageNumber()]
}
1273335
func (trc *TumblrRestClient) Following(options map[string]string) FollowingResponse {
	data := trc.request.Get("/v2/user/following", options)
	var result FollowingResponse
	json.Unmarshal(data.Response, &result)
	return result
}
218829
func GetFollowers(client ClientInterface, name string, offset, limit uint) (*FollowerList, error) {
	params := setParamsUint(uint64(offset), url.Values{}, "offset")
	params = setParamsUint(uint64(limit), params, "limit")
	response, err := client.GetWithParams(blogPath("/blog/%s/followers", name), params)
	if err != nil {
		return nil, err
	}
	followers := struct {
		Followers FollowerList `json:"response"`
	}{
		Followers: FollowerList{
			client: client,
			name:   name,
			limit:  limit,
			offset: offset,
		},
	}
	if err = json.Unmarshal(response.body, &followers); err == nil {
		return &followers.Followers, nil
	}
	return nil, err
}
856742
func (p *Path) Follow(path *Path) *Path {
	np := p.clone()
	np.stack = append(np.stack, followMorphism(path))
	return np
}
768651
func (n navigator) Follow(rel string) navigator {
	return n.Followf(rel, nil)
}
455355
func (s *ListsService) Subscribers(params *ListsSubscribersParams) (*Subscribers, *http.Response, error) {
	subscribers := new(Subscribers)
	apiError := new(APIError)
	resp, err := s.sling.New().Get("subscribers.json").QueryStruct(params).Receive(subscribers, apiError)
	return subscribers, resp, relevantError(err, *apiError)
}
1182186
func (o *Enterprise) Users(info *bambou.FetchingInfo) (UsersList, *bambou.Error) {

	var list UsersList
	err := bambou.CurrentSession().FetchChildren(o, UserIdentity, &list, info)
	return list, err
}
646137
func (org *Organization) Users() ([]*User, error) {
	var us []userResource
	err := org.PPE.get(fmt.Sprintf("/orgs/%s/users", org.PrimaryDomain), &us)
	if err != nil {
		return []*User{}, err
	}
	users := make([]*User, len(us))
	for i, u := range us {
		users[i] = userFromUserResource(org, u)
	}
	return users, nil
}
1020713
func (f *FollowingList) Prev() (*FollowingList, error) {
	if f.offset <= 0 {
		return nil, NoPrevPageError
	}
	limit := f.limit
	if limit < 1 {
		limit = uint(len(f.Blogs))
	}
	var newOffset uint = f.offset - limit
	if limit >= f.offset {
		newOffset = 0
	}
	return GetFollowing(f.client, newOffset, limit)
}
1209075
func List(c *client.Client, results int) (api.Users, int, error) {
	body, count, err := c.LimitedRequest("/v1/users/", results)

	if err != nil {
		return []api.User{}, -1, err
	}

	var users []api.User
	if err = json.Unmarshal([]byte(body), &users); err != nil {
		return []api.User{}, -1, err
	}

	return users, count, nil
}
239813
func (m *Mux) Follow(r io.ReadCloser, buffer string, msgID logagg.MsgID, config *Config) *LogStream {
	hdr := &rfc5424.Header{
		Hostname: []byte(config.HostID),
		AppName:  []byte(config.AppID),
		MsgID:    []byte(msgID),
	}
	if config.JobType != "" {
		hdr.ProcID = []byte(config.JobType + "." + config.JobID)
	} else {
		hdr.ProcID = []byte(config.JobID)
	}

	s := &LogStream{
		m:    m,
		log:  r,
		done: make(chan struct{}),
	}
	s.closed.Store(false)

	m.jobsMtx.Lock()
	defer m.jobsMtx.Unlock()
	// set up the WaitGroup so that subscribers can track when the job fds have closed
	wg, ok := m.jobWaits[config.JobID]
	if !ok {
		wg = &sync.WaitGroup{}
		m.jobWaits[config.JobID] = wg
	}
	wg.Add(1)
	if !ok {
		// we created the wg, so create a goroutine to clean up
		go func() {
			wg.Wait()
			m.jobsMtx.Lock()
			defer m.jobsMtx.Unlock()
			delete(m.jobWaits, config.JobID)
		}()
	}

	// if there is a jobStart channel, a subscriber is waiting for the WaitGroup
	// to be created, signal it.
	if ch, ok := m.jobStarts[config.JobID]; ok {
		close(ch)
		delete(m.jobStarts, config.JobID)
	}

	go s.follow(r, buffer, config.AppID, hdr, wg)
	return s
}
839212
func (comments *Comments) Next() bool {
	if comments.err != nil {
		return false
	}

	item := comments.item
	insta := item.media.instagram()
	endpoint := comments.endpoint
	query := map[string]string{
		// "can_support_threading": "true",
	}
	if comments.NextMaxID != nil {
		next, _ := strconv.Unquote(string(comments.NextMaxID))
		query["max_id"] = next
	} else if comments.NextMinID != nil {
		next, _ := strconv.Unquote(string(comments.NextMinID))
		query["min_id"] = next
	}

	body, err := insta.sendRequest(
		&reqOptions{
			Endpoint:   endpoint,
			Connection: "keep-alive",
			Query:      query,
		},
	)
	if err == nil {
		c := Comments{}
		err = json.Unmarshal(body, &c)
		if err == nil {
			*comments = c
			comments.endpoint = endpoint
			comments.item = item
			if (!comments.HasMoreComments || comments.NextMaxID == nil) &&
				(!comments.HasMoreHeadloadComments || comments.NextMinID == nil) {
				comments.err = ErrNoMore
			}
			comments.setValues()
			return true
		}
	}
	comments.err = err
	return false
}
76411
func Followers() echo.HandlerFunc {

	// swagger:route GET /users/{id}/followers users info followers GetUserFollowers
	//
	// Shows the followers informations for the specified user
	//
	// You can personalize the request via query string parameters
	//
	//	Produces:
	//	- application/json
	//
	//	Security:
	//		oauth: profile:read
	//
	//	Responses:
	//		default: UsersIdFollowers

	return func(c echo.Context) error {
		if !rest.IsGranted("profile:read", c) {
			return rest.InvalidScopeResponse("profile:read", c)
		}
		followers := c.Get("other").(*nerdz.User).Followers()
		return rest.SelectFields(rest.GetUsersInfo(followers), c)
	}
}
519365
func ListFollowers(c *context.APIContext) {
	u := GetUserByParams(c)
	if c.Written() {
		return
	}
	listUserFollowers(c, u)
}