common

package
v0.0.0-...-cb472e6 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxLimit 最大数量限制
	MaxLimit int64 = 999999

	// MaxLoopCnt 最大循环次数
	MaxLoopCnt int = 10
)

Variables

View Source
var (
	// ErrorLoopCnt 循环过多错误
	ErrorLoopCnt = errors.New("too much loop")
)

Functions

func CovertInstState

func CovertInstState(instState string) string

将不同云厂商的实例状态转为统一的实例状态

func Int64Ptr

func Int64Ptr(v int64) *int64

Int64Ptr 获取int64的指针

func NewHeader

func NewHeader() http.Header

NewHeader 创建云资源同步需要的header

func NewKit

func NewKit() *rest.Kit

NewKit 创建新的Kit

func StringPtr

func StringPtr(v string) *string

StringPtr 获取string的指针

func StringPtrs

func StringPtrs(vals []string) []*string

StringPtrs 获取[]string的指针

Types

type BaseOpt

type BaseOpt struct {
	// 请求过滤条件
	Filters []*Filter

	// 返回数量限制
	Limit int64
}

BaseOpt 云厂商接口请求条件的公共部分

type Filter

type Filter struct {
	// 需要过滤的字段。
	Name *string

	// 字段的过滤值。
	Values []*string
}

Filter 过滤条件

type InstanceOpt

type InstanceOpt struct {
	BaseOpt
}

InstanceOpt 实例请求条件

func GetDefaultInstanceOpt

func GetDefaultInstanceOpt() *InstanceOpt

GetDefaultInstanceOpt 获取默认的Instance请求条件

type VpcOpt

type VpcOpt struct {
	BaseOpt
}

VpcOpt VPC请求条件

func GetDefaultVpcOpt

func GetDefaultVpcOpt() *VpcOpt

GetDefaultVpcOpt 获取默认的Vpc请求条件

Jump to

Keyboard shortcuts

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