Documentation ¶
Index ¶
- Constants
- Variables
- func Decrypt(s string, keyring []byte) ([]byte, error)
- func LoadAK() (string, string, error)
- func NewMetaData() prvd.IMetaData
- func PKCS5UnPadding(origData []byte) []byte
- func RefreshToken(mgr *ClientMgr, token *DefaultToken) error
- type AddonToken
- type AkAuthToken
- type BaseMetaData
- func (m *BaseMetaData) ClusterID() string
- func (m *BaseMetaData) DNSNameServers() ([]string, error)
- func (m *BaseMetaData) EIPv4() (string, error)
- func (m *BaseMetaData) HostName() (string, error)
- func (m *BaseMetaData) ImageID() (string, error)
- func (m *BaseMetaData) InstanceID() (string, error)
- func (m *BaseMetaData) Mac() (string, error)
- func (m *BaseMetaData) NTPConfigServers() ([]string, error)
- func (m *BaseMetaData) NetworkType() (string, error)
- func (m *BaseMetaData) New() *MetaDataRequest
- func (m *BaseMetaData) OwnerAccountID() (string, error)
- func (m *BaseMetaData) PrivateIPv4() (string, error)
- func (m *BaseMetaData) RamRoleToken(role string) (prvd.RoleAuth, error)
- func (m *BaseMetaData) Region() (string, error)
- func (m *BaseMetaData) RoleName() (string, error)
- func (m *BaseMetaData) SerialNumber() (string, error)
- func (m *BaseMetaData) SourceAddress() (string, error)
- func (m *BaseMetaData) VpcCIDRBlock() (string, error)
- func (m *BaseMetaData) VpcID() (string, error)
- func (m *BaseMetaData) VswitchCIDRBlock() (string, error)
- func (m *BaseMetaData) VswitchID() (string, error)
- func (m *BaseMetaData) Zone() (string, error)
- type CfgMetaData
- func (m *CfgMetaData) ClusterID() string
- func (m *CfgMetaData) DNSNameServers() ([]string, error)
- func (m *CfgMetaData) EIPv4() (string, error)
- func (m *CfgMetaData) HostName() (string, error)
- func (m *CfgMetaData) ImageID() (string, error)
- func (m *CfgMetaData) InstanceID() (string, error)
- func (m *CfgMetaData) Mac() (string, error)
- func (m *CfgMetaData) NTPConfigServers() ([]string, error)
- func (m *CfgMetaData) NetworkType() (string, error)
- func (m *CfgMetaData) OwnerAccountID() (string, error)
- func (m *CfgMetaData) PrivateIPv4() (string, error)
- func (m *CfgMetaData) RamRoleToken(role string) (prvd.RoleAuth, error)
- func (m *CfgMetaData) Region() (string, error)
- func (m *CfgMetaData) RoleName() (string, error)
- func (m *CfgMetaData) SerialNumber() (string, error)
- func (m *CfgMetaData) SourceAddress() (string, error)
- func (m *CfgMetaData) VpcCIDRBlock() (string, error)
- func (m *CfgMetaData) VpcID() (string, error)
- func (m *CfgMetaData) VswitchCIDRBlock() (string, error)
- func (m *CfgMetaData) VswitchID() (string, error)
- func (m *CfgMetaData) Zone() (string, error)
- type ClientMgr
- type DefaultToken
- type IMetaDataRequest
- 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 RamRoleToken
- type ResultList
- type ServiceToken
- type TimeoutError
- type TokenAuth
Constants ¶
View Source
const ( KubernetesCloudControllerManager = "ack.ccm" AgentClusterId = "ClusterId" TokenSyncPeriod = 10 * time.Minute AccessKeyID = "ACCESS_KEY_ID" AccessKeySecret = "ACCESS_KEY_SECRET" )
View Source
const ( ENDPOINT = "http://100.100.100.200" META_VERSION_LATEST = "latest" RS_TYPE_META_DATA = "meta-data" RS_TYPE_USER_DATA = "user-data" 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" )
View Source
const (
AddonTokenFilePath = "/var/addon/token-config"
)
Variables ¶
View Source
var CLUSTER_ID = "clusterid"
Functions ¶
func PKCS5UnPadding ¶
func RefreshToken ¶
func RefreshToken(mgr *ClientMgr, token *DefaultToken) error
Types ¶
type AddonToken ¶
type AddonToken struct {
Region string `json:"region,omitempty"`
}
func (*AddonToken) NextToken ¶
func (f *AddonToken) NextToken() (*DefaultToken, error)
type AkAuthToken ¶
type AkAuthToken struct {
Region string
}
AkAuthToken implement ak auth
func (*AkAuthToken) NextToken ¶
func (f *AkAuthToken) NextToken() (*DefaultToken, error)
type BaseMetaData ¶
type BaseMetaData struct {
// contains filtered or unexported fields
}
func NewBaseMetaData ¶
func NewBaseMetaData(client *http.Client) *BaseMetaData
func (*BaseMetaData) ClusterID ¶
func (m *BaseMetaData) ClusterID() string
func (*BaseMetaData) DNSNameServers ¶
func (m *BaseMetaData) DNSNameServers() ([]string, error)
func (*BaseMetaData) EIPv4 ¶
func (m *BaseMetaData) EIPv4() (string, error)
func (*BaseMetaData) HostName ¶
func (m *BaseMetaData) HostName() (string, error)
func (*BaseMetaData) ImageID ¶
func (m *BaseMetaData) ImageID() (string, error)
func (*BaseMetaData) InstanceID ¶
func (m *BaseMetaData) InstanceID() (string, error)
func (*BaseMetaData) Mac ¶
func (m *BaseMetaData) Mac() (string, error)
func (*BaseMetaData) NTPConfigServers ¶
func (m *BaseMetaData) NTPConfigServers() ([]string, error)
func (*BaseMetaData) NetworkType ¶
func (m *BaseMetaData) NetworkType() (string, error)
func (*BaseMetaData) New ¶
func (m *BaseMetaData) New() *MetaDataRequest
func (*BaseMetaData) OwnerAccountID ¶
func (m *BaseMetaData) OwnerAccountID() (string, error)
func (*BaseMetaData) PrivateIPv4 ¶
func (m *BaseMetaData) PrivateIPv4() (string, error)
func (*BaseMetaData) RamRoleToken ¶
func (m *BaseMetaData) RamRoleToken(role string) (prvd.RoleAuth, error)
func (*BaseMetaData) Region ¶
func (m *BaseMetaData) Region() (string, error)
func (*BaseMetaData) RoleName ¶
func (m *BaseMetaData) RoleName() (string, error)
func (*BaseMetaData) SerialNumber ¶
func (m *BaseMetaData) SerialNumber() (string, error)
func (*BaseMetaData) SourceAddress ¶
func (m *BaseMetaData) SourceAddress() (string, error)
func (*BaseMetaData) VpcCIDRBlock ¶
func (m *BaseMetaData) VpcCIDRBlock() (string, error)
func (*BaseMetaData) VpcID ¶
func (m *BaseMetaData) VpcID() (string, error)
func (*BaseMetaData) VswitchCIDRBlock ¶
func (m *BaseMetaData) VswitchCIDRBlock() (string, error)
func (*BaseMetaData) VswitchID ¶
func (m *BaseMetaData) VswitchID() (string, error)
func (*BaseMetaData) Zone ¶
func (m *BaseMetaData) Zone() (string, error)
type CfgMetaData ¶
type CfgMetaData struct {
// contains filtered or unexported fields
}
func (*CfgMetaData) ClusterID ¶
func (m *CfgMetaData) ClusterID() string
func (*CfgMetaData) DNSNameServers ¶
func (m *CfgMetaData) DNSNameServers() ([]string, error)
func (*CfgMetaData) EIPv4 ¶
func (m *CfgMetaData) EIPv4() (string, error)
func (*CfgMetaData) HostName ¶
func (m *CfgMetaData) HostName() (string, error)
func (*CfgMetaData) ImageID ¶
func (m *CfgMetaData) ImageID() (string, error)
func (*CfgMetaData) InstanceID ¶
func (m *CfgMetaData) InstanceID() (string, error)
func (*CfgMetaData) Mac ¶
func (m *CfgMetaData) Mac() (string, error)
func (*CfgMetaData) NTPConfigServers ¶
func (m *CfgMetaData) NTPConfigServers() ([]string, error)
func (*CfgMetaData) NetworkType ¶
func (m *CfgMetaData) NetworkType() (string, error)
func (*CfgMetaData) OwnerAccountID ¶
func (m *CfgMetaData) OwnerAccountID() (string, error)
func (*CfgMetaData) PrivateIPv4 ¶
func (m *CfgMetaData) PrivateIPv4() (string, error)
func (*CfgMetaData) RamRoleToken ¶
func (m *CfgMetaData) RamRoleToken(role string) (prvd.RoleAuth, error)
func (*CfgMetaData) Region ¶
func (m *CfgMetaData) Region() (string, error)
func (*CfgMetaData) RoleName ¶
func (m *CfgMetaData) RoleName() (string, error)
func (*CfgMetaData) SerialNumber ¶
func (m *CfgMetaData) SerialNumber() (string, error)
func (*CfgMetaData) SourceAddress ¶
func (m *CfgMetaData) SourceAddress() (string, error)
func (*CfgMetaData) VpcCIDRBlock ¶
func (m *CfgMetaData) VpcCIDRBlock() (string, error)
func (*CfgMetaData) VpcID ¶
func (m *CfgMetaData) VpcID() (string, error)
func (*CfgMetaData) VswitchCIDRBlock ¶
func (m *CfgMetaData) VswitchCIDRBlock() (string, error)
func (*CfgMetaData) VswitchID ¶
func (m *CfgMetaData) VswitchID() (string, error)
zone1:vswitchid1,zone2:vswitch2
func (*CfgMetaData) Zone ¶
func (m *CfgMetaData) Zone() (string, error)
type ClientMgr ¶
type ClientMgr struct { Region string Meta prvd.IMetaData ECS *ecs.Client VPC *vpc.Client SLB *slb.Client PVTZ *pvtz.Client ALB *alb.Client NLB *nlb.Client SLS *sls.Client CAS *cas.Client ESS *ess.Client // contains filtered or unexported fields }
ClientMgr client manager for aliyun sdk
func NewClientMgr ¶
NewClientMgr return a new client manager
func (*ClientMgr) GetTokenAuth ¶
type DefaultToken ¶
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 }
type MetaDataRequest ¶
type MetaDataRequest struct {
// contains filtered or unexported fields
}
func (*MetaDataRequest) Decode ¶
func (vpc *MetaDataRequest) Decode(data string, api interface{}) error
func (*MetaDataRequest) Do ¶
func (vpc *MetaDataRequest) Do(api interface{}) (err error)
func (*MetaDataRequest) Resource ¶
func (vpc *MetaDataRequest) Resource(resource string) IMetaDataRequest
func (*MetaDataRequest) ResourceType ¶
func (vpc *MetaDataRequest) ResourceType(rtype string) IMetaDataRequest
func (*MetaDataRequest) SubResource ¶
func (vpc *MetaDataRequest) SubResource(sub string) IMetaDataRequest
func (*MetaDataRequest) Url ¶
func (vpc *MetaDataRequest) Url() (string, error)
func (*MetaDataRequest) Version ¶
func (vpc *MetaDataRequest) Version(version string) IMetaDataRequest
type RamRoleToken ¶
type RamRoleToken struct {
// contains filtered or unexported fields
}
func (*RamRoleToken) NextToken ¶
func (f *RamRoleToken) NextToken() (*DefaultToken, error)
type ResultList ¶
type ResultList struct {
// contains filtered or unexported fields
}
type ServiceToken ¶
ServiceToken is an implementation of service account auth
func (*ServiceToken) NextToken ¶
func (f *ServiceToken) NextToken() (*DefaultToken, error)
type TimeoutError ¶
type TokenAuth ¶
type TokenAuth interface {
NextToken() (*DefaultToken, error)
}
TokenAuth is an interface of Token auth method
Click to show internal directories.
Click to hide internal directories.