Documentation ¶
Index ¶
- Constants
- func GetAliyunAccessKey() string
- func GetAliyunSecretKey() string
- func GetAliyunSlsTraceEndpoint() string
- func GetAliyunSlsTraceInstanceID() string
- func GetAliyunSlsTraceProject() string
- func GetAliyunTraceEndpoint() string
- func GetGRPCHost() string
- func GetGRPCPort() int
- func GetHttpHost() string
- func GetHttpPort() int
- func GetHttpTimeout() int
- func GetMode() string
- func GetMonitorHttpHost() string
- func GetMonitorHttpPort() int
- func GetRedisDefaultConfigPath() string
- func GetRedisMutexConfigPath() string
- func GetServiceInstanceID() string
- func GetServiceName() string
- func GetServiceVersion() string
- func IsDevelopment() bool
- func IsLocal() bool
- func IsProduction() bool
Constants ¶
View Source
const ( PathAliyunAccessKey = "aliyun.auth.soda.accessKey" PathAliyunSecretKey = "aliyun.auth.soda.secretKey" PathAliyunMseEndpoint = "aliyun.mse.endpoint" PathAliyunMseNamespaceID = "aliyun.mse.namespaceId" PathAliyunMseRegionID = "aliyun.mse.regionId" PathAliyunMseCacheDir = "aliyun.mse.cacheDir" PathAliyunMseLogDir = "aliyun.mse.logDir" PathAliyunMseLogLevel = "aliyun.mse.logLevel" PathAliyunMseDataID = "aliyun.mse.dataId" PathAliyunMseGroup = "aliyun.mse.group" )
aliyun.json Example:
{ "aliyun": { "auth": { "soda": { "accessKey": "accessKey", "secretKey": "secretKey" } }, "mse": { "endpoint": "endpoint", "namespaceId": "namespaceId", "regionId": "cn-hangzhou", "cacheDir": "./config/cache", "logDir": "./tmp/mse/log", "logLevel": "error", "dataId": "dataId", "group": "group" } } }
View Source
const ( PathMode = "mode" PathServiceName = "server.name" PathServiceVersion = "server.version" PathMonitorHttpHost = "server.httpServer.monitorHttp.host" PathMonitorHttpPort = "server.httpServer.monitorHttp.port" PathHttpHost = "server.httpServer.http.host" PathHttpPort = "server.httpServer.http.port" PathHttpTimeout = "server.httpServer.http.timeout" PathGRPCHost = "server.rpcServer.grpc.host" PathGRPCPort = "server.rpcServer.grpc.port" PathAliyunSlsEndpoint = "resource.aliyun.sls.endpoint" PathAliyunSlsProject = "resource.aliyun.sls.project" PathAliyunSlsLogStore = "resource.aliyun.sls.logStore" PathAliyunSlsLogLevel = "resource.aliyun.sls.level" PathAliyunTraceEndpoint = "resource.aliyun.trace.url" PathAliyunSlsTraceEndpoint = "resource.aliyun.slsTrace.url" PathAliyunSlsTraceProject = "resource.aliyun.slsTrace.project" PathAliyunSlsTraceInstanceID = "resource.aliyun.slsTrace.instanceId" PathRedisDefault = "resource.redis.default" PathRedisMutex = "resource.redis.mutex" )
runtime.config.json Example:
{ "mode": "dev", "server": { "name": "name", "version": "1.0.0", "httpServer": { "httpServer": { "host": "0.0.0.0", "port": 9999, "timeout": 10 }, "monitorHttp": { "host": "0.0.0.0", "port": 9104 } }, "rpcServer": { "grpc": { "host": "0.0.0.0", "port": 9999 } } }, "resource": { "database": { "soda": { "wr": { "dialect": "mysql", "host": "", "port": 3306, "user": "", "password": "", "database": "soda", "maxIdle": 20, "maxOpen": 20, "maxLifetime": 300 } } }, "redis": { "default": { "addr": "", "password": "", "database": 10, "prefix": "", "maxIdle": 20, "maxActive": 50, "idleTimeout": 60 }, "mutex": { "expiry": 6, "tries": 15 } }, "aliyun": { "sls": { "endpoint": "", "project": "project", "logStore": "logStore", "level": "warn" }, "trace": { "url": "" } } } }
View Source
const ( ModeLocal = "local" ModeDevelop = "dev" ModeTest = "test" ModeProduction = "prod" )
modes
Variables ¶
This section is empty.
Functions ¶
func GetAliyunSlsTraceEndpoint ¶
func GetAliyunSlsTraceEndpoint() string
GetAliyunSlsTraceEndpoint ...
func GetAliyunSlsTraceInstanceID ¶
func GetAliyunSlsTraceInstanceID() string
GetAliyunSlsTraceInstanceID ...
func GetRedisDefaultConfigPath ¶
func GetRedisDefaultConfigPath() string
GetRedisDefaultConfigPath ...
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.