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

Method Get

personalization.go:27–36  ·  view source on GitHub ↗

Get obtains a PersonalizationResponse for the given resource and params.

(ctx context.Context, resource string, params map[string]any)

Source from the content-addressed store, hash-verified

25
26// Get obtains a PersonalizationResponse for the given resource and params.
27func (c *PersonalizationClient) Get(ctx context.Context, resource string, params map[string]any) (*PersonalizationResponse, error) {
28 if resource == "" {
29 return nil, errors.New("missing resource")
30 }
31 endpoint := c.client.makeEndpoint("%s/", resource)
32 for k, v := range params {
33 endpoint.addQueryParam(makeRequestOption(k, v))
34 }
35 return c.decode(c.client.get(ctx, endpoint, nil, c.client.authenticator.personalizationAuth))
36}
37
38// Post sends data to the given resource, adding the given params to the request.
39func (c *PersonalizationClient) Post(ctx context.Context, resource string, params, data map[string]any) (*PersonalizationResponse, error) {

Callers

nothing calls this directly

Calls 5

decodeMethod · 0.95
makeRequestOptionFunction · 0.85
makeEndpointMethod · 0.80
addQueryParamMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected