constant

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 1 Imported by: 146

Documentation

Index

Constants

View Source
const (
	ClusterKeyAvailable       = "available"
	ClusterKeyBroadcast       = "broadcast"
	ClusterKeyFailback        = "failback"
	ClusterKeyFailfast        = "failfast"
	ClusterKeyFailover        = "failover"
	ClusterKeyFailsafe        = "failsafe"
	ClusterKeyForking         = "forking"
	ClusterKeyZoneAware       = "zoneAware"
	ClusterKeyAdaptiveService = "adaptiveService"
)
View Source
const (
	Dubbo            = "dubbo"
	ProviderProtocol = "provider"
	// OverrideProtocol is compatible with 2.6.x
	OverrideProtocol = "override"
	EmptyProtocol    = "empty"
	RouterProtocol   = "router"
)
View Source
const (
	DefaultWeight           = 100     //
	DefaultWarmup           = 10 * 60 // in java here is 10*60*1000 because of System.currentTimeMillis() is measured in milliseconds & in go time.Unix() is second
	DefaultLoadBalance      = "random"
	DefaultRetries          = "2"
	DefaultRetriesInt       = 2
	DefaultProtocol         = "dubbo"
	DefaultRegTimeout       = "10s"
	DefaultRegTTL           = "15m"
	DefaultCluster          = "failover"
	DefaultFailbackTimes    = "3"
	DefaultFailbackTimesInt = 3
	DefaultFailbackTasks    = 100
	DefaultRestClient       = "resty"
	DefaultRestServer       = "go-restful"
	DefaultPort             = 20000
)
View Source
const (
	DefaultKey   = "default"
	Generic      = "$invoke"
	GenericAsync = "$invokeAsync"
	Echo         = "$echo"
)
View Source
const (
	// DefaultServiceFilters defines default service filters, it is highly recommended
	// that put the AdaptiveServiceProviderFilterKey at the end.
	DefaultServiceFilters = EchoFilterKey + "," +
		MetricsFilterKey + "," + TokenFilterKey + "," + AccessLogFilterKey + "," + TpsLimitFilterKey + "," +
		GenericServiceFilterKey + "," + ExecuteLimitFilterKey + "," + GracefulShutdownProviderFilterKey

	DefaultReferenceFilters = GracefulShutdownConsumerFilterKey
)

default filters

View Source
const (
	AnyValue          = "*"
	AnyHostValue      = "0.0.0.0"
	LocalHostValue    = "192.168.1.1"
	RemoveValuePrefix = "-"
)
View Source
const (
	ConfiguratorsCategory           = "configurators"
	RouterCategory                  = "category"
	DefaultCategory                 = ProviderCategory
	DynamicConfiguratorsCategory    = "dynamicconfigurators"
	AppDynamicConfiguratorsCategory = "appdynamicconfigurators"
	ProviderCategory                = "providers"
	ConsumerCategory                = "consumers"
)
View Source
const (
	SimpleMetadataServiceName = "MetadataService"
	DefaultRevision           = "N/A"
)
View Source
const (
	// ConfigFileEnvKey is key of environment variable dubbogo configure file path
	ConfigFileEnvKey = "DUBBO_GO_CONFIG_PATH"
	// AppLogConfFile ...
	AppLogConfFile = "AppLogConfFile"
)

nolint

View Source
const (
	GroupKey               = "group"
	VersionKey             = "version"
	InterfaceKey           = "interface"
	MessageSizeKey         = "message_size"
	PathKey                = "path"
	ServiceKey             = "service"
	MethodsKey             = "methods"
	TimeoutKey             = "timeout"
	CategoryKey            = "category"
	CheckKey               = "check"
	EnabledKey             = "enabled"
	SideKey                = "side"
	OverrideProvidersKey   = "providerAddresses"
	BeanNameKey            = "bean.name"
	GenericKey             = "generic"
	ClassifierKey          = "classifier"
	TokenKey               = "token"
	LocalAddr              = "local-addr"
	RemoteAddr             = "remote-addr"
	DefaultRemotingTimeout = 3000
	ReleaseKey             = "release"
	AnyhostKey             = "anyhost"
	PortKey                = "port"
	ProtocolKey            = "protocol"
	PathSeparator          = "/"
	DotSeparator           = "."
	CommaSeparator         = ","
	SslEnabledKey          = "ssl-enabled"
	// ParamsTypeKey key used in pass through invoker factory, to define param type
	ParamsTypeKey        = "parameter-type-names"
	MetadataTypeKey      = "metadata-type"
	MaxCallSendMsgSize   = "max-call-send-msg-size"
	MaxServerSendMsgSize = "max-server-send-msg-size"
	MaxCallRecvMsgSize   = "max-call-recv-msg-size"
	MaxServerRecvMsgSize = "max-server-recv-msg-size"
)
View Source
const (
	ServiceFilterKey   = "service.filter"
	ReferenceFilterKey = "reference.filter"
)
View Source
const (
	AccessLogFilterKey                   = "accesslog"
	ActiveFilterKey                      = "active"
	AdaptiveServiceProviderFilterKey     = "padasvc"
	AuthConsumerFilterKey                = "sign"
	AuthProviderFilterKey                = "auth"
	EchoFilterKey                        = "echo"
	ExecuteLimitFilterKey                = "execute"
	GenericFilterKey                     = "generic"
	GenericServiceFilterKey              = "generic_service"
	GracefulShutdownProviderFilterKey    = "pshutdown"
	GracefulShutdownConsumerFilterKey    = "cshutdown"
	GracefulShutdownFilterShutdownConfig = "GracefulShutdownFilterShutdownConfig"
	HystrixConsumerFilterKey             = "hystrix_consumer"
	HystrixProviderFilterKey             = "hystrix_provider"
	MetricsFilterKey                     = "metrics"
	SeataFilterKey                       = "seata"
	SentinelProviderFilterKey            = "sentinel-provider"
	SentinelConsumerFilterKey            = "sentinel-consumer"
	TokenFilterKey                       = "token"
	TpsLimitFilterKey                    = "tps"
	TracingFilterKey                     = "tracing"
)

