metadata

package
v0.0.0-...-0a64ede Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRamInfoNil = errors.New("ram info is nil")
View Source
var HasCacheRam = atomic.NewBool(false)

HasCacheRam 开启 RAM 数据缓存

View Source
var HasEnvRam = atomic.NewBool(false)

HasEnvRam 开启 RAM 更新环境变量

Functions

func Hostname

func Hostname() string

Hostname 获取主机名

func ID

func ID() string

ID 获取实例ID

func Region

func Region() string

Region 获取实例所在地域,如 cn-hangzhou

func TerminationTime

func TerminationTime() time.Time

TerminationTime 获取实例释放时间,仅抢占式适用

func Zone

func Zone() string

Zone 获取实例所在可用区,如 cn-hangzhou-b

Types

type RamInfo

type RamInfo struct {
	AccessKeyID     string    `json:"AccessKeyId"`
	AccessKeySecret string    `json:"AccessKeySecret"`
	Expiration      time.Time `json:"Expiration"`
	SecurityToken   string    `json:"SecurityToken"`
	LastUpdated     time.Time `json:"LastUpdated"`
	Code            string    `json:"Code"`
	Error           error     `json:"Error"`
}

func Ram

func Ram(name string) *RamInfo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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