util

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DRAGONFLY = os.Getenv("DRAGONFLY_URL")
View Source
var HTTP_CALL_SUCCESS = 200
View Source
var HTTP_POST_SUCCESS = 201
View Source
var LADYBUG = os.Getenv("LADYBUG_URL")
View Source
var MCIS_LIFECYCLE_CREATE = "create"

MCIS 의 life cycle // socket통신에서 사용

View Source
var MCIS_LIFECYCLE_DELETE = "delete"
View Source
var MCIS_LIFECYCLE_RESUME = "resume"
View Source
var MCIS_LIFECYCLE_SUSPEND = "suspend"
View Source
var MCIS_LIFECYCLE_TERMINATE = "terminate"
View Source
var MCIS_STATUS_ETC = "etc"
View Source
var MCIS_STATUS_INCLUDE = "include"
View Source
var MCIS_STATUS_PARTIAL = "partial"
View Source
var MCIS_STATUS_RUNNING = "running"

MCIS의 상태(소문자). (기타 상태는 UNDEFINED + ETC)

View Source
var MCIS_STATUS_SUSPENDED = "suspended"
View Source
var MCIS_STATUS_TERMINATED = "terminated"
View Source
var MCKS = os.Getenv("MCKS_URL")
View Source
var MCKS_LIFECYCLE_CREATE = "create"
View Source
var MCKS_LIFECYCLE_DELETE = "delete"
View Source
var MCKS_LIFECYCLE_RESUME = "resume"
View Source
var MCKS_LIFECYCLE_SUSPEND = "suspend"
View Source
var MCKS_LIFECYCLE_TERMINATE = "terminate"
View Source
var MCKS_STATUS_ETC = "etc"
View Source
var MCKS_STATUS_INCLUDE = "include"
View Source
var MCKS_STATUS_PARTIAL = "partial"
View Source
var MCKS_STATUS_RUNNING = "running"

MCKA의 상태(소문자)

View Source
var MCKS_STATUS_SUSPENDED = "suspended"
View Source
var MCKS_STATUS_TERMINATED = "terminated"
View Source
var MONITORING_POLICY_STATUS_FAIL = "fail"
View Source
var MONITORING_POLICY_STATUS_REG = "regist"
View Source
var MONITORING_THRESHOLD_REG = "regist"
View Source
var PROVIDER_ALIBABA = "alibaba"
View Source
var PROVIDER_AWS = "aws"
View Source
var PROVIDER_AZURE = "azure"
View Source
var PROVIDER_CLOUDIT = "cloudit"
View Source
var PROVIDER_GCP = "gcp"
View Source
var PROVIDER_MOCK = "mock"
View Source
var PROVIDER_OPENSTACK = "openstack"
View Source
var SPIDER = os.Getenv("SPIDER_URL")
View Source
var STATUS_ARRAY = []string{"running", "stopped", "terminated"}
View Source
var STORE_CLOUDCONNECTIONCONFIGLIST = "cloudconnectionconfiglist"
View Source
var STORE_CLOUDOSLIST = "cloudoslist"
View Source
var STORE_CREDENTIALLIST = "credentiallist"
View Source
var STORE_DEFAULT_NAMESPACEID = "defaultnamespaceid"
View Source
var STORE_DEFAULT_NAMESPACENAME = "defaultnamespacename"
View Source
var STORE_DRIVERLIST = "driverlist"
View Source
var STORE_NAMESPACELIST = "namespacelist"

///// Store 저장 용 Const

View Source
var STORE_REGIONLIST = "regionlist"
View Source
var TASK_STATUS_COMPLETE = "completed"
View Source
var TASK_STATUS_FAIL = "failed"
View Source
var TASK_STATUS_PROCESS = "processing"
View Source
var TASK_STATUS_REQUEST = "requested"

요청상태 : socket 으로 전달하는 요청 상태

View Source
var TASK_TYPE_CONNECTION = "connection"
View Source
var TASK_TYPE_CREDENTIAL = "credential"
View Source
var TASK_TYPE_DRIVER = "driver"
View Source
var TASK_TYPE_MCIS = "mcis"

websocket으로 전달하는 task의 종류

