Documentation ¶
Index ¶
- Constants
- type Attempt
- type AttemptStrategy
- type IMetaDataRequest
- type MetaData
- func (m *MetaData) DNSNameServers() ([]string, error)
- func (m *MetaData) EIPv4() (string, error)
- func (m *MetaData) HostName() (string, error)
- func (m *MetaData) ImageID() (string, error)
- func (m *MetaData) InstanceID() (string, error)
- func (m *MetaData) Mac() (string, error)
- func (m *MetaData) NTPConfigServers() ([]string, error)
- func (m *MetaData) NetworkType() (string, error)
- func (m *MetaData) New() *MetaDataRequest
- func (m *MetaData) OwnerAccountID() (string, error)
- func (m *MetaData) PrivateIPv4() (string, error)
- func (m *MetaData) RamRoleToken(role string) (RoleAuth, error)
- func (m *MetaData) Region() (string, error)
- func (m *MetaData) RoleName() (string, error)
- func (m *MetaData) SerialNumber() (string, error)
- func (m *MetaData) SourceAddress() (string, error)
- func (m *MetaData) VpcCIDRBlock() (string, error)
- func (m *MetaData) VpcID() (string, error)
- func (m *MetaData) VswitchCIDRBlock() (string, error)
- func (m *MetaData) VswitchID() (string, error)
- func (m *MetaData) Zone() (string, error)
- type MetaDataRequest
- func (vpc *MetaDataRequest) Decode(data string, api interface{}) error
- func (vpc *MetaDataRequest) Do(api interface{}) (err error)
- func (vpc *MetaDataRequest) Resource(resource string) IMetaDataRequest
- func (vpc *MetaDataRequest) ResourceType(rtype string) IMetaDataRequest
- func (vpc *MetaDataRequest) SubResource(sub string) IMetaDataRequest
- func (vpc *MetaDataRequest) Url() (string, error)
- func (vpc *MetaDataRequest) Version(version string) IMetaDataRequest
- type ResultList
- type RoleAuth
- type TimeoutError
Constants ¶
const ( ENDPOINT = "http://100.100.100.200" DNS_NAMESERVERS = "dns-conf/nameservers" EIPV4 = "eipv4" HOSTNAME = "hostname" IMAGE_ID = "image-id" INSTANCE_ID = "instance-id" MAC = "mac" NETWORK_TYPE = "network-type" NTP_CONF_SERVERS = "ntp-conf/ntp-servers" OWNER_ACCOUNT_ID = "owner-account-id" PRIVATE_IPV4 = "private-ipv4" REGION = "region-id" SERIAL_NUMBER = "serial-number" SOURCE_ADDRESS = "source-address" VPC_CIDR_BLOCK = "vpc-cidr-block" VPC_ID = "vpc-id" VSWITCH_CIDR_BLOCK = "vswitch-cidr-block" VSWITCH_ID = "vswitch-id" ZONE = "zone-id" RAM_SECURITY = "Ram/security-credentials" )
const vars
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attempt ¶
type Attempt struct {
// contains filtered or unexported fields
}
Attempt struct
type AttemptStrategy ¶
type AttemptStrategy struct { Total time.Duration // total duration of attempt. Delay time.Duration // interval between each try in the burst. Min int // minimum number of retries; overrides Total }
AttemptStrategy represents a strategy for waiting for an action to complete successfully. This is an internal type used by the implementation of other packages.
func (AttemptStrategy) Start ¶
func (s AttemptStrategy) Start() *Attempt
Start begins a new sequence of attempts for the given strategy.
type IMetaDataRequest ¶
type IMetaDataRequest interface { Version(version string) IMetaDataRequest ResourceType(rtype string) IMetaDataRequest Resource(resource string) IMetaDataRequest SubResource(sub string) IMetaDataRequest Url() (string, error) Do(api interface{}) error }
IMetaDataRequest interface
type MetaData ¶
type MetaData struct {
// contains filtered or unexported fields
}
MetaData wrap http client
func NewMockMetaData ¶
NewMockMetaData returns mock MetaData
func (*MetaData) DNSNameServers ¶
DNSNameServers returns dns servers
func (*MetaData) InstanceID ¶
InstanceID returns instance Id
func (*MetaData) NTPConfigServers ¶
NTPConfigServers returns ntp servers
func (*MetaData) NetworkType ¶
NetworkType returns network type
func (*MetaData) OwnerAccountID ¶
OwnerAccountID returns owner account id
func (*MetaData) PrivateIPv4 ¶
PrivateIPv4 returns private ipv4 ip address
func (*MetaData) RamRoleToken ¶
RamRoleToken returns ram role token
func (*MetaData) SerialNumber ¶
SerialNumber returns serial number
func (*MetaData) SourceAddress ¶
SourceAddress returns source address
func (*MetaData) VpcCIDRBlock ¶
VpcCIDRBlock returns vpc cidr block
func (*MetaData) VswitchCIDRBlock ¶
VswitchCIDRBlock returns vswitch cidr block
type MetaDataRequest ¶
type MetaDataRequest struct {
// contains filtered or unexported fields
}
MetaDataRequest struct
func (*MetaDataRequest) Decode ¶
func (vpc *MetaDataRequest) Decode(data string, api interface{}) error
Decode returns decoded content
func (*MetaDataRequest) Do ¶
func (vpc *MetaDataRequest) Do(api interface{}) (err error)
Do try to do MetaDataRequest
func (*MetaDataRequest) Resource ¶
func (vpc *MetaDataRequest) Resource(resource string) IMetaDataRequest
Resource sets resource
func (*MetaDataRequest) ResourceType ¶
func (vpc *MetaDataRequest) ResourceType(rtype string) IMetaDataRequest
ResourceType sets resource type
func (*MetaDataRequest) SubResource ¶
func (vpc *MetaDataRequest) SubResource(sub string) IMetaDataRequest
SubResource set sub resource
func (*MetaDataRequest) Version ¶
func (vpc *MetaDataRequest) Version(version string) IMetaDataRequest
Version sets version
type ResultList ¶
type ResultList struct {
// contains filtered or unexported fields
}
ResultList struct
type RoleAuth ¶
type RoleAuth struct { AccessKeyId string AccessKeySecret string Expiration time.Time SecurityToken string LastUpdated time.Time Code string }
RoleAuth struct
type TimeoutError ¶
TimeoutError interface