Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing context.Context support and propagation #322

Merged
merged 1 commit into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion service_dependency.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (c *Client) AssociateServiceDependenciesWithContext(ctx context.Context, de
}

func (c *Client) associateServiceDependenciesWithContext(ctx context.Context, dependencies *ListServiceDependencies) (*ListServiceDependencies, *http.Response, error) {
resp, err := c.post(context.TODO(), "/service_dependencies/associate", dependencies, nil)
resp, err := c.post(ctx, "/service_dependencies/associate", dependencies, nil)
if err != nil {
return nil, nil, err
}
Expand Down
10 changes: 8 additions & 2 deletions tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,15 @@ func (c *Client) GetTagWithContext(ctx context.Context, id string) (*Tag, *http.
return getTagFromResponse(c, resp, err)
}

// AssignTags adds and removes tag assignments with entities
// AssignTags adds and removes tag assignments with entities. It's recommended
// to use AssignTagsWithContext instead.
func (c *Client) AssignTags(e, eid string, a *TagAssignments) (*http.Response, error) {
resp, err := c.post(context.TODO(), "/"+e+"/"+eid+"/change_tags", a, nil)
return c.AssignTagsWithContext(context.Background(), e, eid, a)
}

// AssignTagsWithContext adds and removes tag assignments with entities.
func (c *Client) AssignTagsWithContext(ctx context.Context, e, eid string, a *TagAssignments) (*http.Response, error) {
resp, err := c.post(ctx, "/"+e+"/"+eid+"/change_tags", a, nil)
if err != nil {
return nil, err
}
Expand Down