Skip to content

Commit

Permalink
feat: allow custom http client and use ctx for requests for http1 api…
Browse files Browse the repository at this point in the history
…client. Fixes argoproj#12827

the current implementation does not suite our usecase because the http Fascade interface does not take proxy url
we have to use proxy for cross network calls for argo server

so we might as well just allow a fully configured http client to be
passed in - this allows more flexible configurations of the HTTP1 client
via custom roundtripper

Signed-off-by: williamburgson <[email protected]>
  • Loading branch information
williamburgson committed Apr 1, 2024
1 parent d8acad7 commit 5ccd0af
Show file tree
Hide file tree
Showing 10 changed files with 132 additions and 120 deletions.
2 changes: 1 addition & 1 deletion pkg/apiclient/apiclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func NewClientFromOpts(opts Opts) (context.Context, Client, error) {
if opts.AuthSupplier == nil {
return nil, nil, fmt.Errorf("AuthSupplier cannot be empty when connecting to Argo Server")
}
return newHTTP1Client(opts.ArgoServerOpts.GetURL(), opts.AuthSupplier(), opts.ArgoServerOpts.InsecureSkipVerify, opts.ArgoServerOpts.Headers)
return newHTTP1Client(opts.ArgoServerOpts.GetURL(), opts.AuthSupplier(), opts.ArgoServerOpts.InsecureSkipVerify, opts.ArgoServerOpts.Headers, opts.ArgoServerOpts.HTTP1Client)
} else if opts.ArgoServerOpts.URL != "" {
if opts.AuthSupplier == nil {
return nil, nil, fmt.Errorf("AuthSupplier cannot be empty when connecting to Argo Server")
Expand Down
7 changes: 5 additions & 2 deletions pkg/apiclient/argo-server-opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package apiclient

import (
"fmt"
"net/http"
)

type ArgoServerOpts struct {
Expand All @@ -12,8 +13,10 @@ type ArgoServerOpts struct {
Secure bool
InsecureSkipVerify bool
// whether or not to use HTTP1
HTTP1 bool
Headers []string
HTTP1 bool
// use custom http client
HTTP1Client *http.Client
Headers []string
}

func (o ArgoServerOpts) GetURL() string {
Expand Down
5 changes: 3 additions & 2 deletions pkg/apiclient/http1-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package apiclient

import (
"context"
"net/http"

"github.com/argoproj/argo-workflows/v3/pkg/apiclient/clusterworkflowtemplate"
cronworkflowpkg "github.com/argoproj/argo-workflows/v3/pkg/apiclient/cronworkflow"
Expand Down Expand Up @@ -40,6 +41,6 @@ func (h httpClient) NewInfoServiceClient() (infopkg.InfoServiceClient, error) {
return http1.InfoServiceClient(h), nil
}

func newHTTP1Client(baseUrl string, auth string, insecureSkipVerify bool, headers []string) (context.Context, Client, error) {
return context.Background(), httpClient(http1.NewFacade(baseUrl, auth, insecureSkipVerify, headers)), nil
func newHTTP1Client(baseUrl string, auth string, insecureSkipVerify bool, headers []string, customHttpClient *http.Client) (context.Context, Client, error) {
return context.Background(), httpClient(http1.NewFacade(baseUrl, auth, insecureSkipVerify, headers, customHttpClient)), nil
}
36 changes: 18 additions & 18 deletions pkg/apiclient/http1/archived-workflows-service-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,47 @@ import (

type ArchivedWorkflowsServiceClient = Facade

func (h ArchivedWorkflowsServiceClient) ListArchivedWorkflows(_ context.Context, in *workflowarchivepkg.ListArchivedWorkflowsRequest, _ ...grpc.CallOption) (*wfv1.WorkflowList, error) {
func (h ArchivedWorkflowsServiceClient) ListArchivedWorkflows(ctx context.Context, in *workflowarchivepkg.ListArchivedWorkflowsRequest, _ ...grpc.CallOption) (*wfv1.WorkflowList, error) {
out := &wfv1.WorkflowList{}
return out, h.Get(in, out, "/api/v1/archived-workflows")
return out, h.Get(ctx, in, out, "/api/v1/archived-workflows")
}

func (h ArchivedWorkflowsServiceClient) GetArchivedWorkflow(_ context.Context, in *workflowarchivepkg.GetArchivedWorkflowRequest, _ ...grpc.CallOption) (*wfv1.Workflow, error) {
func (h ArchivedWorkflowsServiceClient) GetArchivedWorkflow(ctx context.Context, in *workflowarchivepkg.GetArchivedWorkflowRequest, _ ...grpc.CallOption) (*wfv1.Workflow, error) {
out := &wfv1.Workflow{}
return out, h.Get(in, out, "/api/v1/archived-workflows/{uid}")
return out, h.Get(ctx, in, out, "/api/v1/archived-workflows/{uid}")
}

func (h ArchivedWorkflowsServiceClient) DeleteArchivedWorkflow(_ context.Context, in *workflowarchivepkg.DeleteArchivedWorkflowRequest, _ ...grpc.CallOption) (*workflowarchivepkg.ArchivedWorkflowDeletedResponse, error) {
func (h ArchivedWorkflowsServiceClient) DeleteArchivedWorkflow(ctx context.Context, in *workflowarchivepkg.DeleteArchivedWorkflowRequest, _ ...grpc.CallOption) (*workflowarchivepkg.ArchivedWorkflowDeletedResponse, error) {
out := &workflowarchivepkg.ArchivedWorkflowDeletedResponse{}
return out, h.Delete(in, out, "/api/v1/archived-workflows/{uid}")
return out, h.Delete(ctx, in, out, "/api/v1/archived-workflows/{uid}")
}

func (h ArchivedWorkflowsServiceClient) DeleteClusterWorkflowTemplate(_ context.Context, in *clusterworkflowtemplate.ClusterWorkflowTemplateDeleteRequest, _ ...grpc.CallOption) (*clusterworkflowtemplate.ClusterWorkflowTemplateDeleteResponse, error) {
func (h ArchivedWorkflowsServiceClient) DeleteClusterWorkflowTemplate(ctx context.Context, in *clusterworkflowtemplate.ClusterWorkflowTemplateDeleteRequest, _ ...grpc.CallOption) (*clusterworkflowtemplate.ClusterWorkflowTemplateDeleteResponse, error) {
out := &clusterworkflowtemplate.ClusterWorkflowTemplateDeleteResponse{}
return out, h.Delete(in, out, "/api/v1/cluster-workflow-templates/{name}")
return out, h.Delete(ctx, in, out, "/api/v1/cluster-workflow-templates/{name}")
}

func (h ArchivedWorkflowsServiceClient) LintClusterWorkflowTemplate(_ context.Context, in *clusterworkflowtemplate.ClusterWorkflowTemplateLintRequest, _ ...grpc.CallOption) (*wfv1.ClusterWorkflowTemplate, error) {
func (h ArchivedWorkflowsServiceClient) LintClusterWorkflowTemplate(ctx context.Context, in *clusterworkflowtemplate.ClusterWorkflowTemplateLintRequest, _ ...grpc.CallOption) (*wfv1.ClusterWorkflowTemplate, error) {
out := &wfv1.ClusterWorkflowTemplate{}
return out, h.Post(in, out, "/api/v1/cluster-workflow-templates/lint")
return out, h.Post(ctx, in, out, "/api/v1/cluster-workflow-templates/lint")
}

func (h ArchivedWorkflowsServiceClient) ListArchivedWorkflowLabelKeys(_ context.Context, in *workflowarchivepkg.ListArchivedWorkflowLabelKeysRequest, _ ...grpc.CallOption) (*wfv1.LabelKeys, error) {
func (h ArchivedWorkflowsServiceClient) ListArchivedWorkflowLabelKeys(ctx context.Context, in *workflowarchivepkg.ListArchivedWorkflowLabelKeysRequest, _ ...grpc.CallOption) (*wfv1.LabelKeys, error) {
out := &wfv1.LabelKeys{}
return out, h.Get(in, out, "/api/v1/archived-workflows-label-keys")
return out, h.Get(ctx, in, out, "/api/v1/archived-workflows-label-keys")
}

func (h ArchivedWorkflowsServiceClient) ListArchivedWorkflowLabelValues(_ context.Context, in *workflowarchivepkg.ListArchivedWorkflowLabelValuesRequest, _ ...grpc.CallOption) (*wfv1.LabelValues, error) {
func (h ArchivedWorkflowsServiceClient) ListArchivedWorkflowLabelValues(ctx context.Context, in *workflowarchivepkg.ListArchivedWorkflowLabelValuesRequest, _ ...grpc.CallOption) (*wfv1.LabelValues, error) {
out := &wfv1.LabelValues{}
return out, h.Get(in, out, "/api/v1/archived-workflows-label-values")
return out, h.Get(ctx, in, out, "/api/v1/archived-workflows-label-values")
}

func (h ArchivedWorkflowsServiceClient) RetryArchivedWorkflow(_ context.Context, in *workflowarchivepkg.RetryArchivedWorkflowRequest, _ ...grpc.CallOption) (*wfv1.Workflow, error) {
func (h ArchivedWorkflowsServiceClient) RetryArchivedWorkflow(ctx context.Context, in *workflowarchivepkg.RetryArchivedWorkflowRequest, _ ...grpc.CallOption) (*wfv1.Workflow, error) {
out := &wfv1.Workflow{}
return out, h.Put(in, out, "/api/v1/archived-workflows/{uid}/retry")
return out, h.Put(ctx, in, out, "/api/v1/archived-workflows/{uid}/retry")
}

func (h ArchivedWorkflowsServiceClient) ResubmitArchivedWorkflow(_ context.Context, in *workflowarchivepkg.ResubmitArchivedWorkflowRequest, _ ...grpc.CallOption) (*wfv1.Workflow, error) {
func (h ArchivedWorkflowsServiceClient) ResubmitArchivedWorkflow(ctx context.Context, in *workflowarchivepkg.ResubmitArchivedWorkflowRequest, _ ...grpc.CallOption) (*wfv1.Workflow, error) {
out := &wfv1.Workflow{}
return out, h.Put(in, out, "/api/v1/archived-workflows/{uid}/resubmit")
return out, h.Put(ctx, in, out, "/api/v1/archived-workflows/{uid}/resubmit")
}
16 changes: 8 additions & 8 deletions pkg/apiclient/http1/cluster-workflow-template-service-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ import (

type ClusterWorkflowTemplateServiceClient = Facade

func (h ClusterWorkflowTemplateServiceClient) CreateClusterWorkflowTemplate(_ context.Context, in *clusterworkflowtemplate.ClusterWorkflowTemplateCreateRequest, _ ...grpc.CallOption) (*wfv1.ClusterWorkflowTemplate, error) {
func (h ClusterWorkflowTemplateServiceClient) CreateClusterWorkflowTemplate(ctx context.Context, in *clusterworkflowtemplate.ClusterWorkflowTemplateCreateRequest, _ ...grpc.CallOption) (*wfv1.ClusterWorkflowTemplate, error) {
out := &wfv1.ClusterWorkflowTemplate{}
return out, h.Post(in, out, "/api/v1/cluster-workflow-templates")
return out, h.Post(ctx, in, out, "/api/v1/cluster-workflow-templates")
}

func (h ClusterWorkflowTemplateServiceClient) GetClusterWorkflowTemplate(_ context.Context, in *clusterworkflowtemplate.ClusterWorkflowTemplateGetRequest, _ ...grpc.CallOption) (*wfv1.ClusterWorkflowTemplate, error) {
func (h ClusterWorkflowTemplateServiceClient) GetClusterWorkflowTemplate(ctx context.Context, in *clusterworkflowtemplate.ClusterWorkflowTemplateGetRequest, _ ...grpc.CallOption) (*wfv1.ClusterWorkflowTemplate, error) {
out := &wfv1.ClusterWorkflowTemplate{}
return out, h.Get(in, out, "/api/v1/cluster-workflow-templates/{name}")
return out, h.Get(ctx, in, out, "/api/v1/cluster-workflow-templates/{name}")
}

func (h ClusterWorkflowTemplateServiceClient) ListClusterWorkflowTemplates(_ context.Context, in *clusterworkflowtemplate.ClusterWorkflowTemplateListRequest, _ ...grpc.CallOption) (*wfv1.ClusterWorkflowTemplateList, error) {
func (h ClusterWorkflowTemplateServiceClient) ListClusterWorkflowTemplates(ctx context.Context, in *clusterworkflowtemplate.ClusterWorkflowTemplateListRequest, _ ...grpc.CallOption) (*wfv1.ClusterWorkflowTemplateList, error) {
out := &wfv1.ClusterWorkflowTemplateList{}
return out, h.Get(in, out, "/api/v1/cluster-workflow-templates")
return out, h.Get(ctx, in, out, "/api/v1/cluster-workflow-templates")
}

func (h ClusterWorkflowTemplateServiceClient) UpdateClusterWorkflowTemplate(_ context.Context, in *clusterworkflowtemplate.ClusterWorkflowTemplateUpdateRequest, _ ...grpc.CallOption) (*wfv1.ClusterWorkflowTemplate, error) {
func (h ClusterWorkflowTemplateServiceClient) UpdateClusterWorkflowTemplate(ctx context.Context, in *clusterworkflowtemplate.ClusterWorkflowTemplateUpdateRequest, _ ...grpc.CallOption) (*wfv1.ClusterWorkflowTemplate, error) {
out := &wfv1.ClusterWorkflowTemplate{}
return out, h.Put(in, out, "/api/v1/cluster-workflow-templates/{name}")
return out, h.Put(ctx, in, out, "/api/v1/cluster-workflow-templates/{name}")
}
28 changes: 14 additions & 14 deletions pkg/apiclient/http1/cron-workflow-service-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,42 +11,42 @@ import (

type CronWorkflowServiceClient = Facade

func (h CronWorkflowServiceClient) LintCronWorkflow(_ context.Context, in *cronworkflowpkg.LintCronWorkflowRequest, _ ...grpc.CallOption) (*wfv1.CronWorkflow, error) {
func (h CronWorkflowServiceClient) LintCronWorkflow(ctx context.Context, in *cronworkflowpkg.LintCronWorkflowRequest, _ ...grpc.CallOption) (*wfv1.CronWorkflow, error) {
out := &wfv1.CronWorkflow{}
return out, h.Post(in, out, "/api/v1/cron-workflows/{namespace}/lint")
return out, h.Post(ctx, in, out, "/api/v1/cron-workflows/{namespace}/lint")
}

func (h CronWorkflowServiceClient) CreateCronWorkflow(_ context.Context, in *cronworkflowpkg.CreateCronWorkflowRequest, _ ...grpc.CallOption) (*wfv1.CronWorkflow, error) {
func (h CronWorkflowServiceClient) CreateCronWorkflow(ctx context.Context, in *cronworkflowpkg.CreateCronWorkflowRequest, _ ...grpc.CallOption) (*wfv1.CronWorkflow, error) {
out := &wfv1.CronWorkflow{}
return out, h.Post(in, out, "/api/v1/cron-workflows/{namespace}")
return out, h.Post(ctx, in, out, "/api/v1/cron-workflows/{namespace}")
}

func (h CronWorkflowServiceClient) ListCronWorkflows(_ context.Context, in *cronworkflowpkg.ListCronWorkflowsRequest, _ ...grpc.CallOption) (*wfv1.CronWorkflowList, error) {
func (h CronWorkflowServiceClient) ListCronWorkflows(ctx context.Context, in *cronworkflowpkg.ListCronWorkflowsRequest, _ ...grpc.CallOption) (*wfv1.CronWorkflowList, error) {
out := &wfv1.CronWorkflowList{}
return out, h.Get(in, out, "/api/v1/cron-workflows/{namespace}")
return out, h.Get(ctx, in, out, "/api/v1/cron-workflows/{namespace}")
}

func (h CronWorkflowServiceClient) GetCronWorkflow(_ context.Context, in *cronworkflowpkg.GetCronWorkflowRequest, _ ...grpc.CallOption) (*wfv1.CronWorkflow, error) {
func (h CronWorkflowServiceClient) GetCronWorkflow(ctx context.Context, in *cronworkflowpkg.GetCronWorkflowRequest, _ ...grpc.CallOption) (*wfv1.CronWorkflow, error) {
out := &wfv1.CronWorkflow{}
return out, h.Get(in, out, "/api/v1/cron-workflows/{namespace}/{name}")
return out, h.Get(ctx, in, out, "/api/v1/cron-workflows/{namespace}/{name}")
}

func (h CronWorkflowServiceClient) UpdateCronWorkflow(_ context.Context, in *cronworkflowpkg.UpdateCronWorkflowRequest, _ ...grpc.CallOption) (*wfv1.CronWorkflow, error) {
func (h CronWorkflowServiceClient) UpdateCronWorkflow(ctx context.Context, in *cronworkflowpkg.UpdateCronWorkflowRequest, _ ...grpc.CallOption) (*wfv1.CronWorkflow, error) {
out := &wfv1.CronWorkflow{}
return out, h.Put(in, out, "/api/v1/cron-workflows/{namespace}/{name}")
return out, h.Put(ctx, in, out, "/api/v1/cron-workflows/{namespace}/{name}")
}

func (h Facade) ResumeCronWorkflow(ctx context.Context, in *cronworkflowpkg.CronWorkflowResumeRequest, opts ...grpc.CallOption) (*wfv1.CronWorkflow, error) {
out := &wfv1.CronWorkflow{}
return out, h.Put(in, out, "/api/v1/cron-workflows/{namespace}/{name}/resume")
return out, h.Put(ctx, in, out, "/api/v1/cron-workflows/{namespace}/{name}/resume")
}

func (h Facade) SuspendCronWorkflow(ctx context.Context, in *cronworkflowpkg.CronWorkflowSuspendRequest, opts ...grpc.CallOption) (*wfv1.CronWorkflow, error) {
out := &wfv1.CronWorkflow{}
return out, h.Put(in, out, "/api/v1/cron-workflows/{namespace}/{name}/suspend")
return out, h.Put(ctx, in, out, "/api/v1/cron-workflows/{namespace}/{name}/suspend")
}

func (h CronWorkflowServiceClient) DeleteCronWorkflow(_ context.Context, in *cronworkflowpkg.DeleteCronWorkflowRequest, _ ...grpc.CallOption) (*cronworkflowpkg.CronWorkflowDeletedResponse, error) {
func (h CronWorkflowServiceClient) DeleteCronWorkflow(ctx context.Context, in *cronworkflowpkg.DeleteCronWorkflowRequest, _ ...grpc.CallOption) (*cronworkflowpkg.CronWorkflowDeletedResponse, error) {
out := &cronworkflowpkg.CronWorkflowDeletedResponse{}
return out, h.Delete(in, out, "/api/v1/cron-workflows/{namespace}/{name}")
return out, h.Delete(ctx, in, out, "/api/v1/cron-workflows/{namespace}/{name}")
}
58 changes: 33 additions & 25 deletions pkg/apiclient/http1/facade.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package http1
import (
"bufio"
"bytes"
"context"
"crypto/tls"
"encoding/json"
"fmt"
Expand All @@ -25,35 +26,36 @@ type Facade struct {
authorization string
insecureSkipVerify bool
headers []string
httpClient *http.Client
}

func NewFacade(baseUrl, authorization string, insecureSkipVerify bool, headers []string) Facade {
return Facade{baseUrl, authorization, insecureSkipVerify, headers}
func NewFacade(baseUrl, authorization string, insecureSkipVerify bool, headers []string, httpClient *http.Client) Facade {
return Facade{baseUrl, authorization, insecureSkipVerify, headers, httpClient}
}

func (h Facade) Get(in, out interface{}, path string) error {
return h.do(in, out, "GET", path)
func (h Facade) Get(ctx context.Context, in, out interface{}, path string) error {
return h.do(ctx, in, out, "GET", path)
}

func (h Facade) Put(in, out interface{}, path string) error {
return h.do(in, out, "PUT", path)
func (h Facade) Put(ctx context.Context, in, out interface{}, path string) error {
return h.do(ctx, in, out, "PUT", path)
}

func (h Facade) Post(in, out interface{}, path string) error {
return h.do(in, out, "POST", path)
func (h Facade) Post(ctx context.Context, in, out interface{}, path string) error {
return h.do(ctx, in, out, "POST", path)
}

func (h Facade) Delete(in, out interface{}, path string) error {
return h.do(in, out, "DELETE", path)
func (h Facade) Delete(ctx context.Context, in, out interface{}, path string) error {
return h.do(ctx, in, out, "DELETE", path)
}

func (h Facade) EventStreamReader(in interface{}, path string) (*bufio.Reader, error) {
func (h Facade) EventStreamReader(ctx context.Context, in interface{}, path string) (*bufio.Reader, error) {
method := "GET"
u, err := h.url(method, path, in)
if err != nil {
return nil, err
}
req, err := http.NewRequest("GET", u.String(), nil)
req, err := http.NewRequestWithContext(ctx, "GET", u.String(), nil)
if err != nil {
return nil, err
}
Expand All @@ -65,12 +67,15 @@ func (h Facade) EventStreamReader(in interface{}, path string) (*bufio.Reader, e
req.Header.Set("Accept", "text/event-stream")
req.Header.Set("Authorization", h.authorization)
log.Debugf("curl -H 'Accept: text/event-stream' -H 'Authorization: ******' '%v'", u)
client := &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: h.insecureSkipVerify,
client := h.httpClient
if h.httpClient == nil {
client = &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: h.insecureSkipVerify,
},
},
},
}
}
resp, err := client.Do(req)
if err != nil {
Expand All @@ -84,7 +89,7 @@ func (h Facade) EventStreamReader(in interface{}, path string) (*bufio.Reader, e
return bufio.NewReader(resp.Body), nil
}

func (h Facade) do(in interface{}, out interface{}, method string, path string) error {
func (h Facade) do(ctx context.Context, in interface{}, out interface{}, method string, path string) error {
var data []byte
if method != "GET" {
var err error
Expand All @@ -97,7 +102,7 @@ func (h Facade) do(in interface{}, out interface{}, method string, path string)
if err != nil {
return err
}
req, err := http.NewRequest(method, u.String(), bytes.NewReader(data))
req, err := http.NewRequestWithContext(ctx, method, u.String(), bytes.NewReader(data))
if err != nil {
return err
}
Expand All @@ -108,13 +113,16 @@ func (h Facade) do(in interface{}, out interface{}, method string, path string)
req.Header = headers
req.Header.Set("Authorization", h.authorization)
log.Debugf("curl -X %s -H 'Authorization: ******' -d '%s' '%v'", method, string(data), u)
client := &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: h.insecureSkipVerify,
client := h.httpClient
if h.httpClient == nil {
client = &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: h.insecureSkipVerify,
},
DisableKeepAlives: true,
},
DisableKeepAlives: true,
},
}
}
resp, err := client.Do(req)
if err != nil {
Expand Down
16 changes: 8 additions & 8 deletions pkg/apiclient/http1/info-service-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ import (

type InfoServiceClient = Facade

func (h InfoServiceClient) GetInfo(_ context.Context, in *infopkg.GetInfoRequest, _ ...grpc.CallOption) (*infopkg.InfoResponse, error) {
func (h InfoServiceClient) GetInfo(ctx context.Context, in *infopkg.GetInfoRequest, _ ...grpc.CallOption) (*infopkg.InfoResponse, error) {
out := &infopkg.InfoResponse{}
return out, h.Get(in, out, "/api/v1/info")
return out, h.Get(ctx, in, out, "/api/v1/info")
}

func (h InfoServiceClient) GetVersion(_ context.Context, in *infopkg.GetVersionRequest, _ ...grpc.CallOption) (*wfv1.Version, error) {
func (h InfoServiceClient) GetVersion(ctx context.Context, in *infopkg.GetVersionRequest, _ ...grpc.CallOption) (*wfv1.Version, error) {
out := &wfv1.Version{}
return out, h.Get(in, out, "/api/v1/version")
return out, h.Get(ctx, in, out, "/api/v1/version")
}

func (h InfoServiceClient) GetUserInfo(_ context.Context, in *infopkg.GetUserInfoRequest, _ ...grpc.CallOption) (*infopkg.GetUserInfoResponse, error) {
func (h InfoServiceClient) GetUserInfo(ctx context.Context, in *infopkg.GetUserInfoRequest, _ ...grpc.CallOption) (*infopkg.GetUserInfoResponse, error) {
out := &infopkg.GetUserInfoResponse{}
return out, h.Get(in, out, "/api/v1/userinfo")
return out, h.Get(ctx, in, out, "/api/v1/userinfo")
}

func (h InfoServiceClient) CollectEvent(_ context.Context, in *infopkg.CollectEventRequest, _ ...grpc.CallOption) (*infopkg.CollectEventResponse, error) {
func (h InfoServiceClient) CollectEvent(ctx context.Context, in *infopkg.CollectEventRequest, _ ...grpc.CallOption) (*infopkg.CollectEventResponse, error) {
out := &infopkg.CollectEventResponse{}
return out, h.Post(in, out, "/api/v1/tracking/event")
return out, h.Post(ctx, in, out, "/api/v1/tracking/event")
}
Loading

0 comments on commit 5ccd0af

Please sign in to comment.