tenanter

package
v0.0.0-...-531f83b Latest Latest
Warning

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

Go to latest
Published: May 10, 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")
	ErrNoExistAwsRegionId     = errors.New("region id not exist in aws")
)
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 GetAwsRegionName

func GetAwsRegionName(regionId int32) (string, error)

GetAwsRegionName prefix aws_

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