conf

package
v0.0.0-...-6bb069b Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigFile    = "conf/jupiter.json"
	TryTime       = 3
	ERROR_PARAM   = "parameter error"
	ERROR_CONVERT = "Convert error"
	Interval      = 60
	Time4Wait     = 3                   //unit s
	DateForm      = "2006-01-02T15:04Z" //时间格式
)

Variables

This section is empty.

Functions

func FileExists

func FileExists(filename string) bool

func InitConf

func InitConf()

Types

type Ansible

type Ansible struct {
	Url          string
	GetOctansUrl string
	DefaultRole  string
	ForkNum      int
}

type CloudAccount

type CloudAccount struct {
	KeyID      string //ak
	KeySecret  string //sk
	VendorType string //云厂商类型,支持aliyun, aws
}

func GetAWSCloudAccount

func GetAWSCloudAccount() *CloudAccount

获取一个aws默认账号

func GetCloudAccountByKeyId

func GetCloudAccountByKeyId(id string) *CloudAccount

根据KeyID获取云账号

func GetDefaultCloudAccount

func GetDefaultCloudAccount() *CloudAccount

获取一个默认账号

type Configuration

type Configuration struct {
	Password      string
	OpIp          string
	OpPort        string
	OpUserName    string
	OpPassWord    string
	BufferSize    int
	Ansible       *Ansible
	KeyDir        string
	CloudAccounts []*CloudAccount
}
var (
	Config *Configuration
)

func GetConfig

func GetConfig() (*Configuration, error)

Jump to

Keyboard shortcuts

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