gcp

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	GcpImdsUrl         = "http://metadata.google.internal/computeMetadata/v1/instance"
	GcpUserDataImdsUrl = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/user-data"
)

Variables

This section is empty.

Functions

func GetUserData

func GetUserData(ctx context.Context, url string) ([]byte, error)

Method to retrieve userData from the instance metadata service and return it as a string

func IsGCP

func IsGCP(ctx context.Context) bool

Method to check if the VM is running on GCP

func NewProvider

func NewProvider(config *Config) (provider.Provider, error)

Types

type Config

type Config struct {
	GcpCredentials string
	ProjectId      string
	Zone           string
	ImageName      string
	MachineType    string
	Network        string
}

func (Config) Redact

func (c Config) Redact() Config

type Manager

type Manager struct{}

func (*Manager) GetConfig

func (_ *Manager) GetConfig() (config *Config)

func (*Manager) LoadEnv

func (_ *Manager) LoadEnv()

func (*Manager) NewProvider

func (_ *Manager) NewProvider() (provider.Provider, error)

func (*Manager) ParseCmd

func (_ *Manager) ParseCmd(flags *flag.FlagSet)

Jump to

Keyboard shortcuts

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