metadata

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigDriveID = "configDrive"
	MetadataID    = "metadataService"
)

Variables

View Source
var (
	ErrBadMetadata = errors.New("invalid OpenStack metadata, got empty uuid")
)

Functions

This section is empty.

Types

type DeviceMetadata

type DeviceMetadata struct {
	Type    string `json:"type"`
	Bus     string `json:"bus,omitempty"`
	Serial  string `json:"serial,omitempty"`
	Address string `json:"address,omitempty"`
}

type IMetadata

type IMetadata interface {
	GetInstanceID() (string, error)
	GetAvailabilityZone() (string, error)
	GetProjectID() (string, error)
}

func GetMetadataProvider

func GetMetadataProvider(order string) IMetadata

type Metadata

type Metadata struct {
	UUID             string           `json:"uuid"`
	Name             string           `json:"name"`
	AvailabilityZone string           `json:"availability_zone"`
	ProjectID        string           `json:"project_id"`
	Devices          []DeviceMetadata `json:"devices,omitempty"`
}

func Get

func Get(order string) (*Metadata, error)

type MyDuration

type MyDuration struct {
	time.Duration
}

type Opts

type Opts struct {
	SearchOrder    string     `gcfg:"search-order"`    // will be configDriver
	RequestTimeout MyDuration `gcfg:"request-timeout"` // will be 0
}

Jump to

Keyboard shortcuts

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