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

Method AddToMany

client.go:170–182  ·  view source on GitHub ↗

AddToMany adds an activity to multiple feeds at once.

(ctx context.Context, activity Activity, feeds ...Feed)

Source from the content-addressed store, hash-verified

168
169// AddToMany adds an activity to multiple feeds at once.
170func (c *Client) AddToMany(ctx context.Context, activity Activity, feeds ...Feed) error {
171 endpoint := c.makeEndpoint("feed/add_to_many/")
172 ids := make([]string, len(feeds))
173 for i := range feeds {
174 ids[i] = feeds[i].ID()
175 }
176 req := AddToManyRequest{
177 Activity: activity,
178 FeedIDs: ids,
179 }
180 _, err := c.post(ctx, endpoint, req, c.authenticator.feedAuth(resFeed, nil))
181 return err
182}
183
184// FollowMany creates multiple follows at once.
185func (c *Client) FollowMany(ctx context.Context, relationships []FollowRelationship, opts ...FollowManyOption) error {

Callers 1

TestAddToManyFunction · 0.80

Calls 4

makeEndpointMethod · 0.95
postMethod · 0.95
feedAuthMethod · 0.80
IDMethod · 0.65

Tested by 1

TestAddToManyFunction · 0.64