blob: 2dccde11bb0f8dfc8ea089cba96337db87414bd6 [file] [log] [blame]
Ash Wilson6425a412014-08-29 12:30:35 -04001package gophercloud
2
3import "strings"
4
5// ServiceClient stores details required to interact with a specific service API implemented by a provider.
6// Generally, you'll acquire these by calling the appropriate `New` method on a ProviderClient.
7type ServiceClient struct {
8 // ProviderClient is a reference to the provider that implements this service.
9 ProviderClient
10
11 // Endpoint is the base URL of the service's API, acquired from a service catalog.
12 Endpoint string
13}
14
15// ServiceURL constructs a URL for a resource belonging to this provider.
16func (client *ServiceClient) ServiceURL(parts ...string) string {
17 return client.Endpoint + strings.Join(parts, "/")
18}