Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComputeMetadata ¶
type ComputeMetadata struct { Project ProjectMetadata `json:"project"` Instance InstanceMetadata `json:"instance"` }
ComputeMetadata represents Google Cloud project metadata returned by /computeMetadata/v1 endpoint.
See https://cloud.google.com/compute/docs/storing-retrieving-metadata for further details.
type ComputeMetadataProvider ¶
type ComputeMetadataProvider struct { Endpoint string // contains filtered or unexported fields }
ComputeMetadataProvider retireves Google Cloud service compute metadata from provided endpoint
func NewComputeMetadataProvider ¶
func NewComputeMetadataProvider(endpoint string, c *http.Client) *ComputeMetadataProvider
NewComputeMetadataProvider initializes a new ComputeMetadataClient with given endpoint and HTTP client. If there is no HTTP client provided, the provider will use http.DefaultClient
func (*ComputeMetadataProvider) ComputeMetadata ¶
func (p *ComputeMetadataProvider) ComputeMetadata(ctx context.Context) (ComputeMetadata, error)
ComputeMetadata returns compute metadata for current instance
type InstanceMetadata ¶
InstanceMetadata represents Google Cloud project metadata returned by /computeMetadata/v1/instance endpoint.
See https://cloud.google.com/compute/docs/storing-retrieving-metadata for further details.
type ProjectMetadata ¶
type ProjectMetadata struct { ProjectID string `json:"projectId"` NumericProjectID int `json:"numericProjectId"` }
ProjectMetadata represents Google Cloud project metadata returned by /computeMetadata/v1/project endpoint.
See https://cloud.google.com/compute/docs/storing-retrieving-metadata for further details.