Help us shape the future of Go! Take the 2026 Go Developer Survey

cloud

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2016 License: MPL-2.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSStats

type AWSStats struct {
	AmiID           string `metadata:"ami-id" `
	AmiLaunchIndex  string `metadata:"ami-launch-index"`
	AmiManifestPath string `metadata:"ami-manifest-path"`
	Hostname        string `metadata:"hostname"`
	InstanceAction  string `metadata:"instance-action"`
	InstanceID      string `metadata:"instance-id"`
	InstanceType    string `metadata:"instance-type"`
	LocalHostname   string `metadata:"local-hostname"`
	LocalIpv4       string `metadata:"local-ipv4"`
	MAC             string `metadata:"mac"`
	Profile         string `metadata:"profile"`
	PublicHostname  string `metadata:"public-hostname"`
	PublicIpv4      string `metadata:"public-ipv4"`
	ReservationID   string `metadata:"reservation-id"`
	SecurityGroups  string `metadata:"security-groups"`

	Spot struct {
		Termination string
	}
}

AWSStats returns the relevant AWS information about the current instance via the machine's EC2 Metadata IP interface.

func NewAWS

func NewAWS() (i *AWSStats)

NewAWS returns an AWSStats if the current machine is an AWS instance otherwise it returns nil.

type Cloud

type Cloud struct {
	// AWS provides information about AWS EC2 metadata.
	// http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html
	AWS *AWSStats `json:",omitempty"`
	// DigitalOcean shows all the information related to
	// DigitalOcean via its metadata interface.
	// https://developers.digitalocean.com/documentation/metadata/
	DigitalOcean *DigitalOceanStats `json:",omitempty"`
}

Cloud contains the metadata provided by the cloud providers.

func New

func New() (c *Cloud)

New creates a new Cloud object and fills in any metadata from the cloud providers.

type DigitalOceanStats

type DigitalOceanStats struct {
	*metadata.Metadata
}

DigitalOceanStats returns information about DigitalOcean droplet metadata.

func NewDigitalOcean

func NewDigitalOcean() *DigitalOceanStats

NewDigitalOcean returns a DigitalOceanStats object otherwise it returns nil.

Jump to

Keyboard shortcuts

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