Skip to content

Commit eb74259

Browse files
authored
Merge pull request #228 from techulus/feat/service-manifest-v1
Simplify V1 linked service manifests
2 parents 567a68c + cdcfb78 commit eb74259

32 files changed

Lines changed: 1864 additions & 603 deletions

File tree

‎cli/internal/api/client.go‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ func NewClient(host, apiKey string) *Client {
6464
}
6565

6666
func (c *Client) RequestJSON(ctx context.Context, method, path string, query url.Values, body any, out any) error {
67+
return c.RequestJSONWithHeaders(ctx, method, path, query, nil, body, out)
68+
}
69+
70+
func (c *Client) RequestJSONWithHeaders(ctx context.Context, method, path string, query url.Values, customHeaders map[string]string, body any, out any) error {
6771
endpoint := c.Host + path
6872
if len(query) > 0 {
6973
endpoint += "?" + query.Encode()
@@ -72,6 +76,9 @@ func (c *Client) RequestJSON(ctx context.Context, method, path string, query url
7276
if c.APIKey != "" {
7377
headers["x-api-key"] = c.APIKey
7478
}
79+
for key, value := range customHeaders {
80+
headers[key] = value
81+
}
7582
return JSON(ctx, c.HTTPClient, method, endpoint, headers, body, out)
7683
}
7784

0 commit comments

Comments
 (0)