Filter Keys

View Source
const (
	TimestampKey                       = "timestamp"
	RemoteTimestampKey                 = "remote.timestamp"
	ClusterKey                         = "cluster"
	LoadbalanceKey                     = "loadbalance"
	WeightKey                          = "weight"
	WarmupKey                          = "warmup"
	RetriesKey                         = "retries"
	StickyKey                          = "sticky"
	BeanName                           = "bean.name"
	FailBackTasksKey                   = "failbacktasks"
	ForksKey                           = "forks"
	DefaultForks                       = 2
	DefaultTimeout                     = 1000
	TPSLimiterKey                      = "tps.limiter"
	TPSRejectedExecutionHandlerKey     = "tps.limit.rejected.handler"
	TPSLimitRateKey                    = "tps.limit.rate"
	DefaultTPSLimitRate                = -1
	TPSLimitIntervalKey                = "tps.limit.interval"
	DefaultTPSLimitInterval            = -1
	TPSLimitStrategyKey                = "tps.limit.strategy"
	ExecuteLimitKey                    = "execute.limit"
	DefaultExecuteLimit                = "-1"
	ExecuteRejectedExecutionHandlerKey = "execute.limit.rejected.handler"
	SerializationKey                   = "serialization"
	PIDKey                             = "pid"
	SyncReportKey                      = "sync.report"
	RetryPeriodKey                     = "retry.period"
	RetryTimesKey                      = "retry.times"
	CycleReportKey                     = "cycle.report"
	DefaultBlackListRecoverBlock       = 16
)
View Source
const (
	MetadataReportNamespaceKey = "metadata-report.namespace"
	MetadataReportGroupKey     = "metadata-report.group"
	MetadataReportUsernameKey  = "metadata-report.username"
	MetadataReportPasswordKey  = "metadata-report.password"
	MetadataReportProtocolKey  = "metadata-report.protocol"
)

metadata report keys

View Source
const (
	RegistryKey             = "registry"
	RegistryProtocol        = "registry"
	ServiceRegistryProtocol = "service-discovery-registry"
	RegistryRoleKey         = "registry.role"
	RegistryDefaultKey      = "registry.default"
	RegistryAccessKey       = "registry.accesskey"
	RegistrySecretKey       = "registry.secretkey"
	RegistryTimeoutKey      = "registry.timeout"
	RegistryLabelKey        = "label"
	PreferredKey            = "preferred"
	RegistryZoneKey         = "zone"
	RegistryZoneForceKey    = "zone.force"
	RegistryTTLKey          = "registry.ttl"
	RegistrySimplifiedKey   = "simplified"
	RegistryNamespaceKey    = "registry.namespace"
	RegistryGroupKey        = "registry.group"
)

registry keys

