mmds

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: AGPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MMDSBootstrap added in v0.0.7

type MMDSBootstrap struct {
	HostPort     string `json:"HostPort" mapstructure:"HostPort"`
	CaChain      string `json:"CAChain" mapstructure:"CAChain"`
	Certificate  string `json:"Cert" mapstructure:"Cert"`
	Key          string `json:"Key" mapstructure:"Key"`
	ServerName   string `json:"ServerName" mapstructure:"ServerName"`
	PingInterval string `json:"PingInterval" mapstructure:"PingInterval"`
}

func (*MMDSBootstrap) SafePingInterval added in v0.0.8

func (b *MMDSBootstrap) SafePingInterval() time.Duration

type MMDSData

type MMDSData struct {
	Bootstrap      *MMDSBootstrap        `json:"Bootstrap,omitempty" mapstructure:"Bootstrap,omitempty"`
	VMMID          string                `json:"VMMID" mapstructure:"VMMID"`
	Drives         map[string]*MMDSDrive `json:"Drives" mapstructure:"Drives"`
	EntrypointJSON string                `json:"EntrypointJSON" mapstructure:"EntrypointJSON"`
	Env            map[string]string     `json:"Env" mapstructure:"Env"`
	LocalHostname  string                `json:"LocalHostname" mapstructure:"LocalHostname"`
	Machine        *MMDSMachine          `json:"Machine" mapstructure:"Machine"`
	Network        *MMDSNetwork          `json:"Network" mapstructure:"Network"`
	ImageTag       string                `json:"ImageTag" mapstructure:"ImageTag"`
	Users          map[string]*MMDSUser  `json:"Users" mapstructure:"Users"`
}

func GuestFetchMMDSMetadata added in v0.0.2

func GuestFetchMMDSMetadata(logger hclog.Logger, baseURI string) (*MMDSData, error)

GuestFetchMMDSMetadata resolves the metadata from MMDS as a guest.

type MMDSDrive

type MMDSDrive struct {
	DriveID      string `json:"DriveID" mapstructure:"DriveID"`
	IsReadOnly   string `json:"IsReadOnly" mapstructure:"IsReadOnly"`
	IsRootDevice string `json:"IsRootDevice" mapstructure:"IsRootDevice"`
	Partuuid     string `json:"PartUUID" mapstructure:"PartUUID"`
	PathOnHost   string `json:"PathOnHost" mapstructure:"PathOnHost"`
}

type MMDSLatest

type MMDSLatest struct {
	Latest *MMDSLatestMetadata `json:"latest" mapstructure:"latest"`
}

func (*MMDSLatest) Serialize

func (r *MMDSLatest) Serialize() (interface{}, error)

type MMDSLatestMetadata

type MMDSLatestMetadata struct {
	Metadata *MMDSData `json:"meta-data" mapstructure:"meta-data"`
}

type MMDSMachine

type MMDSMachine struct {
	CPU         string `json:"CPU" mapstructure:"CPU"`
	CPUTemplate string `json:"CPUTemplate" mapstructure:"CPUTemplate"`
	HTEnabled   string `json:"HTEnabled" mapstructure:"HTEnabled"`
	KernelArgs  string `json:"KernelArgs" mapstructure:"KernelArgs"`
	Mem         string `json:"Mem" mapstructure:"Mem"`
	VMLinuxID   string `json:"VMLinux" mapstructure:"VMLinux"`
}

type MMDSNetwork

type MMDSNetwork struct {
	CNINetworkName string                           `json:"CniNetworkName" mapstructure:"CniNetworkName"`
	Interfaces     map[string]*MMDSNetworkInterface `json:"Interfaces" mapstructure:"Interfaces"`
}

type MMDSNetworkInterface

type MMDSNetworkInterface struct {
	HostDeviceName string `json:"HostDeviceName" mapstructure:"HostDeviceName"`
	Gateway        string `json:"Gateway" mapstructure:"Gateway"`
	IfName         string `json:"IfName" mapstructure:"IfName"`
	IP             string `json:"IP" mapstructure:"IP"`
	IPAddr         string `json:"IPAddr" mapstructure:"IPAddr"`
	IPMask         string `json:"IPMask" mapstructure:"IPMask"`
	IPNet          string `json:"IPNet" mapstructure:"IPNet"`
	Nameservers    string `json:"NameServers" mapstructure:"NameServers"`
}

type MMDSRootfsEntrypointInfo added in v0.0.3

type MMDSRootfsEntrypointInfo struct {
	Cmd        []string          `json:"Cmd" mapstructure:"Cmd"`
	Entrypoint []string          `json:"EntryPoint" mapstructure:"EntryPoint"`
	Env        map[string]string `json:"Env" mapstructure:"Env"`
	Shell      []string          `json:"Shell" mapstructure:"Shell"`
	User       string            `json:"User" mapstructure:"User"`
	Workdir    string            `json:"Workdir" mapstructure:"Workdir"`
}

func NewMMDSRootfsEntrypointInfoFromJSON added in v0.0.3

func NewMMDSRootfsEntrypointInfoFromJSON(input string) (*MMDSRootfsEntrypointInfo, error)

NewMMDSRootfsEntrypointInfoFromJSON deserializes a JSON string to a *MMDSRootfsEntrypointInfo.

func (*MMDSRootfsEntrypointInfo) ToJsonString added in v0.0.3

func (inst *MMDSRootfsEntrypointInfo) ToJsonString() (string, error)

ToJsonString converts the rootfs entrypoint info to a JSON string.

func (*MMDSRootfsEntrypointInfo) ToShellCommand added in v0.0.3

func (inst *MMDSRootfsEntrypointInfo) ToShellCommand() (string, string, string)

ToShellCommand returns two strings representing a shell in which the command must be executed and a command itself. The final execution of the command should be done in the following way:

shell 'actual-command'

type MMDSUser

type MMDSUser struct {
	SSHKeys string `json:"SSHKeys" mapstructure:"SSHKeys"`
}

Jump to

Keyboard shortcuts

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