env

package
v0.0.0-...-de3cd48 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

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 GetAliyunAccessKey

func GetAliyunAccessKey() string

GetAliyunAccessKey ...

func GetAliyunSecretKey

func GetAliyunSecretKey() string

GetAliyunSecretKey ...

func GetAliyunSlsTraceEndpoint

func GetAliyunSlsTraceEndpoint() string

GetAliyunSlsTraceEndpoint ...

func GetAliyunSlsTraceInstanceID

func GetAliyunSlsTraceInstanceID() string

GetAliyunSlsTraceInstanceID ...

func GetAliyunSlsTraceProject

func GetAliyunSlsTraceProject() string

GetAliyunSlsTraceProject ...

func GetAliyunTraceEndpoint

func GetAliyunTraceEndpoint() string

GetAliyunTraceEndpoint ...

func GetGRPCHost

func GetGRPCHost() string

GetGRPCHost ...

func GetGRPCPort

func GetGRPCPort() int

GetGRPCPort ...

func GetHttpHost

func GetHttpHost() string

GetHttpHost ...

func GetHttpPort

func GetHttpPort() int

GetHttpPort ...

func GetHttpTimeout

func GetHttpTimeout() int

GetHttpTimeout ...

func GetMode

func GetMode() string

GetMode ...

func GetMonitorHttpHost

func GetMonitorHttpHost() string

GetMonitorHttpHost ...

func GetMonitorHttpPort

func GetMonitorHttpPort() int

GetMonitorHttpPort ...

func GetRedisDefaultConfigPath

func GetRedisDefaultConfigPath() string

GetRedisDefaultConfigPath ...

func GetRedisMutexConfigPath

func GetRedisMutexConfigPath() string

GetRedisMutexConfigPath ..

func GetServiceInstanceID

func GetServiceInstanceID() string

GetServiceInstanceID ...

func GetServiceName

func GetServiceName() string

GetServiceName ...

func GetServiceVersion

func GetServiceVersion() string

GetServiceVersion ...

func IsDevelopment

func IsDevelopment() bool

IsDevelopment ...

func IsLocal

func IsLocal() bool

IsLocal ...

func IsProduction

func IsProduction() bool

IsProduction ...

Types

This section is empty.

Jump to

Keyboard shortcuts

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