metadata

package
v0.0.0-...-d999168 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENDPOINT = "http://metadata.tencentyun.com/latest/meta-data"

	INSTANCE_ID  = "instance-id"
	UUID         = "uuid"
	MAC          = "mac"
	PRIVATE_IPV4 = "local-ipv4"
	REGION       = "placement/region"
	ZONE         = "placement/zone"
	PUBLIC_IPV4  = "public-ipv4"

	ENI_MACS         = "network/interfaces/macs"
	ENI_PRIMARY_IPV4 = "network/interfaces/macs/%s/primary-local-ipv4"

	ENI_IPV4S                 = "network/interfaces/macs/%s/local-ipv4s"
	ENI_IPV4_GATEWAY          = "network/interfaces/macs/%s/local-ipv4s/%s/gateway"
	ENI_IPV4_PUBLIC_IPV4      = "network/interfaces/macs/%s/local-ipv4s/%s/public-ipv4"
	ENI_IPV4_PUBLIC_IPV4_MODE = "network/interfaces/macs/%s/local-ipv4s/%s/public-ipv4-mode"
	ENI_IPV4_SUBNET_MASK      = "network/interfaces/macs/%s/local-ipv4s/%s/subnet-mask"

	NEWLINE_CHAR = "\n"
	DIR_SEQ      = "/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IMetaDataClient

type IMetaDataClient interface {
	Resource(resource string) IMetaDataClient
	Go() (string, error)
	Url() (string, error)
}

type MetaData

type MetaData struct {
	// contains filtered or unexported fields
}

func NewMetaData

func NewMetaData(client *http.Client) *MetaData

func (*MetaData) EniIpv4GateWay

func (m *MetaData) EniIpv4GateWay(mac, ip string) (string, error)

func (*MetaData) EniIpv4List

func (m *MetaData) EniIpv4List(mac string) ([]string, error)

func (*MetaData) EniIpv4PublicIpv4

func (m *MetaData) EniIpv4PublicIpv4(mac, ip string) (string, error)

func (*MetaData) EniIpv4PublicIpv4Mode

func (m *MetaData) EniIpv4PublicIpv4Mode(mac, ip string) (string, error)

mode ---> EIP/NAT

func (*MetaData) EniIpv4SubnetMask

func (m *MetaData) EniIpv4SubnetMask(mac, ip string) (string, error)

mask ---> 255.255.0.0

func (*MetaData) EniMacs

func (m *MetaData) EniMacs() ([]string, error)

func (*MetaData) EniPrimaryIpv4

func (m *MetaData) EniPrimaryIpv4(mac string) (string, error)

func (*MetaData) InstanceID

func (m *MetaData) InstanceID() (string, error)

func (*MetaData) Mac

func (m *MetaData) Mac() (string, error)

func (*MetaData) PrivateIPv4

func (m *MetaData) PrivateIPv4() (string, error)

func (*MetaData) PublicIPv4

func (m *MetaData) PublicIPv4() (string, error)

func (*MetaData) Region

func (m *MetaData) Region() (string, error)

func (*MetaData) UUID

func (m *MetaData) UUID() (string, error)

func (*MetaData) Zone

func (m *MetaData) Zone() (string, error)

type MetaDataClient

type MetaDataClient struct {
	// contains filtered or unexported fields
}

func (*MetaDataClient) Go

func (vpc *MetaDataClient) Go() (resu string, err error)

func (*MetaDataClient) Resource

func (m *MetaDataClient) Resource(resource string) IMetaDataClient

func (*MetaDataClient) Url

func (m *MetaDataClient) Url() (string, error)

type Request

type Request struct {
}

type TimeoutError

type TimeoutError interface {
	error
	Timeout() bool // Is the error a timeout?
}

Jump to

Keyboard shortcuts

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