common

package
v0.0.0-...-b924895 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReportFilePrefix string = "report-"
	ReportFileSuffix string = ".txt"
)

Variables

View Source
var (
	//支持功能常量
	SupportFeatures = []string{"ping", "traceroute"}
)

Functions

func AppendLineToFile

func AppendLineToFile(line bytes.Buffer, filename string)

向文件追加行

func AssignVips

func AssignVips(client *client.VpcClient, regionId string, network_interface_id string, ips []string)

为网卡注册sencondaryip

func Contain

func Contain(obj interface{}, target interface{}) (bool, error)

判断obj是否在target中,target支持的类型arrary,slice,map

func GetNetworkInterfaceIps

func GetNetworkInterfaceIps(client *client.VpcClient, regionId string, network_interface_id string) []models.NetworkInterfacePrivateIp

获取网卡上的SecondaryIps

func InitVpcClient

func InitVpcClient(accessKey string, secretKey string) *client.VpcClient

func IpExistsOnInterface

func IpExistsOnInterface(client *client.VpcClient, regionId string, network_interface_id string, ip string) bool

查看NetworkInterface是否绑定某一sencondaryip

func UnAssignVips

func UnAssignVips(client *client.VpcClient, regionId string, network_interface_id string, ips []string)

为网卡注销sencondaryip

func YamlFileToMap

func YamlFileToMap(configfile string) *map[interface{}]interface{}

Types

type DefaultLogger

type DefaultLogger struct {
	Level int
}

func (DefaultLogger) Log

func (logger DefaultLogger) Log(level int, message ...interface{})

type JdNetworkInterface

type JdNetworkInterface struct {
	RangId             string `yaml:"rangid"`
	NetWorkInterfaceId string `yaml:"networkinterfaceid"`
}

type Parameters

type Parameters struct {
	AccessKeyID           string               `yaml:"accessskeyid"`
	AccessKeySecret       string               `yaml:"accesskeysecret"`
	Vips                  []string             `yaml:"vips"`
	Allnetworkinterfaces  []JdNetworkInterface `yaml:"allnetworkinterfaces"`
	Localnetworkinterface JdNetworkInterface   `yaml:"localnetworkinterface"`
	Pollinginterval       int                  `yaml:"pollinginterval"`
}

func GetConfigParameters

func GetConfigParameters(configfile string) *Parameters

Jump to

Keyboard shortcuts

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