consts

package
v0.0.0-...-8010d25 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigTypeNumFile   ConfigType = iota + 1
	ConfigTypeNumApollo            // TODO: to be implemented

	ConfigTypeFile   = "file"
	ConfigTypeApollo = "apollo"

	ConfigTypeEnvName = "CWGO_CONFIG_TYPE"
)
View Source
const (
	ProjectName = "cwgo"

	ServiceNameApi   = ProjectName + "-" + ServerTypeApi
	ServiceNameAgent = ProjectName + "-" + ServerTypeAgent

	AgentMetadataFile = ServiceNameAgent + ".yaml"

	ServerRunModeStandalone = "standalone"
	ServerRunModeCluster    = "cluster"
)
View Source
const (
	TempDirRepo          = "repo"           // repo pull file temp dir
	TempDirGeneratedCode = "generated_code" // generated code temp dir
)
View Source
const (
	ErrNumParam = iota + 10000
	ErrNumParamOrderNum
	ErrNumParamOrderBy
	ErrNumParamRepositoryType
	ErrNumParamStoreType
	ErrNumParamRepositoryUrl
	ErrNumParamDomain
	ErrNumParamMainIdlPath
	ErrNumParamTemplateType
	ErrNumParamUrl
	ErrNumParamRepositoryStatus
	ErrNumParamRepositoryBranch
	ErrNumParamIdlStatus
)

params err

View Source
const (
	ErrMsgParam                 = "param err"
	ErrMsgParamOrderNum         = "invalid order num"
	ErrMsgParamOrderBy          = "invalid order by"
	ErrMsgParamRepositoryType   = "invalid repository type"
	ErrMsgParamStoreType        = "invalid store type"
	ErrMsgParamRepositoryUrl    = "invalid repository url"
	ErrMsgParamDomain           = "invalid domain"
	ErrMsgParamMainIdlPath      = "invalid main idl path"
	ErrMsgParamTemplateType     = "invalid template type"
	ErrMsgParamUrl              = "invalid url"
	ErrMsgParamRepositoryStatus = "invalid repository status"
	ErrMsgParamRepositoryBranch = "invalid repository branch"
	ErrMsgParamIdlStatus        = "invalid idl status"
)
View Source
const (
	ErrNumRpc = iota + 20000
	ErrNumRpcGetClient
	ErrNumRpcConnectClient
)

rpc err

