metadata

package
v0.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 4 Imported by: 20

Documentation

Overview

Package iam provides interfaces and wrappers around the google iam client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// InstanceAttributeValue returns the value of the provided VM instance attribute.
	// See https://godoc.org/cloud.google.com/go/compute/metadata#Client.ProjectID
	InstanceAttributeValue(attr string) (string, error)

	// ProjectID returns the current instance's project ID string.
	// See https://godoc.org/cloud.google.com/go/compute/metadata#Client.InstanceAttributeValue
	ProjectID() (string, error)

	// OnGCE reports whether this process is running on Google Compute Engine.
	// See https://godoc.org/cloud.google.com/go/compute/metadata#OnGCE
	OnGCE() bool

	// Zone returns the current VM's zone, such as "us-central1-b".
	// See https://godoc.org/cloud.google.com/go/compute/metadata#Zone
	Zone() (string, error)
}

Client matches the interface exposed by metadata.Client

func NewDefaultMetadataClient

func NewDefaultMetadataClient() Client

func NewMetadataClient

func NewMetadataClient(httpClient *http.Client) Client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL