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

Method Get

collections.go:98–105  ·  view source on GitHub ↗

Get retrieves a collection object having the given ID.

(ctx context.Context, collection, id string)

Source from the content-addressed store, hash-verified

96
97// Get retrieves a collection object having the given ID.
98func (c *CollectionsClient) Get(ctx context.Context, collection, id string) (*CollectionObjectResponse, error) {
99 if collection == "" {
100 return nil, errors.New("collection name required")
101 }
102 endpoint := c.client.makeEndpoint("collections/%s/%s/", collection, id)
103
104 return c.decodeObject(c.client.get(ctx, endpoint, nil, c.client.authenticator.collectionsAuth))
105}
106
107// Update updates the given collection object's data.
108func (c *CollectionsClient) Update(ctx context.Context, collection, id string, data map[string]any) (*CollectionObjectResponse, error) {

Callers

nothing calls this directly

Calls 3

decodeObjectMethod · 0.95
makeEndpointMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected