MCPcopy Create free account
hub / github.com/GetStream/stream-go2 / followStats

Method followStats

client.go:661–678  ·  view source on GitHub ↗
(ctx context.Context, feed Feed, opts ...FollowStatOption)

Source from the content-addressed store, hash-verified

659}
660
661func (c *Client) followStats(ctx context.Context, feed Feed, opts ...FollowStatOption) (*FollowStatResponse, error) {
662 endpoint := c.makeEndpoint("stats/follow/")
663 endpoint.addQueryParam(makeRequestOption("followers", feed.ID()))
664 endpoint.addQueryParam(makeRequestOption("following", feed.ID()))
665 for _, opt := range opts {
666 endpoint.addQueryParam(opt)
667 }
668
669 resp, err := c.get(ctx, endpoint, nil, c.authenticator.feedAuth(resFollower, nil))
670 if err != nil {
671 return nil, err
672 }
673 var out FollowStatResponse
674 if err := json.Unmarshal(resp, &out); err != nil {
675 return nil, err
676 }
677 return &out, nil
678}
679
680func (c *Client) updateToTargets(ctx context.Context, feed Feed, activity Activity, opts ...UpdateToTargetsOption) (*UpdateToTargetsResponse, error) {
681 if len(opts) == 0 {

Callers 1

FollowStatsMethod · 0.80

Calls 6

makeEndpointMethod · 0.95
getMethod · 0.95
makeRequestOptionFunction · 0.85
addQueryParamMethod · 0.80
feedAuthMethod · 0.80
IDMethod · 0.65

Tested by

no test coverage detected