View Source
const (
	ErrMsgRpc              = "rpc err"
	ErrMsgRpcGetClient     = "get rpc client failed"
	ErrMsgRpcConnectClient = "connect to rpc client failed"
)
View Source
const (
	ErrNumDatabase = iota + 30000
	ErrNumDatabaseRecordNotFound
	ErrNumDatabaseDuplicateRecord
)
View Source
const (
	ErrMsgDatabase                = "database err"
	ErrMsgDatabaseRecordNotFound  = "record not found"
	ErrMsgDatabaseDuplicateRecord = "duplicate record"
)
View Source
const (
	ErrNumToken = iota + 40000
	ErrNumTokenInvalid
	ErrNumTokenInvalidType
)
View Source
const (
	ErrMsgToken            = "token err"
	ErrMsgTokenInvalid     = "token is invalid"
	ErrMsgTokenInvalidType = "invalid token type"
)
View Source
const (
	ErrNumIdl = iota + 50000
	ErrNumIdlAlreadyExist
	ErrNumIdlFileExtension
	ErrNumIdlGetDependentFilePath
)
View Source
const (
	ErrMsgIdl                     = "idl err"
	ErrMsgIdlAlreadyExist         = "idl is already exist"
	ErrMsgIdlFileExtension        = "invalid idl file extension"
	ErrMsgIdlGetDependentFilePath = "get dependent file paths from idl failed"
)
View Source
const (
	ErrNumRepo = iota + 60000
	ErrNumRepoGetFile
	ErrNumRepoGetCommitHash
	ErrNumRepoGetArchive
	ErrNumRepoParseArchive
	ErrNumRepoGetPrivacy
	ErrNumRepoCreate
	ErrNumRepoGetClient
	ErrNumRepoPush
	ErrNumRepoValidateBranch
)
View Source
const (
	ErrMsgRepo               = "repo err"
	ErrMsgRepoGetFile        = "get file from repo failed"
	ErrMsgRepoGetCommitHash  = "get commit hash failed"
	ErrMsgRepoGetArchive     = "get repo archive failed"
	ErrMsgRepoParseArchive   = "parse repo archive failed"
	ErrMsgRepoGetPrivacy     = "get repo privacy failed"
	ErrMsgRepoCreate         = "create repo failed"
	ErrMsgRepoGetClient      = "get repo client failed"
	ErrMsgRepoPush           = "push files to repo failed"
	ErrMsgRepoValidateBranch = "validate repo branch failed"
)
View Source
const (
	ErrNumCommon = iota + 70000
	ErrNumCommonCreateTempDir
	ErrNumCommonGenerateCode
	ErrNumCommonProcessFolders
	ErrNumCommonMkdir
	ErrNumCommonRepoApiService
)
View Source
const (
	ErrMsgCommon               = "common err"
	ErrMsgCommonCreateTempDir  = "create temp dir failed"
	ErrMsgCommonGenerateCode   = "generate code failed"
	ErrMsgCommonProcessFolders = "process folders failed"
	ErrMsgCommonMkdir          = "mkdir failed"
	ErrMsgCommonRepoApiService = "repo api service is down"
)
View Source
const (
	IdlTypeNumThrift = iota + 1
	IdlTypeNumProto
)
View Source
const (
	IdlStatusNumInactive = iota + 1
	IdlStatusNumActive
)
View Source
const (
	OrderNumInc = 0
	OrderNumDec = 1

	OrderInc = "asc"
	OrderDec = "desc"

	OrderByUpdateTime = "update_time"
)
View Source
const (
	MainRef         = "main"
	GitHubDomain    = "github.com"
	GitLabDomain    = "gitlab.com"
	GithubURLPrefix = "https://github.com/"
)
View Source
const (
	RepositoryTypeNumGitLab = iota + 1
	RepositoryTypeNumGithub
	RepositoryTypeNum = iota
)
View Source
const (
	RepositoryStoreTypeNumIdl = iota + 1
	RepositoryStoreTypeNumService
	RepositoryStoreTypeNum = iota
)
View Source
const (
	RepositoryStatusNumInactive = iota + 1
	RepositoryStatusNumActive
)
View Source
const (
	TemplateTypeNumHz = iota + 1
	TemplateTypeNumKitex
)
View Source
const (
	TemplateHzTplTypeLayout     = "layout.yaml"
	TemplateHzTplTypeRenderData = "render_data.json"
	TemplateHzTplTypePackage    = "package.yaml"
)
View Source
const (
	TokenStatusNumExpired = iota + 1
	TokenStatusNumValid
)
View Source
const (
	TokenTypeNumPersonal = iota + 1
	TokenTypeNumOrganization
)
View Source
const (
	ServerTypeNumApi ServerType = iota + 1
	ServerTypeNumAgent

	ServerTypeApi   = "api"
	ServerTypeAgent = "agent"

	ServerTypeEnvName = "CWGO_SERVER_TYPE"
)
View Source
const (
	ServerModeNumDev ServerMode = iota + 1
	ServerModeNumPro

	ServerModeDev = "dev"
	ServerModePro = "prod"
)
View Source
const (
	RegistryTypeNumBuiltin RegistryType = iota + 1
	RegistryTypeNumConsul

	RegistryTypeBuiltin = "builtin"
	RegistryTypeConsul  = "consul"
)
View Source
const (
	StoreTypeNumMysql StoreType = iota + 1
	StoreTypeNumMongo
	StoreTypeNumRedis

	StoreTypeMysql = "mysql"
	StoreTypeMongo = "mongo"
	StoreTypeRedis = "redis"
)
View Source
const (
	StaticFileDefaultPath = "./dist"
	StaticFilePathEnvName = "CWGO_STATIC_FILE_PATH"
)
View Source
const (
	ConfigDefaultPath = ""
)
View Source
const (
	ConfigPathEnvName = "CWGO_CONFIG_PATH"
)
View Source
const (
	DefaultLimit = 20
)
View Source
const (
	RdbKeyRegistryService = ProjectName + ":" + "registry:service:%s"
)
View Source
const ServiceID = "service_id"

Variables

View Source
var (
	ProxyUrl string
	TimeZone *time.Location
)
View Source
var IdlStatusNumMap = map[int]struct{}{
	IdlStatusNumActive:   {},
	IdlStatusNumInactive: {},
}
View Source
var IdlTypeNumMap = map[int]struct{}{
	IdlTypeNumThrift: {},
	IdlTypeNumProto:  {},
}
View Source
var RepositoryStatusNumMap = map[int]struct{}{
	RepositoryStatusNumActive:   {},
	RepositoryStatusNumInactive: {},
}
View Source
var RepositoryTypeNumMap = map[int]struct{}{
	RepositoryTypeNumGitLab: {},
	RepositoryTypeNumGithub: {},
}
View Source
var TempDir string
View Source
var TemplateHzTplTypeMap = map[string]struct{}{
	TemplateHzTplTypeLayout:     {},
	TemplateHzTplTypeRenderData: {},
	TemplateHzTplTypePackage:    {},
}
View Source
var TemplateTypeNumMap = map[int]struct{}{
	TemplateTypeNumHz:    {},
	TemplateTypeNumKitex: {},
}
View Source
var TokenStatusNumMap = map[int32]struct{}{
	TokenStatusNumExpired: {},
	TokenStatusNumValid:   {},
}
View Source
var TokenTypeNumMap = map[int32]struct{}{
	TokenTypeNumPersonal:     {},
	TokenTypeNumOrganization: {},
}

Functions

This section is empty.

Types

type ConfigType

type ConfigType uint32

type DispatcherType

type DispatcherType uint32
const (
	DispatcherTypeNumHash DispatcherType = iota + 1

	DispatcherTypeHash = "consistent-hash"
)

type RegistryType

type RegistryType uint32

type ServerMode

type ServerMode uint32

type ServerType

type ServerType uint32

type StoreType

type StoreType uint32

Jump to

Keyboard shortcuts

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