This repository has been archived by the owner on Oct 21, 2020. It is now read-only.
Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
gophercloud/provider_client.go
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
33 lines (28 sloc)
1.28 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gophercloud | |
// ProviderClient stores details that are required to interact with any | |
// services within a specific provider's API. | |
// | |
// Generally, you acquire a ProviderClient by calling the NewClient method in | |
// the appropriate provider's child package, providing whatever authentication | |
// credentials are required. | |
type ProviderClient struct { | |
// IdentityBase is the base URL used for a particular provider's identity | |
// service - it will be used when issuing authenticatation requests. It | |
// should point to the root resource of the identity service, not a specific | |
// identity version. | |
IdentityBase string | |
// IdentityEndpoint is the identity endpoint. This may be a specific version | |
// of the identity service. If this is the case, this endpoint is used rather | |
// than querying versions first. | |
IdentityEndpoint string | |
// TokenID is the ID of the most recently issued valid token. | |
TokenID string | |
// EndpointLocator describes how this provider discovers the endpoints for | |
// its constituent services. | |
EndpointLocator EndpointLocator | |
} | |
// AuthenticatedHeaders returns a map of HTTP headers that are common for all | |
// authenticated service requests. | |
func (client *ProviderClient) AuthenticatedHeaders() map[string]string { | |
return map[string]string{"X-Auth-Token": client.TokenID} | |
} |