config

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NacosConfigType  = "nacos"
	ApolloConfigType = "apollo"
)
View Source
const (
	// GddBanner indicates banner enabled or not
	GddBanner envVariable = "GDD_BANNER"
	// GddBannerText sets text content of banner
	GddBannerText envVariable = "GDD_BANNER_TEXT"
	// GddLogLevel accepts panic, fatal, error, warn, warning, info, debug, trace, please reference logrus.ParseLevel
	GddLogLevel envVariable = "GDD_LOG_LEVEL"
	// GddLogFormat text or json
	GddLogFormat envVariable = "GDD_LOG_FORMAT"
	// GddLogReqEnable enables request and response logging
	GddLogReqEnable envVariable = "GDD_LOG_REQ_ENABLE"
	// GddGraceTimeout sets graceful shutdown timeout
	GddGraceTimeout envVariable = "GDD_GRACE_TIMEOUT"
	// GddWriteTimeout sets http connection write timeout
	GddWriteTimeout envVariable = "GDD_WRITE_TIMEOUT"
	// GddReadTimeout sets http connection read timeout
	GddReadTimeout envVariable = "GDD_READ_TIMEOUT"
	// GddIdleTimeout sets http connection idle timeout
	GddIdleTimeout envVariable = "GDD_IDLE_TIMEOUT"
	// GddRouteRootPath sets root path for all routes
	GddRouteRootPath envVariable = "GDD_ROUTE_ROOT_PATH"
	// GddServiceName sets service name
	GddServiceName envVariable = "GDD_SERVICE_NAME"
	// GddHost sets bind host for http server
	GddHost envVariable = "GDD_HOST"
	// GddPort sets bind port for http server
	GddPort envVariable = "GDD_PORT"
	// GddManage if true, it will add built-in apis with /go-doudou path prefix for online api document and service status monitor etc.
	GddManage envVariable = "GDD_MANAGE_ENABLE"
	// GddManageUser manage api endpoint http basic auth user
	GddManageUser envVariable = "GDD_MANAGE_USER"
	// GddManagePass manage api endpoint http basic auth password
	GddManagePass envVariable = "GDD_MANAGE_PASS"

	GddEnableResponseGzip envVariable = "GDD_ENABLE_RESPONSE_GZIP"
	GddAppType            envVariable = "GDD_APP_TYPE"

	// GddConfigRemoteType has two options available: nacos, apollo
	GddConfigRemoteType envVariable = "GDD_CONFIG_REMOTE_TYPE"

	// GddMemSeed sets cluster seeds for joining
	GddMemSeed envVariable = "GDD_MEM_SEED"
	// GddMemName unique name of this node in cluster. if empty or not set, hostname will be used instead
	GddMemName envVariable = "GDD_MEM_NAME"
	// GddMemHost specify AdvertiseAddr attribute of memberlist config struct.
	// if GddMemHost starts with dot such as .seed-svc-headless.default.svc.cluster.local,
	// it will be prefixed by hostname such as seed-2.seed-svc-headless.default.svc.cluster.local
	// for supporting k8s stateful service
	// if empty or not set, private ip will be used instead.
	GddMemHost envVariable = "GDD_MEM_HOST"
	// GddMemPort if empty or not set, an available port will be chosen randomly. recommend specifying a port
	GddMemPort envVariable = "GDD_MEM_PORT"
	// GddMemDeadTimeout dead node will be removed from node map if not received refute messages from it in GddMemDeadTimeout second
	// expose GossipToTheDeadTime property of memberlist.Config
	GddMemDeadTimeout envVariable = "GDD_MEM_DEAD_TIMEOUT"
	// GddMemSyncInterval local node will synchronize states from other random node every GddMemSyncInterval second
	// expose PushPullInterval property of memberlist.Config
	GddMemSyncInterval envVariable = "GDD_MEM_SYNC_INTERVAL"
	// GddMemReclaimTimeout dead node will be replaced with new node with the same name but different full address in GddMemReclaimTimeout second
	// expose DeadNodeReclaimTime property of memberlist.Config
	GddMemReclaimTimeout envVariable = "GDD_MEM_RECLAIM_TIMEOUT"
	// GddMemProbeInterval probe interval
	// expose ProbeInterval property of memberlist.Config
	GddMemProbeInterval envVariable = "GDD_MEM_PROBE_INTERVAL"
	// GddMemProbeTimeout probe timeout
	// expose ProbeTimeout property of memberlist.Config
	GddMemProbeTimeout envVariable = "GDD_MEM_PROBE_TIMEOUT"
	// GddMemSuspicionMult is the multiplier for determining the time an inaccessible node is considered suspect before declaring it dead.
	// expose SuspicionMult property of memberlist.Config
	GddMemSuspicionMult  envVariable = "GDD_MEM_SUSPICION_MULT"
	GddMemRetransmitMult envVariable = "GDD_MEM_RETRANSMIT_MULT"
	// GddMemGossipNodes how many remote nodes you want to gossip messages
	// expose GossipNodes property of memberlist.Config
	GddMemGossipNodes envVariable = "GDD_MEM_GOSSIP_NODES"
	// GddMemGossipInterval gossip interval
	// expose GossipInterval property of memberlist.Config
	GddMemGossipInterval envVariable = "GDD_MEM_GOSSIP_INTERVAL"
	// GddMemTCPTimeout tcp timeout
	// expose TCPTimeout property of memberlist.Config
	GddMemTCPTimeout envVariable = "GDD_MEM_TCP_TIMEOUT"
	// GddMemWeight node weight
	GddMemWeight envVariable = "GDD_MEM_WEIGHT"
	// GddMemWeightInterval node weight will be calculated every GddMemWeightInterval
	GddMemWeightInterval envVariable = "GDD_MEM_WEIGHT_INTERVAL"
	GddMemIndirectChecks envVariable = "GDD_MEM_INDIRECT_CHECKS"
	GddMemLogDisable     envVariable = "GDD_MEM_LOG_DISABLE"
	// GddMemCIDRsAllowed If not set, allow any connection (default), otherwise specify all networks
	// allowed connecting (you must specify IPv6/IPv4 separately)
	GddMemCIDRsAllowed envVariable = "GDD_MEM_CIDRS_ALLOWED"

	GddRetryCount         envVariable = "GDD_RETRY_COUNT"
	GddTracingMetricsRoot envVariable = "GDD_TRACING_METRICS_ROOT"

	GddServiceDiscoveryMode envVariable = "GDD_SERVICE_DISCOVERY_MODE"

	GddNacosNamespaceId         envVariable = "GDD_NACOS_NAMESPACE_ID"
	GddNacosTimeoutMs           envVariable = "GDD_NACOS_TIMEOUT_MS"
	GddNacosNotLoadCacheAtStart envVariable = "GDD_NACOS_NOT_LOAD_CACHE_AT_START"
	GddNacosNotloadcacheatstart envVariable = "GDD_NACOS_NOTLOADCACHEATSTART"
	GddNacosLogDir              envVariable = "GDD_NACOS_LOG_DIR"
	GddNacosCacheDir            envVariable = "GDD_NACOS_CACHE_DIR"
	GddNacosLogLevel            envVariable = "GDD_NACOS_LOG_LEVEL"
	GddNacosServerAddr          envVariable = "GDD_NACOS_SERVER_ADDR"
	GddNacosRegisterHost        envVariable = "GDD_NACOS_REGISTER_HOST"
	// GddNacosConfigFormat has two options available: dotenv, yaml
	GddNacosConfigFormat envVariable = "GDD_NACOS_CONFIG_FORMAT"
	GddNacosConfigGroup  envVariable = "GDD_NACOS_CONFIG_GROUP"
	GddNacosConfigDataid envVariable = "GDD_NACOS_CONFIG_DATAID"

	// GddWeight node weight
	GddWeight envVariable = "GDD_WEIGHT"

	GddApolloCluster      envVariable = "GDD_APOLLO_CLUSTER"
	GddApolloAddr         envVariable = "GDD_APOLLO_ADDR"
	GddApolloNamespace    envVariable = "GDD_APOLLO_NAMESPACE"
	GddApolloBackupEnable envVariable = "GDD_APOLLO_BACKUP_ENABLE"
	GddApolloBackupPath   envVariable = "GDD_APOLLO_BACKUP_PATH"
	GddApolloMuststart    envVariable = "GDD_APOLLO_MUSTSTART"
	GddApolloSecret       envVariable = "GDD_APOLLO_SECRET"
	GddApolloLogEnable    envVariable = "GDD_APOLLO_LOG_ENABLE"
)
View Source
const (
	// Default configs for framework component
	DefaultGddBanner             = true
	DefaultGddBannerText         = FrameworkName
	DefaultGddLogLevel           = "info"
	DefaultGddLogFormat          = "text"
	DefaultGddLogReqEnable       = false
	DefaultGddGraceTimeout       = "15s"
	DefaultGddWriteTimeout       = "15s"
	DefaultGddReadTimeout        = "15s"
	DefaultGddIdleTimeout        = "60s"
	DefaultGddServiceName        = ""
	DefaultGddRouteRootPath      = ""
	DefaultGddHost               = ""
	DefaultGddPort               = 6060
	DefaultGddRetryCount         = 0
	DefaultGddManage             = true
	DefaultGddManageUser         = "admin"
	DefaultGddManagePass         = "admin"
	DefaultGddTracingMetricsRoot = FrameworkName
	DefaultGddWeight             = 1

	// Default configs for memberlist component
	DefaultGddMemSeed           = ""
	DefaultGddMemPort           = 7946
	DefaultGddMemDeadTimeout    = "60s"
	DefaultGddMemSyncInterval   = "60s"
	DefaultGddMemReclaimTimeout = "3s"
	DefaultGddMemProbeInterval  = "5s"
	DefaultGddMemProbeTimeout   = "3s"
	DefaultGddMemSuspicionMult  = 6
	DefaultGddMemRetransmitMult = 4
	DefaultGddMemGossipNodes    = 4
	DefaultGddMemGossipInterval = "500ms"
	DefaultGddMemTCPTimeout     = "30s"
	DefaultGddMemIndirectChecks = 3
	DefaultGddMemWeight         = 1
	DefaultGddMemWeightInterval = 0
	DefaultGddMemName           = ""
	DefaultGddMemHost           = ""
	DefaultGddMemCIDRsAllowed   = ""
	DefaultGddMemLogDisable     = false

	DefaultGddServiceDiscoveryMode = "memberlist"

	DefaultGddNacosNamespaceId         = ""
	DefaultGddNacosTimeoutMs           = 10000
	DefaultGddNacosNotLoadCacheAtStart = false
	DefaultGddNacosLogDir              = "/tmp/nacos/log"
	DefaultGddNacosCacheDir            = "/tmp/nacos/cache"
	DefaultGddNacosLogLevel            = "info"
	DefaultGddNacosServerAddr          = ""
	DefaultGddNacosRegisterHost        = ""

	DefaultGddNacosConfigFormat = configmgr.DotenvConfigFormat
	DefaultGddNacosConfigGroup  = "DEFAULT_GROUP"
	DefaultGddNacosConfigDataid = ""

	DefaultGddEnableResponseGzip = true
	DefaultGddAppType            = "rest"
	DefaultGddConfigRemoteType   = ""

	DefaultGddApolloCluster      = "default"
	DefaultGddApolloAddr         = ""
	DefaultGddApolloNamespace    = "application.properties"
	DefaultGddApolloBackupEnable = true
	DefaultGddApolloBackupPath   = ""
	DefaultGddApolloSecret       = ""
	DefaultGddApolloMuststart    = false
	DefaultGddApolloLogEnable    = false
)
View Source
const FrameworkName = "Go-doudou"

Variables

This section is empty.

Functions

func GetNacosClientParam added in v1.0.3

func GetNacosClientParam() vo.NacosClientParam

Types

type LogLevel

type LogLevel logrus.Level

LogLevel alias for logrus.Level

func (*LogLevel) Decode

func (ll *LogLevel) Decode(value string) error

Decode decodes value to LogLevel

Jump to

Keyboard shortcuts

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