Skip to content

Instantly share code, notes, and snippets.

@sbose78
Created February 8, 2018 08:37
Show Gist options
  • Save sbose78/ae594bd1cfc1903a0d1d6389b0e05954 to your computer and use it in GitHub Desktop.
Save sbose78/ae594bd1cfc1903a0d1d6389b0e05954 to your computer and use it in GitHub Desktop.
func createClient(ctx context.Context, config tenantConfig) (*tenant.Client, error) {
u, err := url.Parse(config.GetTenantServiceURL())
if err != nil {
return nil, err
}
c := tenant.New(client.HTTPClientDoer(http.DefaultClient))
c.Host = u.Host
c.Scheme = u.Scheme
c.SetJWTSigner(goasupport.NewForwardSigner(ctx))
return c, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment