common

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

View Source
const (
	StrSPIDER_REST_URL            string = "SPIDER_REST_URL"
	StrDRAGONFLY_REST_URL         string = "DRAGONFLY_REST_URL"
	StrDB_URL                     string = "DB_URL"
	StrDB_DATABASE                string = "DB_DATABASE"
	StrDB_USER                    string = "DB_USER"
	StrDB_PASSWORD                string = "DB_PASSWORD"
	StrAUTOCONTROL_DURATION_MS    string = "AUTOCONTROL_DURATION_MS"
	CbStoreKeyNotFoundErrorString string = "key not found"
	StrAdd                        string = "add"
	StrDelete                     string = "delete"
	StrSSHKey                     string = "sshKey"
	StrImage                      string = "image"
	StrSecurityGroup              string = "securityGroup"
	StrSpec                       string = "spec"
	StrVNet                       string = "vNet"
)

Variables

View Source
var AUTOCONTROL_DURATION_MS string

CB-Store

View Source
var CBStore icbs.Store
View Source
var DB_DATABASE string
View Source
var DB_PASSWORD string
View Source
var DB_URL string
View Source
var DB_USER string
View Source
var DRAGONFLY_REST_URL string
View Source
var MYDB *sql.DB
View Source
var SPIDER_REST_URL string
View Source
var StartTime string

Functions

func CheckConfig added in v0.3.1

func CheckConfig(Id string) (bool, error)

func CheckNs added in v0.3.1

func CheckNs(Id string) (bool, error)

func ConvGrpcStatusErr

func ConvGrpcStatusErr(err error, tag string, method string) error

ConvGrpcStatusErr - GRPC 상태 코드 에러로 변환

func ConvertToMessage

func ConvertToMessage(inType string, inData string, obj interface{}) error

ConvertToMessage - 입력 데이터를 grpc 메시지로 변환

func ConvertToOutput

func ConvertToOutput(outType string, obj interface{}) (string, error)

ConvertToOutput - grpc 메시지를 출력포맷으로 변환

func CopySrcToDest

func CopySrcToDest(src interface{}, dest interface{}) error

CopySrcToDest - 소스에서 타켓으로 데이터 복사

func CreateImageTable

func CreateImageTable() error

func CreateSpecTable

func CreateSpecTable() error

func DelAllConfig

func DelAllConfig() error

func DelAllNs

func DelAllNs() error

func DelNs

func DelNs(Id string) error

func GenMcisKey

func GenMcisKey(nsId string, mcisId string, vmId string) string

func GenMcisPolicyKey added in v0.2.8

func GenMcisPolicyKey(nsId string, mcisId string, vmId string) string

Generate Mcis policy key

func GenResourceKey

func GenResourceKey(nsId string, resourceType string, resourceId string) string

func GenUuid

func GenUuid() string

func GetChildIdList

func GetChildIdList(key string) []string

func GetCspResourceId

func GetCspResourceId(nsId string, resourceType string, resourceId string) (string, error)

func ListConfigId

func ListConfigId() []string

func ListNsId

func ListNsId() []string

func LookupKeyValueList

func LookupKeyValueList(kvl []KeyValue, key string) string

func NVL

func NVL(str string, def string) string

NVL is null value logic

func NewGrpcStatusErr

func NewGrpcStatusErr(msg string, tag string, method string) error

NewGrpcStatusErr - GRPC 상태 코드 에러 생성

func NsValidation

func NsValidation() echo.MiddlewareFunc

func OpenSQL

func OpenSQL(path string) error

func PrintJsonPretty

func PrintJsonPretty(v interface{})

func SelectDatabase

func SelectDatabase(database string) error

func ToLower added in v0.3.1

func ToLower(name string) string

func UpdateEnv

func UpdateEnv(id string) error

Types

type ConfigInfo

type ConfigInfo struct {
	Id    string `json:"id" example:"configid01"`
	Name  string `json:"name" example:"spider"`
	Value string `json:"value" example:"http://localhost:1024/spider"`
}

swagger:response ConfigInfo

func GetConfig

func GetConfig(id string) (ConfigInfo, error)

func ListConfig

func ListConfig() ([]ConfigInfo, error)

func UpdateConfig

func UpdateConfig(u *ConfigReq) (ConfigInfo, error)

type ConfigReq

type ConfigReq struct {
	Name  string `json:"name" example:"spider"`
	Value string `json:"value" example:"http://localhost:1024/spider"`
}

type ConnConfig

type ConnConfig struct {
	ConfigName     string
	ProviderName   string
	DriverName     string
	CredentialName string
	RegionName     string
}

func GetConnConfig

func GetConnConfig(ConnConfigName string) (ConnConfig, error)

type ConnConfigList

type ConnConfigList struct {
	Connectionconfig []ConnConfig `json:"connectionconfig"`
}

func GetConnConfigList

func GetConnConfigList() (ConnConfigList, error)

type IID

type IID struct {
	NameId   string // NameID by user
	SystemId string // SystemID by CloudOS
}

Spider 2020-03-30 https://github.com/cloud-barista/cb-spider/blob/master/cloud-control-manager/cloud-driver/interfaces/resources/IId.go

type KeyValue

type KeyValue struct {
	Key   string
	Value string
}

type NsInfo

type NsInfo struct {
	Id          string `json:"id" example:"namespaceid01"`
	Name        string `json:"name" example:"namespacename01"`
	Description string `json:"description" example:"Description for this namespace"`
}

swagger:response NsInfo

func CreateNs

func CreateNs(u *NsReq) (NsInfo, error)

func GetNs

func GetNs(id string) (NsInfo, error)

func ListNs

func ListNs() ([]NsInfo, error)

type NsReq

type NsReq struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

type Region

type Region struct {
	RegionName       string
	ProviderName     string
	KeyValueInfoList []KeyValue
}

func GetRegion

func GetRegion(RegionName string) (Region, error)

type RegionList

type RegionList struct {
	Region []Region `json:"region"`
}

func GetRegionList

func GetRegionList() (RegionList, error)

type SimpleMsg

type SimpleMsg struct {
	Message string `json:"message" example:"Any message"`
}

JSON Simple message struct

Jump to

Keyboard shortcuts

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