cloud

package
v0.12.15 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Which = func() Type {
		switch {
		case IsHuawei():
			return TypeHuawei
		case IsAws():
			return TypeAws
		case IsAliyun():
			return TypeAliyun
		case IsAzure():
			return TypeAzure
		case IsTencent():
			return TypeTencent
		default:
			return TypeUnknown
		}
	}
)

Functions

func GetAliEcsInstanceType

func GetAliEcsInstanceType() (*bytes.Buffer, error)

func GetAliEcsMetadataToken

func GetAliEcsMetadataToken() (*bytes.Buffer, error)

func GetAliEcsNetbwEgress

func GetAliEcsNetbwEgress() (*bytes.Buffer, error)

func GetAliEcsNetbwIngress

func GetAliEcsNetbwIngress() (*bytes.Buffer, error)

func GetAliEcsNetworkSpeed

func GetAliEcsNetworkSpeed() (int, error)

func GetAwsEc2NetSpeed

func GetAwsEc2NetSpeed() (int, error)

func GetAzureVMInstanceMetadata

func GetAzureVMInstanceMetadata() ([]byte, error)

func GetAzureVMNicSpeed added in v0.12.5

func GetAzureVMNicSpeed() (int, error)

func GetEC2IMDSv2Token

func GetEC2IMDSv2Token() (*bytes.Buffer, error)

func GetEC2InstanceType

func GetEC2InstanceType() (*bytes.Buffer, error)

func GetHuaweiEcsMetadata

func GetHuaweiEcsMetadata() (*bytes.Buffer, error)

func GetHuaweiEcsNetworkSpeed

func GetHuaweiEcsNetworkSpeed() (int, error)

func GetNicSpeed

func GetNicSpeed() (int, error)

func GetTencentCvmBandwidthEgress

func GetTencentCvmBandwidthEgress() (*bytes.Buffer, error)

func GetTencentCvmBandwidthIngress

func GetTencentCvmBandwidthIngress() (*bytes.Buffer, error)

func GetTencentCvmInstanceType

func GetTencentCvmInstanceType() (*bytes.Buffer, error)

func GetTencentCvmNetworkSpeed

func GetTencentCvmNetworkSpeed() (int, error)

func IsAliyun

func IsAliyun() bool

func IsAws

func IsAws() bool

func IsAzure

func IsAzure() bool

func IsHuawei

func IsHuawei() bool

func IsTencent

func IsTencent() bool

func RegCloudNicSpeedGetter added in v0.12.5

func RegCloudNicSpeedGetter(typ Type, getter func() (int, error))

Types

type HuaweiEcsNetworkData

type HuaweiEcsNetworkData struct {
	Qos *HuaweiEcsNetworkQosData `json:"qos"`
}

func GetHuaweiEcsNetworkData

func GetHuaweiEcsNetworkData() (*HuaweiEcsNetworkData, error)

type HuaweiEcsNetworkQosData

type HuaweiEcsNetworkQosData struct {
	InstanceMinBandwidth int `json:"instance_min_bandwidth"`
	InstanceMaxBandwidth int `json:"instance_max_bandwidth"`
}

type Type added in v0.9.19

type Type string
const (
	TypeUnknown Type = "unknown"
	TypeAws     Type = "aws"
	TypeAzure   Type = "azure"
	TypeAliyun  Type = "aliyun"
	TypeHuawei  Type = "huawei"
	TypeTencent Type = "tencent"
)

Jump to

Keyboard shortcuts

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