gce

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LatestSupportedMetadataVersion = "v1"

	MetadataURL provider.FormatURL = "http://metadata.google.internal/computeMetadata/%s/%s/?recursive=true"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	Instance struct {
		Hostname string

		NetworkInterfaces []struct {
			IP           net.IP
			Network      string
			ForwardedIPs []net.IP

			AccessConfigs []struct {
				Type       string
				ExternalIP net.IP
			}
		}

		Disks []struct {
			Index int

			Type       string
			DeviceName string
			Mode       string
		}

		Attributes userdata.Map
		// contains filtered or unexported fields
	}

	Project struct {
		ID         float64
		Attributes struct {
			SSHKeys string
		}
	}
}

Metadata represents the version "v1" compute meta-data provided by Google Compute Engine. Uninteresting fields are not exported.

func (*Metadata) Digest

func (md *Metadata) Digest() metadata.Digest

Digest extracts the important parts of meta-data and returns it.

type MetadataService

type MetadataService struct {
	URL provider.FormatURL
}

func (*MetadataService) FetchMetadata

func (s *MetadataService) FetchMetadata() (*metadata.Digest, error)

func (*MetadataService) FetchUserdata

func (s *MetadataService) FetchUserdata() (userdata.Map, error)

FetchUserdata retrieves userdata files from Google Compute Engine metadata service

Jump to

Keyboard shortcuts

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