gce

package
v0.0.0-...-a514ca2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithMetadataConfig

func WithMetadataConfig(conf config.Config, meta *Metadata) (config.Config, error)

WithMetadataConfig loads config from a GCE VM environment, in particular loading metadata from GCE's instance metadata. https://cloud.google.com/compute/docs/storing-retrieving-metadata

Types

type Metadata

type Metadata struct {
	Instance struct {
		Name       string
		Hostname   string
		Zone       string
		Attributes struct {
			FunnelConfig            string `json:"funnel-config"`
			FunnelNodeServerAddress string `json:"funnel-node-serveraddress"`
		}
	}
	Project struct {
		ProjectID string `json:"projectId"`
	}
}

Metadata contains a subset of details available from GCE VM metadata.

func LoadMetadata

func LoadMetadata() (*Metadata, error)

LoadMetadata loads metadata from the GCE VM metadata server.

func LoadMetadataFromURL

func LoadMetadataFromURL(url string) (*Metadata, error)

LoadMetadataFromURL loads metadata from the given URL.

Jump to

Keyboard shortcuts

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