View Source
var TASK_TYPE_MCKS = "mcks"
View Source
var TASK_TYPE_MONITORINGTHRESHOLD_EVENTHANDLER = "monitoringthresholdeventhandler"
View Source
var TASK_TYPE_MONITORING_POLICY = "monitoringpolicy"
View Source
var TASK_TYPE_REGION = "region"
View Source
var TASK_TYPE_SECURITYGROUP = "securitygroup"
View Source
var TASK_TYPE_VM = "vm"
View Source
var TASK_TYPE_VMIMAGE = "vmimage"
View Source
var TASK_TYPE_VMSPEC = "vmspec"
View Source
var TASK_TYPE_VNET = "vnet"
View Source
var TUMBLEBUG = os.Getenv("TUMBLE_URL")
View Source
var VMSPEC_LIFECYCLE_CREATE = "create"
View Source
var VM_LIFECYCLE_CREATE = "create"

VM 의 life cycle // socket통신에서 사용

View Source
var VM_LIFECYCLE_DELETE = "delete"
View Source
var VM_LIFECYCLE_REBOOT = "reboot"
View Source
var VM_LIFECYCLE_RESUME = "resume"
View Source
var VM_LIFECYCLE_SUSPEND = "suspend"
View Source
var VM_LIFECYCLE_TERMINATE = "terminate"
View Source
var VM_STATUS_ARRAY = []string{"running", "suspended", "terminated", "etc"}
View Source
var VM_STATUS_ETC = "etc"

var VM_STATUS_UNDEFINED = "statusUndefined" var VM_STATUS_PARTIAL = "partial"

View Source
var VM_STATUS_INCLUDE = "include"

var VM_STATUS_RESUMING = "Resuming"

View Source
var VM_STATUS_RUNNING = "running"

VM의 상태(소문자). (기타 상태는 UNDEFINED + ETC)

View Source
var VM_STATUS_STOPPED = "stopped"
View Source
var VM_STATUS_SUSPENDED = "suspended"
View Source
var VM_STATUS_TERMINATED = "terminated"

Functions

func AuthenticationHandler

func AuthenticationHandler() string

ajax 호출할 때 header key 생성

func CommonHttp

func CommonHttp(url string, json []byte, httpMethod string) (*http.Response, error)

http 호출

func CommonHttpBytes

func CommonHttpBytes(url string, jsonBytesBuffer *bytes.Buffer, httpMethod string) (*http.Response, error)

Json 형태의 bytes.Buffer 면 그대로 사용

func CommonHttpFormData

func CommonHttpFormData(targetUrl string, formParam map[string]interface{}, httpMethod string) (*http.Response, error)

Put/Post 등을 formData 형태로 호출할 때 https://minwook-shin.github.io/go-decode-encode-url-values-form/ 참조할 것 func CommonHttpFormData(targetUrl string, formParam url.Values, httpMethod string) (*http.Response, error) { func CommonHttpFormData(targetUrl string, formParam map[string]string, httpMethod string) (*http.Response, error) {

func CommonHttpWithoutParam

func CommonHttpWithoutParam(url string, httpMethod string) (*http.Response, error)

parameter 없이 호출하는 경우 사용.받은대로 return하면 호출하는 method에서 가공하여 사용

func DisplayResponse

func DisplayResponse(resp *http.Response)

return message 확인용

func GetMcisStatus

func GetMcisStatus(mcisStatus string) string

MCIS 상태값의 앞부분만 사용. 소문자로

func GetMcksStatus

func GetMcksStatus(mcksStatus string) string

func GetProviderName

func GetProviderName(provider string) string

providerName 소문자로

func GetUserInfo added in v0.4.5

func GetUserInfo(c echo.Context, userID string) (map[string]string, bool)

func GetVmConnectionName

func GetVmConnectionName(vmConnectionName string) string

func GetVmStatus

func GetVmStatus(vmStatus string) string

VM 상태를 UI에서 표현하는 방식으로 변경

func MappingUrlParameter

func MappingUrlParameter(originalUrl string, paramMapper map[string]string) string

originalUrl 은 API의 전체 경로 parammapper 의 Key는 replace할 모든 text ex1) path인 경우 {abc} ex2) path인 경우 :abc

func SetStore

func SetStore(c echo.Context, storeKeyName string, storeKeyValue interface{})

func StructToMapByJson

func StructToMapByJson(obj interface{}) (newMap map[string]interface{}, err error)

Json형태의 obj를 map으로 형 변환

func ValidateString

func ValidateString(param string) error

Vadidation check

Types

type KeepZero

type KeepZero float64

func (KeepZero) MarshalJSON

func (f KeepZero) MarshalJSON() ([]byte, error)

type ValidObject

type ValidObject struct {
	Name string `validate:"required"`
}

Jump to

Keyboard shortcuts

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