ksyun

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: MPL-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotFound = "Notfound"
)

Variables

This section is empty.

Functions

func ConvertFilterStruct

func ConvertFilterStruct(v interface{}, req *map[string]interface{})

Suitable for filter which need conver param with "_"(terraform) to "-"(sdk) when read . convert input param struct to map when create(without prefix).

func ConvertFilterStructPrefix

func ConvertFilterStructPrefix(v interface{}, req *map[string]interface{}, prex string)

Suitable for filter which need conver param with "_"(terraform) to "-"(sdk) when read. convert input param struct to map when create(with prefix).

func Downline2Hump

func Downline2Hump(s string) string

The underline is converted to an hump simply.

func FlatternStruct

func FlatternStruct(v interface{}, req *map[string]interface{})

flattern struct convert input param struct to map when create(with out prefix).

func FlatternStructPrefix

func FlatternStructPrefix(v interface{}, req *map[string]interface{}, prex string)

flattern struct Suitable for inline struct convert input param struct to map when create(with prefix). prefix: the name of the outer structure

func FlatternStructSlicePrefix

func FlatternStructSlicePrefix(values interface{}, req *map[string]interface{}, prex string)

FlatternStructSlicePrefix 用于创建时,结构体切片类型的入参转换为map型 ,【 Flattern StructSlice Suitable for the slice of inline struct convert input param struct to map when create(with prefix). prefix: the name of the slice

func FuckHump2Downline

func FuckHump2Downline(s string) string

func GetEndpointURL

func GetEndpointURL(region string) string

GetEndpointURL will return endpoint url string by region

func GetInsecureEndpointURL

func GetInsecureEndpointURL(region string) string

GetInsecureEndpointURL will return endpoint url string by region

func GetSubDByRep

func GetSubDByRep(data interface{}, include, exclude map[string]bool) []interface{}

Convert sdk response type (map[string]interface{}) to the type terraform can realized([]map[string]interface). params data limit : [k,v]:the type of k must be string ,the type of v must be basic type.

func GetSubSliceDByRep

func GetSubSliceDByRep(items []interface{}, include map[string]bool) []map[string]interface{}

sdk resp []map[string]interface{}->terraform schema.ResourceData Convert sdk response type ([]map[string]interface{}) to the type terraform can realized([]map[string]interface). include :representing the key terraform has defined. exclude :representing the key which the type is not basic type. Suitable for the value in d.Set( key,value),and the type of value must be List.

func GetSubStructDByRep

func GetSubStructDByRep(datas interface{}, exclude map[string]bool) map[string]interface{}

sdk resp map[string]interface{} inline struct ->terraform schema.ResourceData convert inline struct from sdk response type ([]map[string]interface{}) to the type terraform can realized([]map[string]interface). exclude :representing the key which the type is not basic type.

func GetValidatorParamForProto

func GetValidatorParamForProto() map[string]*ValidatorParam

func GetValidatorParamForProto4

func GetValidatorParamForProto4() map[string]*ValidatorParam

func Hump2Downline

func Hump2Downline(s string) string

The hump is converted to an underline simply, and no special treatment is required for even uppercase letters.

func Provider

func Provider() terraform.ResourceProvider

Provider returns a terraform.ResourceProvider.

func SchemaSetToFilterMap

func SchemaSetToFilterMap(s interface{}, prefix string, index int, input *map[string]interface{})

func SchemaSetToInstanceMap

func SchemaSetToInstanceMap(s interface{}, prefix string, input *map[string]interface{})

func SchemaSetToStringSlice

func SchemaSetToStringSlice(s interface{}) []string

schemaSetToStringSlice used for converting terraform schema set to a string slice

func SchemaSetsToFilterMap

func SchemaSetsToFilterMap(d *schema.ResourceData, filters []string, req *map[string]interface{}) *map[string]interface{}

func SetDByResp

func SetDByResp(d *schema.ResourceData, m interface{}, includ, exclude map[string]bool) map[string]interface{}

set sdk response (map[string]interface{}) to the terraform ([]map[string]interface). params data limit : [k,v]:the type of k must be string ,the type of v must be basic type. include :representing the key terraform has defined. terraform will panic if set the key that not defined. exclude :representing the key which the type is not basic type (terraform can't identity the type which is not basic type). mre: the params not set to terraform .

func SetDByRespV1

func SetDByRespV1(d *schema.ResourceData, m interface{}, exclud map[string]bool) map[string]interface{}

set sdk response (map[string]interface{}) to the terraform ([]map[string]interface). params data limit : [k,v]:the type of k must be string ,the type of v must be basic type. exclude :representing the key which the type is not basic type (terraform can't identity the type which is not basic type). mre: the params not set to terraform .

Types

type Config

type Config struct {
	AccessKey string
	SecretKey string
	Region    string
	Insecure  bool
}

Config is the configuration of ksyun meta data

func (*Config) Client

func (c *Config) Client() (*KsyunClient, error)

Client will returns a client with connections for all product

type KsyunClient

type KsyunClient struct {
	// contains filtered or unexported fields
}

type ProviderError

type ProviderError struct {
	// contains filtered or unexported fields
}

func (*ProviderError) Error

func (e *ProviderError) Error() string

func (*ProviderError) ErrorCode

func (err *ProviderError) ErrorCode() string

func (*ProviderError) Message

func (err *ProviderError) Message() string

type ValidatorParam

type ValidatorParam struct {
	Name  string
	Desc  string
	Valid *Validity
}

type Validity

type Validity struct {
	Type     string
	DataType string
	Value    string
	Values   []string
	Min      int64
	Max      int64
}

Source Files

Jump to

Keyboard shortcuts

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