View Source
const (
	ApplicationKey         = "application"
	OrganizationKey        = "organization"
	NameKey                = "name"
	ModuleKey              = "module"
	AppVersionKey          = "app.version"
	OwnerKey               = "owner"
	EnvironmentKey         = "environment"
	MethodKey              = "method"
	MethodKeys             = "methods"
	RuleKey                = "rule"
	RuntimeKey             = "runtime"
	BackupKey              = "backup"
	RoutersCategory        = "routers"
	RouteProtocol          = "route"
	ConditionRouteProtocol = "condition"
	TagRouteProtocol       = "tag"
	ProvidersCategory      = "providers"
	RouterKey              = "router"
	ExportKey              = "export"
)
View Source
const (
	ConfigNamespaceKey        = "config-center.namespace"
	ConfigGroupKey            = "config-center.group"
	ConfigAppIDKey            = "config-center.appId"
	ConfigClusterKey          = "config-center.cluster"
	ConfigTimeoutKey          = "config-center.timeout"
	ConfigUsernameKey         = "config-center.username"
	ConfigAccessKey           = "config-center.access"
	ConfigPasswordKey         = "config-center.password"
	ConfigLogDirKey           = "config-center.logDir"
	ConfigVersionKey          = "config-center.configVersion"
	CompatibleConfigKey       = "config-center.compatible_config"
	ConfigSecretKey           = "config-center.secret"
	ConfigBackupConfigKey     = "config-center.isBackupConfig"
	ConfigBackupConfigPathKey = "config-center.backupConfigPath"
)

config center keys

View Source
const (
	RegistryConfigPrefix       = "dubbo.registries"
	ApplicationConfigPrefix    = "dubbo.application"
	ConfigCenterPrefix         = "dubbo.config-center"
	SingleRegistryConfigPrefix = "dubbo.registry"
	ReferenceConfigPrefix      = "dubbo.reference"
	ServiceConfigPrefix        = "dubbo.service"
	ConfigBasePrefix           = "dubbo.base"
	RemotePrefix               = "dubbo.remote"
	ServiceDiscPrefix          = "dubbo.service-discovery"
	ProtocolConfigPrefix       = "dubbo.protocols"
	ProviderConfigPrefix       = "dubbo.provider"
	ConsumerConfigPrefix       = "dubbo.consumer"
	ShutdownConfigPrefix       = "dubbo.shutdown"
	MetadataReportPrefix       = "dubbo.metadata-report"
	RouterConfigPrefix         = "dubbo.router"
	TracingConfigPrefix        = "dubbo.tracing"
	LoggerConfigPrefix         = "dubbo.logger"
	CustomConfigPrefix         = "dubbo.custom"
)
View Source
const (
	NacosKey                  = "nacos"
	NacosGroupKey             = "nacos.group"
	NacosDefaultRoleType      = 3
	NacosCacheDirKey          = "nacos.cacheDir"
	NacosLogDirKey            = "nacos.logDir"
	NacosBeatIntervalKey      = "nacos.beatInterval"
	NacosEndpoint             = "endpoint"
	NacosServiceNameSeparator = ":"
	NacosCategoryKey          = "nacos.category"
	NacosProtocolKey          = "protocol"
	NacosPathKey              = "path"
	NacosNamespaceID          = "nacos.namespaceId"
	NacosNotLoadLocalCache    = "nacos.not.load.cache"
	NacosAppNameKey           = "appName"
	NacosRegionIDKey          = "nacos.regionId"
	NacosAccessKey            = "nacos.access"
	NacosSecretKey            = "nacos.secret"
	NacosOpenKmsKey           = "kms"
	NacosUpdateThreadNumKey   = "updateThreadNum"
	NacosLogLevelKey          = "nacos.logLevel"
	NacosUsername             = "nacos.username"
	NacosPassword             = "nacos.password"
)
View Source
const (
	PolarisKey                  = "polaris"
	PolarisDefaultRoleType      = 3
	PolarisConfigFilePath       = "configPath"
	PolarisNamespace            = "namespace"
	PolarisServiceToken         = "token"
	PolarisServiceNameSeparator = ":"
	PolarisDubboPath            = "DUBBOPATH"
	PolarisInstanceID           = "polaris.instanceID"
	PolarisDefaultNamespace     = "default"
	PolarisDubboGroup           = "dubbo.group"
	PolarisClientName           = "polaris-client"
)
View Source
const (
	TracingRemoteSpanCtx = DubboCtxKey("tracing.remote.span.ctx")
	TracingConfigKey     = "config.tracing"
)
View Source
const (
	// TagRouterRuleSuffix Specify tag router suffix
	TagRouterRuleSuffix = ".tag-router"
	// ConditionRouterRuleSuffix Specify condition router suffix
	ConditionRouterRuleSuffix = ".condition-router"
	// MeshRouteSuffix Specify mesh router suffix
	MeshRouteSuffix = ".MESHAPPRULE"
	// ForceUseTag is the tag in attachment
	ForceUseTag = "dubbo.force.tag"
	Tagkey      = "dubbo.tag"
	// AttachmentKey in context in invoker
	AttachmentKey = DubboCtxKey("attachment")
)

Use for router module

