mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-10-30 21:30:16 +00:00 
			
		
		
		
	godep restore pushd $GOPATH/src/github.com/appc/spec git co master popd go get go4.org/errorutil rm -rf Godeps godep save ./... git add vendor git add -f $(git ls-files --other vendor/) git co -- Godeps/LICENSES Godeps/.license_file_state Godeps/OWNERS
		
			
				
	
	
		
			33 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package gophercloud
 | |
| 
 | |
| 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 {
 | |
| 	// 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 /.
 | |
| 	Endpoint string
 | |
| 
 | |
| 	// ResourceBase is the base URL shared by the resources within a service's API. It should include
 | |
| 	// the API version and, like Endpoint, MUST end with a / if set. If not set, the Endpoint is used
 | |
| 	// as-is, instead.
 | |
| 	ResourceBase string
 | |
| }
 | |
| 
 | |
| // ResourceBaseURL returns the base URL of any resources used by this service. It MUST end with a /.
 | |
| func (client *ServiceClient) ResourceBaseURL() string {
 | |
| 	if client.ResourceBase != "" {
 | |
| 		return client.ResourceBase
 | |
| 	}
 | |
| 	return client.Endpoint
 | |
| }
 | |
| 
 | |
| // ServiceURL constructs a URL for a resource belonging to this provider.
 | |
| func (client *ServiceClient) ServiceURL(parts ...string) string {
 | |
| 	return client.ResourceBaseURL() + strings.Join(parts, "/")
 | |
| }
 |