Browse files

Embed the ProviderClient struct in ServiceClient.

This lets us inherit the AuthenticatedHeaders method, rather than
having to walk the references all the time.
  • Loading branch information...
1 parent f36c430 commit 55bbaafada72e0bc2af6121f8d1faa6e8e1eb752 @smashwilson smashwilson committed Oct 22, 2014
Showing with 2 additions and 8 deletions.
  1. +2 −8 service_client.go
@@ -5,8 +5,8 @@ import "strings"
// ServiceClient stores details required to interact with a specific service API implemented by a provider.
// Generally, you'll acquire these by calling the appropriate `New` method on a ProviderClient.
type ServiceClient struct {
- // Provider is a reference to the provider that implements this service.
- Provider *ProviderClient
+ // ProviderClient is a reference to the provider that implements this service.
+ *ProviderClient
// Endpoint is the base URL of the service's API, acquired from a service catalog.
// It MUST end with a /.
@@ -30,9 +30,3 @@ func (client *ServiceClient) ResourceBaseURL() string {
func (client *ServiceClient) ServiceURL(parts ...string) string {
return client.ResourceBaseURL() + strings.Join(parts, "/")
-// AuthenticatedHeaders returns a collection of HTTP request headers that mark a request as
-// belonging to the currently authenticated user.
-func (client *ServiceClient) AuthenticatedHeaders() map[string]string {
- return client.Provider.AuthenticatedHeaders()

0 comments on commit 55bbaaf

Please sign in to comment.