-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathkey.go
More file actions
546 lines (499 loc) · 20.9 KB
/
Copy pathkey.go
File metadata and controls
546 lines (499 loc) · 20.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package constant
type DubboCtxKey string
const (
AsyncKey = "async" // it's value should be "true" or "false" of string type
)
const (
ClientNameKey = "remote-client-name"
)
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"
GenericVariadicCallSliceKey = "generic-variadic-call-slice" // internal marker from generic filter to variadic reflection dispatchers
ClassifierKey = "classifier"
TokenKey = "token"
LocalAddr = "local-addr"
RemoteAddr = "remote-addr"
DefaultRemotingTimeout = 1000
ReleaseKey = "release"
AnyhostKey = "anyhost"
PortKey = "port"
HostKey = "host"
UsernameKey = "username"
PasswordKey = "password"
ProtocolKey = "protocol"
PathSeparator = "/"
DotSeparator = "."
CommaSeparator = ","
SslEnabledKey = "ssl-enabled"
ParamsTypeKey = "parameter-type-names" // key used in pass through invoker factory, to define param type
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"
KeepAliveInterval = "keep-alive-interval"
KeepAliveTimeout = "keep-alive-timeout"
// TODO: remove IDLMode after old triple removed
//
// Deprecated: this constant will be removed in the next version. The IDL
// mode switch is no longer supported by dubbo-go.
IDLMode = "IDL-mode"
TripleConfigKey = "triple-config"
ConsumerConfigKey = "consumer-config"
RegistriesConfigKey = "registries-config"
RoutersConfigKey = "routers-config"
)
// TODO: remove this after old triple removed
// IDLMode
//
// Deprecated: these constants will be removed in the next version. The IDL
// mode switch is no longer supported by dubbo-go.
const (
IDL = "IDL"
NONIDL = "non-IDL"
)
// tls constant
const (
TLSKey = "tls_key"
TLSCert = "tls_cert"
CACert = "ca_cert"
TLSServerNAME = "tls_server_name"
)
const (
ServiceFilterKey = "service.filter"
ReferenceFilterKey = "reference.filter"
)
// Filter Keys
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"
GracefulShutdownClosingKey = "closing"
HystrixConsumerFilterKey = "hystrix_consumer"
HystrixProviderFilterKey = "hystrix_provider"
MetricsFilterKey = "metrics"
SeataFilterKey = "seata"
SentinelProviderFilterKey = "sentinel-provider"
SentinelConsumerFilterKey = "sentinel-consumer"
TokenFilterKey = "token"
TpsLimitFilterKey = "tps"
TracingFilterKey = "tracing"
OTELServerTraceKey = "otelServerTrace"
OTELClientTraceKey = "otelClientTrace"
)
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
CallTypeKey = "call-type"
ResponseHeaderKey = "response-header"
ResponseTrailerKey = "response-trailer"
CallUnary = "unary"
CallClientStream = "client-stream"
CallServerStream = "server-stream"
CallBidiStream = "bidi-stream"
CallHTTP = "http"
CallHTTP2 = "http2"
CallHTTP3 = "http3"
CallHTTP2AndHTTP3 = "http2-and-http3"
AltSvcProtocolH2 = "h2"
AltSvcProtocolH3 = "h3"
ServiceInfoKey = "service-info"
RpcServiceKey = "rpc-service"
ClientInfoKey = "client-info"
TLSConfigKey = "tls-config"
ProviderConfigKey = "provider-config"
ProtocolConfigKey = "protocol-config"
)
const (
DubboGoCtxKey = DubboCtxKey("dubbogo-ctx")
)
// metadata report keys
const (
MetadataReportNamespaceKey = "metadata-report.namespace"
MetadataReportGroupKey = "metadata-report.group"
MetadataReportUsernameKey = "metadata-report.username"
MetadataReportPasswordKey = "metadata-report.password"
MetadataReportProtocolKey = "metadata-report.protocol"
)
// registry keys
const (
RegistryKey = "registry"
RegistryIdKey = "registry.id"
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"
RegistryTypeKey = "registry.type"
RegistryTypeInterface = "interface"
RegistryTypeService = "service"
RegistryTypeAll = "all"
)
const (
ApplicationKey = "application"
ApplicationTagKey = "application.tag"
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"
)
// config center keys
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"
ConfigCacheTTLKey = "config-center.cache-ttl"
ConfigRootPathParamKey = "dubbo.config-center.root-path"
)
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"
ProfilesConfigPrefix = "dubbo.profiles"
TLSConfigPrefix = "dubbo.tls_config"
)
const (
ConfiguratorSuffix = ".configurators"
)
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"
NacosTimeout = "nacos.timeout"
NacosUpdateCacheWhenEmpty = "nacos.updateCacheWhenEmpty"
)
const (
FileKey = "file"
)
const (
ZookeeperKey = "zookeeper"
)
const (
ApolloKey = "apollo"
)
const (
EtcdV3Key = "etcdv3"
)
const (
// PassThroughProxyFactoryKey is key of proxy factory with raw data input service
PassThroughProxyFactoryKey = "dubbo-raw"
)
const (
TracingRemoteSpanCtx = DubboCtxKey("tracing.remote.span.ctx")
TracingConfigKey = "config.tracing"
)
// Use for router module
const (
ScriptRouterRuleSuffix = ".script-router"
TagRouterRuleSuffix = ".tag-router"
ConditionRouterRuleSuffix = ".condition-router" // Specify condition router suffix
AffinityRuleSuffix = ".affinity-router" // Specify affinity router suffix
MeshRouteSuffix = ".MESHAPPRULE" // Specify mesh router suffix
ForceUseTag = "dubbo.force.tag" // the tag in attachment
ForceUseCondition = "dubbo.force.condition"
Tagkey = "dubbo.tag" // key of tag
ConditionKey = "dubbo.condition"
AttachmentKey = DubboCtxKey("attachment") // key in context in invoker
TagRouterFactoryKey = "tag"
AffinityAppRouterFactoryKey = "application.affinity"
AffinityServiceRouterFactoryKey = "service.affinity"
ConditionAppRouterFactoryKey = "provider.condition"
ConditionServiceRouterFactoryKey = "service.condition"
ScriptRouterFactoryKey = "consumer.script"
RouterScopeService = "service"
RouterScopeApplication = "application"
ForceKey = "force"
TrafficDisableKey = "trafficDisable"
RouterCacheDisable = "routerCacheDisable"
RouterChainCacheGeneration = "routerChainCacheGeneration"
Arguments = "arguments"
Attachments = "attachments"
Param = "param"
Scope = "scope"
Wildcard = "wildcard"
MeshRouterFactoryKey = "mesh"
DefaultRouteConditionSubSetWeight = 100
// Poolable router bitmap key prefixes
PoolKeyTagPrefix = "tag\x00"
PoolKeyAddrPrefix = "addr\x00"
PoolKeyPortPrefix = "port\x00"
PoolKeyAll = "*"
)
// Auth filter
const (
ServiceAuthKey = "auth" // name of service filter
AuthenticatorKey = "authenticator" // key of authenticator
DefaultAuthenticator = "accesskeys" // name of default authenticator
DefaultAccessKeyStorage = "urlstorage" // name of default url storage
AccessKeyStorageKey = "accessKey.storage" // key of storage
RequestTimestampKey = "timestamp" // key of request timestamp
RequestSignatureKey = "signature" // key of request signature
AKKey = "ak" // AK key
SignatureStringFormat = "%s#%s#%s#%s" // signature format
ParameterSignatureEnableKey = "param.sign" // key whether enable signature
Consumer = "consumer" // consumer
AccessKeyIDKey = ".accessKeyId" // key of access key id
SecretAccessKeyKey = ".secretAccessKey" // key of secret access key
)
// metadata report
const (
MetaConfigRemote = "remote"
MetaConfigLocal = "local"
KeySeparator = ":"
DefaultPathTag = "metadata"
KeyRevisionPrefix = "revision"
MetadataServiceName = "org.apache.dubbo.metadata.MetadataService" // metadata service
MetadataServiceV2Name = "org.apache.dubbo.metadata.MetadataServiceV2" // metadata service
MetadataVersion = "meta-v"
MetadataServiceV1 = "MetadataServiceV1"
MetadataServiceV2 = "MetadataServiceV2"
MetadataServiceV1Version = "1.0.0"
MetadataServiceV2Version = "2.0.0"
)
// service discovery
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 = "service_discovery" // indicate which service discovery instance will be used
// metadata GC configuration keys
MetadataGCEnabledKey = "metadata.gc.enabled"
MetadataGCWindowKey = "metadata.gc.window" // GC window in days, aligned with daily renew cycle
MetadataRenewOnStartupKey = "metadata.renew-on-startup" // whether to run renewAppMetadata once on startup
)
// Generic Filter
const (
GenericSerializationDefault = "true"
GenericSerializationGson = "gson"
GenericSerializationProtobuf = "protobuf"
GenericSerializationProtobufJson = "protobuf-json"
GenericSerializationBean = "bean"
GenericIncludeClassKey = "generic.include.class"
)
// AdaptiveService Filter
// goland:noinspection ALL
const (
AdaptiveServiceUpdaterKey = "adaptive-service.updater"
AdaptiveServiceRemainingKey = "adaptive-service.remaining"
AdaptiveServiceInflightKey = "adaptive-service.inflight"
AdaptiveServiceEnabledKey = "adaptive-service.enabled"
AdaptiveServiceIsEnabled = "1"
)
// reflection service
const (
ReflectionServiceTypeName = "ReflectionServer"
ReflectionServiceInterface = "grpc.reflection.v1alpha.ServerReflection"
)
// healthcheck service
const (
HealthCheckServiceTypeName = "HealthCheckServer"
HealthCheckServiceInterface = "grpc.health.v1.Health"
)
const (
LoggerLevelKey = "logger.level"
LoggerDriverKey = "logger.driver"
LoggerFormatKey = "logger.format"
LoggerAppenderKey = "logger.appender"
LoggerFileNameKey = "logger.file.name"
LoggerFileNaxSizeKey = "logger.file.max-size"
LoggerFileMaxBackupsKey = "logger.file.max-backups"
LoggerFileMaxAgeKey = "logger.file.max-age"
LoggerFileLocalTimeKey = "logger.file.local-time"
LoggerFileCompressKey = "logger.file.compress"
LoggerTraceEnabledKey = "logger.trace-integration.enabled"
LoggerTraceRecordErrorKey = "logger.trace-integration.record-error-to-span"
)
// metrics key
const (
MetadataEnabledKey = "metrics.metadata.enabled"
RegistryEnabledKey = "metrics.registry.enabled"
ConfigCenterEnabledKey = "metrics.config-center.enabled"
RpcEnabledKey = "metrics.rpc.enabled"
AggregationEnabledKey = "aggregation.enabled"
AggregationBucketNumKey = "aggregation.bucket.num"
AggregationTimeWindowSecondsKey = "aggregation.time.window.seconds"
HistogramEnabledKey = "histogram.enabled"
PrometheusExporterEnabledKey = "prometheus.exporter.enabled"
PrometheusExporterMetricsPortKey = "prometheus.exporter.metrics.port"
PrometheusExporterMetricsPathKey = "prometheus.exporter.metrics.path"
PrometheusPushgatewayEnabledKey = "prometheus.pushgateway.enabled"
PrometheusPushgatewayBaseUrlKey = "prometheus.pushgateway.base.url"
PrometheusPushgatewayUsernameKey = "prometheus.pushgateway.username"
PrometheusPushgatewayPasswordKey = "prometheus.pushgateway.password"
PrometheusPushgatewayPushIntervalKey = "prometheus.pushgateway.push.interval"
PrometheusPushgatewayJobKey = "prometheus.pushgateway.job"
ProbeEnabledKey = "probe.enabled"
ProbePortKey = "probe.port"
ProbeLivenessPathKey = "probe.liveness.path"
ProbeReadinessPathKey = "probe.readiness.path"
ProbeStartupPathKey = "probe.startup.path"
ProbeUseInternalStateKey = "probe.use-internal-state"
)
// default meta cache config
const (
DefaultMetaCacheName = "dubbo.meta"
DefaultMetaFileName = "dubbo.metadata."
DefaultEntrySize = 100
)
// priority
const (
DefaultPriority = 0
)
const (
TripleGoInterfaceName = "XXX_TRIPLE_GO_INTERFACE_NAME"
TripleGoMethodName = "XXX_TRIPLE_GO_METHOD_NAME"
)
const (
RpcServiceInterfaceName = "RPCSERVICE_INTERFACE_NAME"
)
// Weight constants for Nacos instance registration
const (
DefaultNacosWeight = 1.0 // Default weight if not specified or invalid
MinNacosWeight = 0.0 // Minimum allowed weight (Nacos range starts at 0)
MaxNacosWeight = 10000.0 // Maximum allowed weight (Nacos range ends at 10000)
)