Documentation
¶
Overview ¶
Implements interaction with the GCP API.
Instance metadata is retrieved from the GCP metadata API.
Retrieving metadata of other instances is done by using the GCP compute API, and requires GCP credentials.
Index ¶
- type Cloud
- func (c *Cloud) Close()
- func (c *Cloud) GetLoadBalancerEndpoint(ctx context.Context) (host, port string, err error)
- func (c *Cloud) InitSecretHash(ctx context.Context) ([]byte, error)
- func (c *Cloud) List(ctx context.Context) ([]metadata.InstanceMetadata, error)
- func (c *Cloud) ProviderID(_ context.Context) (string, error)
- func (c *Cloud) Self(ctx context.Context) (metadata.InstanceMetadata, error)
- func (c *Cloud) UID(ctx context.Context) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cloud ¶
type Cloud struct {
// contains filtered or unexported fields
}
Cloud provides GCP cloud metadata information and API access.
func New ¶
New creates and initializes Cloud. The Close method should be called when Cloud is no longer needed.
func (*Cloud) GetLoadBalancerEndpoint ¶
GetLoadBalancerEndpoint returns the endpoint of the load balancer.
func (*Cloud) InitSecretHash ¶
InitSecretHash retrieves the InitSecretHash of the current instance.
func (*Cloud) List ¶
List retrieves all instances belonging to the current constellation. On GCP, this is done by listing all instances in a region by requesting all instances in each zone.
func (*Cloud) ProviderID ¶
ProviderID returns the providerID of the current instance.