Skip to content

Commit 55bbaaf

Browse files
committed
Embed the ProviderClient struct in ServiceClient.
This lets us inherit the AuthenticatedHeaders method, rather than having to walk the references all the time.
1 parent f36c430 commit 55bbaaf

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

service_client.go

+2-8
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import "strings"
55
// ServiceClient stores details required to interact with a specific service API implemented by a provider.
66
// Generally, you'll acquire these by calling the appropriate `New` method on a ProviderClient.
77
type ServiceClient struct {
8-
// Provider is a reference to the provider that implements this service.
9-
Provider *ProviderClient
8+
// ProviderClient is a reference to the provider that implements this service.
9+
*ProviderClient
1010

1111
// Endpoint is the base URL of the service's API, acquired from a service catalog.
1212
// It MUST end with a /.
@@ -30,9 +30,3 @@ func (client *ServiceClient) ResourceBaseURL() string {
3030
func (client *ServiceClient) ServiceURL(parts ...string) string {
3131
return client.ResourceBaseURL() + strings.Join(parts, "/")
3232
}
33-
34-
// AuthenticatedHeaders returns a collection of HTTP request headers that mark a request as
35-
// belonging to the currently authenticated user.
36-
func (client *ServiceClient) AuthenticatedHeaders() map[string]string {
37-
return client.Provider.AuthenticatedHeaders()
38-
}

0 commit comments

Comments
 (0)