View Source
const (
	// name of service filter
	ServiceAuthKey = "auth"
	// key of authenticator
	AuthenticatorKey = "authenticator"
	// name of default authenticator
	DefaultAuthenticator = "accesskeys"
	// name of default url storage
	DefaultAccessKeyStorage = "urlstorage"
	// key of storage
	AccessKeyStorageKey = "accessKey.storage"
	// key of request timestamp
	RequestTimestampKey = "timestamp"
	// key of request signature
	RequestSignatureKey = "signature"
	// AK key
	AKKey = "ak"
	// signature format
	SignatureStringFormat = "%s#%s#%s#%s"
	// key whether enable signature
	ParameterSignatureEnableKey = "param.sign"
	// consumer
	Consumer = "consumer"
	// key of access key id
	AccessKeyIDKey = ".accessKeyId"
	// key of secret access key
	SecretAccessKeyKey = ".secretAccessKey"
)

Auth filter

View Source
const (
	MetaConfigRemote  = "remote"
	MetaConfigLocal   = "local"
	KeySeparator      = ":"
	DefaultPathTag    = "metadata"
	KeyRevisionPrefix = "revision"

	// metadata service
	MetadataServiceName = "org.apache.dubbo.metadata.MetadataService"
)
View Source
const (
	SubscribedServiceNamesKey              = "subscribed-services"
	ProvidedBy                             = "provided-by"
	ExportedServicesRevisionPropertyName   = "dubbo.metadata.revision"
	SubscribedServicesRevisionPropertyName = "dubbo.subscribed-services.revision"
	ServiceInstanceSelector                = "service-instance-selector"
	MetadataStorageTypePropertyName        = "dubbo.metadata.storage-type"
	DefaultMetadataStorageType             = "local"
	RemoteMetadataStorageType              = "remote"
	ServiceInstanceEndpoints               = "dubbo.endpoints"
	MetadataServicePrefix                  = "dubbo.metadata-service."
	MetadataServiceURLParamsPropertyName   = MetadataServicePrefix + "url-params"
	MetadataServiceURLsPropertyName        = MetadataServicePrefix + "urls"

	// ServiceDiscoveryKey indicate which service discovery instance will be used
	ServiceDiscoveryKey = "service_discovery"
)

service discovery

View Source
const (
	GenericSerializationDefault = "true"
	// disable "protobuf-json" temporarily
	//GenericSerializationProtobuf = "protobuf-json"
	GenericSerializationGson = "gson"
)

Generic Filter

View Source
const (
	// attribute keys
	AdaptiveServiceUpdaterKey = "adaptive-service.updater"
	// attachment keys
	AdaptiveServiceRemainingKey = "adaptive-service.remaining"
	AdaptiveServiceInflightKey  = "adaptive-service.inflight"
	AdaptiveServiceEnabledKey   = "adaptive-service.enabled"
	// enabled value
	AdaptiveServiceIsEnabled = "1"
)

AdaptiveService Filter goland:noinspection ALL

View Source
const (
	LoadBalanceKeyConsistentHashing = "consistenthashing"
	LoadBalanceKeyLeastActive       = "leastactive"
	LoadBalanceKeyRandom            = "random"
	LoadBalanceKeyRoundRobin        = "roundrobin"
	LoadBalanceKeyP2C               = "p2c"
)
View Source
const (
	SHessian2 byte = 2
	SProto    byte = 21
)
View Source
const (
	Hessian2Serialization = "hessian2"
	ProtobufSerialization = "protobuf"
	MsgpackSerialization  = "msgpack"
)
View Source
const (
	// Version apache/dubbo-go version
	Version = "3.0.0"
	// Name module name
	Name = "dubbogo"
	// Date release date
	DATE = "2021/05/14"
)
View Source
const (
	AsyncKey = "async" // it's value should be "true" or "false" of string type
)
View Source
const (
	ClientNameKey = "remote-client-name"
)
View Source
const (
	CommaSplitPattern = "\\s*[,]+\\s*"
)
View Source
const (
	ConfiguratorSuffix = ".configurators"
)
View Source
const (
	DubboGoCtxKey = DubboCtxKey("dubbogo-ctx")
)
View Source
const (
	EtcdV3Key = "etcdv3"
)
View Source
const (
	FileKey = "file"
)
View Source
const (
	NonImportErrorMsgFormat = "Cluster for %s is not existing, make sure you have import the package."
)
View Source
const (
	// PassThroughProxyFactoryKey is key of proxy factory with raw data input service
	PassThroughProxyFactoryKey = "dubbo-raw"
)
View Source
const (
	ServiceDiscoveryDefaultGroup = "DEFAULT_GROUP"
)
View Source
const (
	ZookeeperKey = "zookeeper"
)

Variables

The value will be 10^6 1ms = 10^6ns

Functions

This section is empty.

Types

type DubboCtxKey

type DubboCtxKey string

Jump to

Keyboard shortcuts

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