tenanter

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoExistAliRegionId     = errors.New("region id not exist in ali")
	ErrNoExistTencentRegionId = errors.New("region id not exist in tencent")
	ErrNoExistHuaweiRegionId  = errors.New("region id not exist in huawei")
	ErrNoExistK8SRegionId     = errors.New("region id not exist in k8s")
)
View Source
var (
	ErrLoadTenanterFromFile  = errors.New("load tenanter from file failed")
	ErrLoadTenanterFromOsEnv = errors.New("load tenanter from os env failed")
	ErrLoadTenanterFileEmpty = errors.New("load tenanter from file failed")
	ErrNoTenanters           = errors.New("no tenanters for the cloud")
)

Functions

func GenTenanter

func GenTenanter(configPath string)

func GetAliRegionId

func GetAliRegionId(regionName string) (int32, error)

GetAliRegionId prefix ali_

func GetAliRegionName

func GetAliRegionName(regionId int32) (string, error)

GetAliRegionName prefix ali_

func GetHuaweiRegionId

func GetHuaweiRegionId(regionName string) (int32, error)

GetHuaweiRegionId prefix huawei

func GetHuaweiRegionName

func GetHuaweiRegionName(regionId int32) (string, error)

GetHuaweiRegionName prefix huawei

func GetK8SRegionId

func GetK8SRegionId(regionName string) (int32, error)

GetK8SRegionId prefix ali_

func GetK8SRegionName

func GetK8SRegionName(regionId int32) (string, error)

GetK8SRegionName prefix ali_

func GetTencentRegionId

func GetTencentRegionId(regionName string) (int32, error)

GetTencentRegionId prefix tc_

func GetTencentRegionName

func GetTencentRegionName(regionId int32) (string, error)

GetTencentRegionName prefix tencent

func LoadCloudConfigs

func LoadCloudConfigs(configFile string) error

func LoadCloudConfigsFromFile

func LoadCloudConfigsFromFile(configFile string) error

func LoadCloudConfigsFromOsEnv

func LoadCloudConfigsFromOsEnv() error

func ShowConfigJson

func ShowConfigJson() ([]byte, error)

Types

type AccessKeyTenant

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

func (*AccessKeyTenant) AccountName

func (tenant *AccessKeyTenant) AccountName() string

func (*AccessKeyTenant) Clone

func (tenant *AccessKeyTenant) Clone() Tenanter

func (*AccessKeyTenant) GetId

func (tenant *AccessKeyTenant) GetId() string

func (*AccessKeyTenant) GetSecret

func (tenant *AccessKeyTenant) GetSecret() string

func (*AccessKeyTenant) GetToken

func (tenant *AccessKeyTenant) GetToken() string

func (*AccessKeyTenant) GetUrl

func (tenant *AccessKeyTenant) GetUrl() string

type Region

type Region interface {
	GetId() int32
	GetName() string
}

func GetAllRegionIds

func GetAllRegionIds(provider pbtenant.CloudProvider) (regions []Region)

func NewRegion

func NewRegion(provider pbtenant.CloudProvider, regionId int32) (Region, error)

type Tenanter

type Tenanter interface {
	AccountName() string
	Clone() Tenanter
}

func GetTenanters

func GetTenanters(provider pbtenant.CloudProvider) ([]Tenanter, error)

func NewTenantWithAccessKey

func NewTenantWithAccessKey(name, accessKeyId, accessKeySecret, url, token string) Tenanter

Jump to

Keyboard shortcuts

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