Documentation ¶
Overview ¶
Package config defines the Dubbo-go config, which carries ApplicationConfig、 RegisterConfig、ProtocolConfig、RouterConfig and MetadataReportConfig etc. Configuration is greater than convention in dubbo-go. Please refer to https://github.com/apache/dubbo-go-samples for more information.
Index ¶
- Constants
- Variables
- func BeforeShutdown()
- func GetCallback(name string) func(response common.CallbackResponse)
- func GetClientTlsConfig(opt *TLSConfig) (*tls.Config, error)
- func GetClientTlsConfigBuilder() getty.TlsConfigBuilderdeprecated
- func GetConfigResolver(conf *loaderConf) *koanf.Koanf
- func GetConsumerService(name string) common.RPCService
- func GetConsumerServiceByInterfaceName(interfaceName string) common.RPCService
- func GetConsumerServiceMap() map[string]common.RPCService
- func GetDefineValue(key string, default_value interface{}) interface{}
- func GetProtocolsInstance() map[string]*ProtocolConfig
- func GetProviderService(name string) common.RPCService
- func GetProviderServiceMap() map[string]common.RPCService
- func GetRPCService(name string) common.RPCService
- func GetServerTlsConfig(opt *TLSConfig) (*tls.Config, error)
- func GetServerTlsConfigBuilder() getty.TlsConfigBuilderdeprecated
- func IsProvider() bool
- func Load(opts ...LoaderConfOption) error
- func NewLoaderConf(opts ...LoaderConfOption) *loaderConf
- func RPCService(service common.RPCService)
- func SetClientTlsConfigBuilder(configBuilder getty.TlsConfigBuilder)deprecated
- func SetConsumerConfig(c ConsumerConfig)
- func SetConsumerService(service common.RPCService)
- func SetConsumerServiceByInterfaceName(interfaceName string, srv common.RPCService)
- func SetProviderService(service common.RPCService)
- func SetRootConfig(r RootConfig)
- func SetServerTlsConfigBuilder(configBuilder getty.TlsConfigBuilder)deprecated
- type AggregateConfig
- type ApplicationConfig
- type ApplicationConfigBuilder
- func (acb *ApplicationConfigBuilder) Build() *ApplicationConfig
- func (acb *ApplicationConfigBuilder) SetEnvironment(environment string) *ApplicationConfigBuilder
- func (acb *ApplicationConfigBuilder) SetMetadataType(metadataType string) *ApplicationConfigBuilder
- func (acb *ApplicationConfigBuilder) SetModule(module string) *ApplicationConfigBuilder
- func (acb *ApplicationConfigBuilder) SetName(name string) *ApplicationConfigBuilder
- func (acb *ApplicationConfigBuilder) SetOrganization(organization string) *ApplicationConfigBuilder
- func (acb *ApplicationConfigBuilder) SetOwner(owner string) *ApplicationConfigBuilder
- func (acb *ApplicationConfigBuilder) SetVersion(version string) *ApplicationConfigBuilder
- type CenterConfig
- func (c *CenterConfig) CreateDynamicConfiguration() (config_center.DynamicConfiguration, error)
- func (c *CenterConfig) GetDynamicConfiguration() (config_center.DynamicConfiguration, error)
- func (c *CenterConfig) GetUrlMap() url.Values
- func (c *CenterConfig) Init(rc *RootConfig) error
- func (CenterConfig) Prefix() string
- type ConfigCenterConfigBuilder
- func (ccb *ConfigCenterConfigBuilder) Build() *CenterConfig
- func (ccb *ConfigCenterConfigBuilder) SetAddress(address string) *ConfigCenterConfigBuilder
- func (ccb *ConfigCenterConfigBuilder) SetDataID(dataID string) *ConfigCenterConfigBuilder
- func (ccb *ConfigCenterConfigBuilder) SetGroup(group string) *ConfigCenterConfigBuilder
- func (ccb *ConfigCenterConfigBuilder) SetNamespace(namespace string) *ConfigCenterConfigBuilder
- func (ccb *ConfigCenterConfigBuilder) SetPassword(password string) *ConfigCenterConfigBuilder
- func (ccb *ConfigCenterConfigBuilder) SetProtocol(protocol string) *ConfigCenterConfigBuilder
- func (ccb *ConfigCenterConfigBuilder) SetUserName(userName string) *ConfigCenterConfigBuilder
- type ConsumerConfig
- type ConsumerConfigBuilder
- func (ccb *ConsumerConfigBuilder) AddReference(referenceKey string, referenceConfig *ReferenceConfig) *ConsumerConfigBuilder
- func (ccb *ConsumerConfigBuilder) Build() *ConsumerConfig
- func (ccb *ConsumerConfigBuilder) SetCheck(check bool) *ConsumerConfigBuilder
- func (ccb *ConsumerConfigBuilder) SetFilter(filter string) *ConsumerConfigBuilder
- func (ccb *ConsumerConfigBuilder) SetFilterConf(filterConf interface{}) *ConsumerConfigBuilder
- func (ccb *ConsumerConfigBuilder) SetMaxWaitTimeForServiceDiscovery(maxWaitTimeForServiceDiscovery string) *ConsumerConfigBuilder
- func (ccb *ConsumerConfigBuilder) SetMeshEnabled(meshEnabled bool) *ConsumerConfigBuilder
- func (ccb *ConsumerConfigBuilder) SetProxyFactory(proxyFactory string) *ConsumerConfigBuilder
- func (ccb *ConsumerConfigBuilder) SetReferences(references map[string]*ReferenceConfig) *ConsumerConfigBuilder
- func (ccb *ConsumerConfigBuilder) SetRegistryIDs(RegistryIDs ...string) *ConsumerConfigBuilder
- func (ccb *ConsumerConfigBuilder) SetRequestTimeout(requestTimeout string) *ConsumerConfigBuilder
- func (ccb *ConsumerConfigBuilder) SetRootConfig(rootConfig *RootConfig) *ConsumerConfigBuilder
- type CustomConfig
- type CustomConfigBuilder
- type Exporter
- type File
- type LoaderConfOption
- type LoggerConfig
- type LoggerConfigBuilder
- func (lcb *LoggerConfigBuilder) Build() *LoggerConfig
- func (lcb *LoggerConfigBuilder) SetAppender(appender string) *LoggerConfigBuilder
- func (lcb *LoggerConfigBuilder) SetDriver(driver string) *LoggerConfigBuilder
- func (lcb *LoggerConfigBuilder) SetFileCompress(compress bool) *LoggerConfigBuilder
- func (lcb *LoggerConfigBuilder) SetFileMaxAge(maxAge int) *LoggerConfigBuilder
- func (lcb *LoggerConfigBuilder) SetFileMaxBackups(maxBackups int) *LoggerConfigBuilder
- func (lcb *LoggerConfigBuilder) SetFileMaxSize(maxSize int) *LoggerConfigBuilder
- func (lcb *LoggerConfigBuilder) SetFileName(name string) *LoggerConfigBuilder
- func (lcb *LoggerConfigBuilder) SetFormat(format string) *LoggerConfigBuilder
- func (lcb *LoggerConfigBuilder) SetLevel(level string) *LoggerConfigBuilder
- type MetadataReportConfig
- type MetadataReportConfigBuilder
- func (mrcb *MetadataReportConfigBuilder) Build() *MetadataReportConfig
- func (mrcb *MetadataReportConfigBuilder) SetAddress(address string) *MetadataReportConfigBuilder
- func (mrcb *MetadataReportConfigBuilder) SetGroup(group string) *MetadataReportConfigBuilder
- func (mrcb *MetadataReportConfigBuilder) SetPassword(password string) *MetadataReportConfigBuilder
- func (mrcb *MetadataReportConfigBuilder) SetProtocol(protocol string) *MetadataReportConfigBuilder
- func (mrcb *MetadataReportConfigBuilder) SetTimeout(timeout string) *MetadataReportConfigBuilder
- func (mrcb *MetadataReportConfigBuilder) SetUsername(username string) *MetadataReportConfigBuilder
- type MethodConfig
- type MetricConfig
- type MetricConfigBuilder
- func (mcb *MetricConfigBuilder) Build() *MetricConfig
- func (mcb *MetricConfigBuilder) SetConfigCenterEnabled(enabled bool) *MetricConfigBuilder
- func (mcb *MetricConfigBuilder) SetMetadataEnabled(enabled bool) *MetricConfigBuilder
- func (mcb *MetricConfigBuilder) SetRegistryEnabled(enabled bool) *MetricConfigBuilder
- type MockService
- type OtelConfig
- type OtelConfigBuilder
- type OtelTraceConfig
- type ProfilesConfig
- type PrometheusConfig
- type ProtocolConfig
- type ProtocolConfigBuilder
- func (pcb *ProtocolConfigBuilder) Build() *ProtocolConfig
- func (pcb *ProtocolConfigBuilder) SetIp(ip string) *ProtocolConfigBuilder
- func (pcb *ProtocolConfigBuilder) SetMaxServerRecvMsgSize(maxServerRecvMsgSize string) *ProtocolConfigBuilder
- func (pcb *ProtocolConfigBuilder) SetMaxServerSendMsgSize(maxServerSendMsgSize string) *ProtocolConfigBuilder
- func (pcb *ProtocolConfigBuilder) SetName(name string) *ProtocolConfigBuilder
- func (pcb *ProtocolConfigBuilder) SetParams(params interface{}) *ProtocolConfigBuilder
- func (pcb *ProtocolConfigBuilder) SetPort(port string) *ProtocolConfigBuilder
- type ProviderConfig
- type ProviderConfigBuilder
- func (pcb *ProviderConfigBuilder) AddConfigType(key, value string) *ProviderConfigBuilder
- func (pcb *ProviderConfigBuilder) AddService(serviceID string, serviceConfig *ServiceConfig) *ProviderConfigBuilder
- func (pcb *ProviderConfigBuilder) Build() *ProviderConfig
- func (pcb *ProviderConfigBuilder) SetConfigType(configType map[string]string) *ProviderConfigBuilder
- func (pcb *ProviderConfigBuilder) SetFilter(filter string) *ProviderConfigBuilder
- func (pcb *ProviderConfigBuilder) SetFilterConf(filterConf interface{}) *ProviderConfigBuilder
- func (pcb *ProviderConfigBuilder) SetProxyFactory(proxyFactory string) *ProviderConfigBuilder
- func (pcb *ProviderConfigBuilder) SetRegister(register bool) *ProviderConfigBuilder
- func (pcb *ProviderConfigBuilder) SetRegistryIDs(RegistryIDs ...string) *ProviderConfigBuilder
- func (pcb *ProviderConfigBuilder) SetRootConfig(rootConfig *RootConfig) *ProviderConfigBuilder
- func (pcb *ProviderConfigBuilder) SetServices(services map[string]*ServiceConfig) *ProviderConfigBuilder
- type PushgatewayConfig
- type ReferenceConfig
- func (rc *ReferenceConfig) GenericLoad(id string)
- func (rc *ReferenceConfig) GetInvoker() protocol.Invoker
- func (rc *ReferenceConfig) GetProxy() *proxy.Proxy
- func (rc *ReferenceConfig) GetRPCService() common.RPCService
- func (rc *ReferenceConfig) Implement(v common.RPCService)
- func (rc *ReferenceConfig) Init(root *RootConfig) error
- func (rc *ReferenceConfig) Prefix() string
- func (rc *ReferenceConfig) Refer(srv interface{})
- type ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) AddMethodConfig(methodConfig *MethodConfig) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) Build() *ReferenceConfig
- func (pcb *ReferenceConfigBuilder) SetAsync(async bool) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetCluster(cluster string) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetFilter(filter string) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetForceTag(forceTag bool) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetGeneric(generic bool) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetGroup(group string) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetInterface(interfaceName string) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetLoadbalance(loadbalance string) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetMethodConfig(methodConfigs []*MethodConfig) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetParams(params map[string]string) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetProtocol(protocol string) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetProvidedBy(providedBy string) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetRegistryIDs(registryIDs ...string) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetRequestTimeout(requestTimeout string) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetRetries(retries string) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetSerialization(serialization string) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetSticky(sticky bool) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetTracingKey(tracingKey string) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetURL(url string) *ReferenceConfigBuilder
- func (pcb *ReferenceConfigBuilder) SetVersion(version string) *ReferenceConfigBuilder
- type RegistryConfig
- type RegistryConfigBuilder
- func (rcb *RegistryConfigBuilder) AddParam(key, value string) *RegistryConfigBuilder
- func (rcb *RegistryConfigBuilder) Build() *RegistryConfig
- func (rcb *RegistryConfigBuilder) SetAddress(address string) *RegistryConfigBuilder
- func (rcb *RegistryConfigBuilder) SetGroup(group string) *RegistryConfigBuilder
- func (rcb *RegistryConfigBuilder) SetNamespace(namespace string) *RegistryConfigBuilder
- func (rcb *RegistryConfigBuilder) SetParams(params map[string]string) *RegistryConfigBuilder
- func (rcb *RegistryConfigBuilder) SetPassword(password string) *RegistryConfigBuilder
- func (rcb *RegistryConfigBuilder) SetPreferred(preferred bool) *RegistryConfigBuilder
- func (rcb *RegistryConfigBuilder) SetProtocol(protocol string) *RegistryConfigBuilder
- func (rcb *RegistryConfigBuilder) SetRegistryType(registryType string) *RegistryConfigBuilder
- func (rcb *RegistryConfigBuilder) SetSimplified(simplified bool) *RegistryConfigBuilder
- func (rcb *RegistryConfigBuilder) SetTTL(ttl string) *RegistryConfigBuilder
- func (rcb *RegistryConfigBuilder) SetTimeout(timeout string) *RegistryConfigBuilder
- func (rcb *RegistryConfigBuilder) SetUsername(username string) *RegistryConfigBuilder
- func (rcb *RegistryConfigBuilder) SetWeight(weight int64) *RegistryConfigBuilder
- func (rcb *RegistryConfigBuilder) SetZone(zone string) *RegistryConfigBuilder
- type RegistryConfigOpt
- func WithRegistryAddress(addr string) RegistryConfigOpt
- func WithRegistryGroup(group string) RegistryConfigOpt
- func WithRegistryParams(params map[string]string) RegistryConfigOpt
- func WithRegistryPassword(psw string) RegistryConfigOpt
- func WithRegistryPreferred(preferred bool) RegistryConfigOpt
- func WithRegistryProtocol(regProtocol string) RegistryConfigOpt
- func WithRegistrySimplified(simplified bool) RegistryConfigOpt
- func WithRegistryTTL(ttl string) RegistryConfigOpt
- func WithRegistryTimeOut(timeout string) RegistryConfigOpt
- func WithRegistryUserName(userName string) RegistryConfigOpt
- func WithRegistryWeight(weight int64) RegistryConfigOpt
- type RemoteConfig
- type RemoteConfigBuilder
- func (rcb *RemoteConfigBuilder) AddParam(key, value string) *RemoteConfigBuilder
- func (rcb *RemoteConfigBuilder) Build() *RemoteConfig
- func (rcb *RemoteConfigBuilder) SetAddress(address string) *RemoteConfigBuilder
- func (rcb *RemoteConfigBuilder) SetParams(params map[string]string) *RemoteConfigBuilder
- func (rcb *RemoteConfigBuilder) SetPassword(password string) *RemoteConfigBuilder
- func (rcb *RemoteConfigBuilder) SetProtocol(protocol string) *RemoteConfigBuilder
- func (rcb *RemoteConfigBuilder) SetTimeout(timeout string) *RemoteConfigBuilder
- func (rcb *RemoteConfigBuilder) SetUsername(username string) *RemoteConfigBuilder
- type RootConfig
- type RootConfigBuilder
- func (rb *RootConfigBuilder) AddProtocol(protocolID string, protocolConfig *ProtocolConfig) *RootConfigBuilder
- func (rb *RootConfigBuilder) AddRegistry(registryID string, registryConfig *RegistryConfig) *RootConfigBuilder
- func (rb *RootConfigBuilder) Build() *RootConfig
- func (rb *RootConfigBuilder) SetApplication(application *ApplicationConfig) *RootConfigBuilder
- func (rb *RootConfigBuilder) SetCacheFile(cacheFile string) *RootConfigBuilder
- func (rb *RootConfigBuilder) SetConfigCenter(configCenterConfig *CenterConfig) *RootConfigBuilder
- func (rb *RootConfigBuilder) SetConsumer(consumer *ConsumerConfig) *RootConfigBuilder
- func (rb *RootConfigBuilder) SetCustom(customConfig *CustomConfig) *RootConfigBuilder
- func (rb *RootConfigBuilder) SetEventDispatcherType(eventDispatcherType string) *RootConfigBuilder
- func (rb *RootConfigBuilder) SetLogger(logger *LoggerConfig) *RootConfigBuilder
- func (rb *RootConfigBuilder) SetMetadataReport(metadataReport *MetadataReportConfig) *RootConfigBuilder
- func (rb *RootConfigBuilder) SetMetric(metric *MetricConfig) *RootConfigBuilder
- func (rb *RootConfigBuilder) SetOtel(otel *OtelConfig) *RootConfigBuilder
- func (rb *RootConfigBuilder) SetProtocols(protocols map[string]*ProtocolConfig) *RootConfigBuilder
- func (rb *RootConfigBuilder) SetProvider(provider *ProviderConfig) *RootConfigBuilder
- func (rb *RootConfigBuilder) SetRegistries(registries map[string]*RegistryConfig) *RootConfigBuilder
- func (rb *RootConfigBuilder) SetRouter(router []*RouterConfig) *RootConfigBuilder
- func (rb *RootConfigBuilder) SetShutDown(shutDownConfig *ShutdownConfig) *RootConfigBuilder
- func (rb *RootConfigBuilder) SetShutdown(shutdown *ShutdownConfig) *RootConfigBuilder
- func (rb *RootConfigBuilder) SetTLSConfig(tlsConfig *TLSConfig) *RootConfigBuilder
- type RouterConfig
- type RouterConfigBuilder
- func (rcb *RouterConfigBuilder) AddCondition(condition string) *RouterConfigBuilder
- func (rcb *RouterConfigBuilder) AddTag(tag Tag) *RouterConfigBuilder
- func (rcb *RouterConfigBuilder) Build() *RouterConfig
- func (rcb *RouterConfigBuilder) SetConditions(conditions []string) *RouterConfigBuilder
- func (rcb *RouterConfigBuilder) SetEnabled(enabled bool) *RouterConfigBuilder
- func (rcb *RouterConfigBuilder) SetForce(force bool) *RouterConfigBuilder
- func (rcb *RouterConfigBuilder) SetKey(key string) *RouterConfigBuilder
- func (rcb *RouterConfigBuilder) SetPriority(priority int) *RouterConfigBuilder
- func (rcb *RouterConfigBuilder) SetRuntime(runtime bool) *RouterConfigBuilder
- func (rcb *RouterConfigBuilder) SetScope(scope string) *RouterConfigBuilder
- func (rcb *RouterConfigBuilder) SetTags(tags []Tag) *RouterConfigBuilder
- func (rcb *RouterConfigBuilder) SetValid(valid bool) *RouterConfigBuilder
- type ServiceConfig
- func (s *ServiceConfig) Export() error
- func (s *ServiceConfig) GetExportedUrls() []*common.URL
- func (s *ServiceConfig) Implement(rpcService common.RPCService)
- func (s *ServiceConfig) Init(rc *RootConfig) error
- func (s *ServiceConfig) InitExported()
- func (s *ServiceConfig) IsExport() bool
- func (s *ServiceConfig) Prefix() string
- func (s *ServiceConfig) Unexport()
- type ServiceConfigBuilder
- func (pcb *ServiceConfigBuilder) AddRCProtocol(protocolName string, protocolConfig *ProtocolConfig) *ServiceConfigBuilder
- func (pcb *ServiceConfigBuilder) AddRCRegistry(registryName string, registryConfig *RegistryConfig) *ServiceConfigBuilder
- func (pcb *ServiceConfigBuilder) Build() *ServiceConfig
- func (pcb *ServiceConfigBuilder) SetCluster(cluster string) *ServiceConfigBuilder
- func (pcb *ServiceConfigBuilder) SetGroup(group string) *ServiceConfigBuilder
- func (pcb *ServiceConfigBuilder) SetInterface(interfaceName string) *ServiceConfigBuilder
- func (pcb *ServiceConfigBuilder) SetLoadBalancce(lb string) *ServiceConfigBuilder
- func (pcb *ServiceConfigBuilder) SetMetadataType(setMetadataType string) *ServiceConfigBuilder
- func (pcb *ServiceConfigBuilder) SetNotRegister(notRegister bool) *ServiceConfigBuilder
- func (pcb *ServiceConfigBuilder) SetProtocolIDs(protocolIDs ...string) *ServiceConfigBuilder
- func (pcb *ServiceConfigBuilder) SetProxyFactoryKey(proxyFactoryKey string) *ServiceConfigBuilder
- func (pcb *ServiceConfigBuilder) SetRPCService(service common.RPCService) *ServiceConfigBuilder
- func (pcb *ServiceConfigBuilder) SetRegistryIDs(registryIDs ...string) *ServiceConfigBuilder
- func (pcb *ServiceConfigBuilder) SetSerialization(serialization string) *ServiceConfigBuilder
- func (pcb *ServiceConfigBuilder) SetServiceID(id string) *ServiceConfigBuilder
- func (pcb *ServiceConfigBuilder) SetVersion(version string) *ServiceConfigBuilder
- func (pcb *ServiceConfigBuilder) SetWarmUpTie(warmUp string) *ServiceConfigBuilder
- type ServiceDiscoveryConfig
- type ServiceDiscoveryConfigBuilder
- func (sdcb *ServiceDiscoveryConfigBuilder) Build() *ServiceDiscoveryConfig
- func (sdcb *ServiceDiscoveryConfigBuilder) SetGroup(group string) *ServiceDiscoveryConfigBuilder
- func (sdcb *ServiceDiscoveryConfigBuilder) SetProtocol(protocol string) *ServiceDiscoveryConfigBuilder
- func (sdcb *ServiceDiscoveryConfigBuilder) SetRemoteRef(remoteRef string) *ServiceDiscoveryConfigBuilder
- type Setter
- type ShutdownConfig
- func (config *ShutdownConfig) GetConsumerUpdateWaitTime() time.Duration
- func (config *ShutdownConfig) GetInternalSignal() bool
- func (config *ShutdownConfig) GetOfflineRequestWindowTimeout() time.Duration
- func (config *ShutdownConfig) GetStepTimeout() time.Duration
- func (config *ShutdownConfig) GetTimeout() time.Duration
- func (config *ShutdownConfig) Init() error
- func (config *ShutdownConfig) Prefix() string
- type ShutdownConfigBuilder
- func (scb *ShutdownConfigBuilder) Build() *ShutdownConfig
- func (scb *ShutdownConfigBuilder) SetInternalSignal(internalSignal bool) *ShutdownConfigBuilder
- func (scb *ShutdownConfigBuilder) SetOfflineRequestWindowTimeout(offlineRequestWindowTimeout string) *ShutdownConfigBuilder
- func (scb *ShutdownConfigBuilder) SetRejectRequest(rejectRequest bool) *ShutdownConfigBuilder
- func (scb *ShutdownConfigBuilder) SetRejectRequestHandler(rejectRequestHandler string) *ShutdownConfigBuilder
- func (scb *ShutdownConfigBuilder) SetStepTimeout(stepTimeout string) *ShutdownConfigBuilder
- func (scb *ShutdownConfigBuilder) SetTimeout(timeout string) *ShutdownConfigBuilder
- type TLSConfig
- type TLSConfigBuilder
- func (tcb *TLSConfigBuilder) Build() *TLSConfig
- func (tcb *TLSConfigBuilder) SetCACertFile(caCertFile string) *TLSConfigBuilder
- func (tcb *TLSConfigBuilder) SetTLSCertFile(tlsCertFile string) *TLSConfigBuilder
- func (tcb *TLSConfigBuilder) SetTLSKeyFile(tlsKeyFile string) *TLSConfigBuilder
- func (tcb *TLSConfigBuilder) SetTLSServerName(tlsServerName string) *TLSConfigBuilder
- type Tag
- type TracingConfig
Constants ¶
const (
MaxWheelTimeSpan = 900e9 // 900s, 15 minute
)
Variables ¶
var ( // ShutdownSignals receives shutdown signals to process ShutdownSignals = []os.Signal{ os.Interrupt, os.Kill, syscall.SIGKILL, syscall.SIGSTOP, syscall.SIGHUP, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGILL, syscall.SIGTRAP, syscall.SIGABRT, syscall.SIGSYS, syscall.SIGTERM, } // DumpHeapShutdownSignals receives shutdown signals to process DumpHeapShutdownSignals = []os.Signal{ syscall.SIGQUIT, syscall.SIGILL, syscall.SIGTRAP, syscall.SIGABRT, syscall.SIGSYS, } )
Functions ¶
func GetCallback ¶
func GetCallback(name string) func(response common.CallbackResponse)
GetCallback gets CallbackResponse by @name
func GetClientTlsConfig ¶ added in v3.0.4
GetClientTlsConfig build client tls config from TLSConfig
func GetClientTlsConfigBuilder
deprecated
func GetClientTlsConfigBuilder() getty.TlsConfigBuilder
Deprecated: use TLSConfig instead.
func GetConfigResolver ¶
GetConfigResolver get config resolver
func GetConsumerService ¶
func GetConsumerService(name string) common.RPCService
GetConsumerService gets ConsumerService by @name
func GetConsumerServiceByInterfaceName ¶
func GetConsumerServiceByInterfaceName(interfaceName string) common.RPCService
GetConsumerServiceByInterfaceName is used by pb serialization
func GetConsumerServiceMap ¶ added in v3.0.2
func GetConsumerServiceMap() map[string]common.RPCService
GetConsumerServiceMap gets ProviderServiceMap
func GetDefineValue ¶
func GetDefineValue(key string, default_value interface{}) interface{}
func GetProtocolsInstance ¶
func GetProtocolsInstance() map[string]*ProtocolConfig
func GetProviderService ¶
func GetProviderService(name string) common.RPCService
GetProviderService gets ProviderService by @name
func GetProviderServiceMap ¶ added in v3.0.2
func GetProviderServiceMap() map[string]common.RPCService
GetProviderServiceMap gets ProviderServiceMap
func GetRPCService ¶
func GetRPCService(name string) common.RPCService
GetRPCService get rpc service for consumer
func GetServerTlsConfig ¶ added in v3.0.4
GetServerTlsConfig build server tls config from TLSConfig
func GetServerTlsConfigBuilder
deprecated
func GetServerTlsConfigBuilder() getty.TlsConfigBuilder
Deprecated: use TLSConfig instead.
func IsProvider ¶
func IsProvider() bool
func Load ¶
func Load(opts ...LoaderConfOption) error
func NewLoaderConf ¶
func NewLoaderConf(opts ...LoaderConfOption) *loaderConf
func RPCService ¶
func RPCService(service common.RPCService)
RPCService create rpc service for consumer
func SetClientTlsConfigBuilder
deprecated
func SetClientTlsConfigBuilder(configBuilder getty.TlsConfigBuilder)
Deprecated: use TLSConfig instead.
func SetConsumerConfig ¶
func SetConsumerConfig(c ConsumerConfig)
SetConsumerConfig sets consumerConfig by @c
func SetConsumerService ¶
func SetConsumerService(service common.RPCService)
SetConsumerService is called by init() of implement of RPCService
func SetConsumerServiceByInterfaceName ¶
func SetConsumerServiceByInterfaceName(interfaceName string, srv common.RPCService)
SetConsumerServiceByInterfaceName is used by pb serialization
func SetProviderService ¶
func SetProviderService(service common.RPCService)
SetProviderService is called by init() of implement of RPCService
func SetRootConfig ¶
func SetRootConfig(r RootConfig)
func SetServerTlsConfigBuilder
deprecated
func SetServerTlsConfigBuilder(configBuilder getty.TlsConfigBuilder)
Deprecated: use TLSConfig instead.
Types ¶
type AggregateConfig ¶ added in v3.1.1
type AggregateConfig struct { Enabled *bool `default:"false" yaml:"enabled" json:"enabled,omitempty" property:"enabled"` BucketNum int `default:"10" yaml:"bucket-num" json:"bucket-num,omitempty" property:"bucket-num"` TimeWindowSeconds int `default:"120" yaml:"time-window-seconds" json:"time-window-seconds,omitempty" property:"time-window-seconds"` }
type ApplicationConfig ¶
type ApplicationConfig struct { Organization string `default:"dubbo-go" yaml:"organization" json:"organization,omitempty" property:"organization"` Name string `default:"dubbo.io" yaml:"name" json:"name,omitempty" property:"name"` Module string `default:"sample" yaml:"module" json:"module,omitempty" property:"module"` Group string `yaml:"group" json:"group,omitempty" property:"module"` Version string `yaml:"version" json:"version,omitempty" property:"version"` Owner string `default:"dubbo-go" yaml:"owner" json:"owner,omitempty" property:"owner"` Environment string `yaml:"environment" json:"environment,omitempty" property:"environment"` // the metadata type. remote or local MetadataType string `default:"local" yaml:"metadata-type" json:"metadataType,omitempty" property:"metadataType"` Tag string `yaml:"tag" json:"tag,omitempty" property:"tag"` MetadataServicePort string `yaml:"metadata-service-port" json:"metadata-service-port,omitempty" property:"metadata-service-port"` }
ApplicationConfig is a configuration for current applicationConfig, whether the applicationConfig is a provider or a consumer
func GetApplicationConfig ¶
func GetApplicationConfig() *ApplicationConfig
func (*ApplicationConfig) Init ¶
func (ac *ApplicationConfig) Init() error
Init application config and set default value
func (*ApplicationConfig) Prefix ¶
func (ac *ApplicationConfig) Prefix() string
Prefix dubbo.application
type ApplicationConfigBuilder ¶
type ApplicationConfigBuilder struct {
// contains filtered or unexported fields
}
func NewApplicationConfigBuilder ¶
func NewApplicationConfigBuilder() *ApplicationConfigBuilder
func (*ApplicationConfigBuilder) Build ¶
func (acb *ApplicationConfigBuilder) Build() *ApplicationConfig
func (*ApplicationConfigBuilder) SetEnvironment ¶
func (acb *ApplicationConfigBuilder) SetEnvironment(environment string) *ApplicationConfigBuilder
func (*ApplicationConfigBuilder) SetMetadataType ¶
func (acb *ApplicationConfigBuilder) SetMetadataType(metadataType string) *ApplicationConfigBuilder
func (*ApplicationConfigBuilder) SetModule ¶
func (acb *ApplicationConfigBuilder) SetModule(module string) *ApplicationConfigBuilder
func (*ApplicationConfigBuilder) SetName ¶
func (acb *ApplicationConfigBuilder) SetName(name string) *ApplicationConfigBuilder
func (*ApplicationConfigBuilder) SetOrganization ¶
func (acb *ApplicationConfigBuilder) SetOrganization(organization string) *ApplicationConfigBuilder
func (*ApplicationConfigBuilder) SetOwner ¶
func (acb *ApplicationConfigBuilder) SetOwner(owner string) *ApplicationConfigBuilder
func (*ApplicationConfigBuilder) SetVersion ¶
func (acb *ApplicationConfigBuilder) SetVersion(version string) *ApplicationConfigBuilder
type CenterConfig ¶
type CenterConfig struct { Protocol string `validate:"required" yaml:"protocol" json:"protocol,omitempty"` Address string `validate:"required" yaml:"address" json:"address,omitempty"` DataId string `yaml:"data-id" json:"data-id,omitempty"` Cluster string `yaml:"cluster" json:"cluster,omitempty"` Group string `yaml:"group" json:"group,omitempty"` Username string `yaml:"username" json:"username,omitempty"` Password string `yaml:"password" json:"password,omitempty"` Namespace string `yaml:"namespace" json:"namespace,omitempty"` AppID string `default:"dubbo" yaml:"app-id" json:"app-id,omitempty"` Timeout string `default:"10s" yaml:"timeout" json:"timeout,omitempty"` Params map[string]string `yaml:"params" json:"parameters,omitempty"` //FileExtension the suffix of config dataId, also the file extension of config content FileExtension string `default:"yaml" yaml:"file-extension" json:"file-extension" ` }
CenterConfig is configuration for config center
ConfigCenter also introduced concepts of namespace and group to better manage Key-Value pairs by group, those configs are already built-in in many professional third-party configuration centers. In most cases, namespace is used to isolate different tenants, while group is used to divide the key set from one tenant into groups.
CenterConfig has currently supported Zookeeper, Nacos, Etcd, Consul, Apollo
func (*CenterConfig) CreateDynamicConfiguration ¶
func (c *CenterConfig) CreateDynamicConfiguration() (config_center.DynamicConfiguration, error)
func (*CenterConfig) GetDynamicConfiguration ¶
func (c *CenterConfig) GetDynamicConfiguration() (config_center.DynamicConfiguration, error)
func (*CenterConfig) GetUrlMap ¶
func (c *CenterConfig) GetUrlMap() url.Values
GetUrlMap gets url map from ConfigCenterConfig
func (*CenterConfig) Init ¶
func (c *CenterConfig) Init(rc *RootConfig) error
type ConfigCenterConfigBuilder ¶
type ConfigCenterConfigBuilder struct {
// contains filtered or unexported fields
}
func NewConfigCenterConfigBuilder ¶
func NewConfigCenterConfigBuilder() *ConfigCenterConfigBuilder
func (*ConfigCenterConfigBuilder) Build ¶
func (ccb *ConfigCenterConfigBuilder) Build() *CenterConfig
func (*ConfigCenterConfigBuilder) SetAddress ¶
func (ccb *ConfigCenterConfigBuilder) SetAddress(address string) *ConfigCenterConfigBuilder
func (*ConfigCenterConfigBuilder) SetDataID ¶
func (ccb *ConfigCenterConfigBuilder) SetDataID(dataID string) *ConfigCenterConfigBuilder
func (*ConfigCenterConfigBuilder) SetGroup ¶
func (ccb *ConfigCenterConfigBuilder) SetGroup(group string) *ConfigCenterConfigBuilder
func (*ConfigCenterConfigBuilder) SetNamespace ¶
func (ccb *ConfigCenterConfigBuilder) SetNamespace(namespace string) *ConfigCenterConfigBuilder
func (*ConfigCenterConfigBuilder) SetPassword ¶
func (ccb *ConfigCenterConfigBuilder) SetPassword(password string) *ConfigCenterConfigBuilder
func (*ConfigCenterConfigBuilder) SetProtocol ¶
func (ccb *ConfigCenterConfigBuilder) SetProtocol(protocol string) *ConfigCenterConfigBuilder
func (*ConfigCenterConfigBuilder) SetUserName ¶
func (ccb *ConfigCenterConfigBuilder) SetUserName(userName string) *ConfigCenterConfigBuilder
type ConsumerConfig ¶
type ConsumerConfig struct { Filter string `yaml:"filter" json:"filter,omitempty" property:"filter"` RegistryIDs []string `yaml:"registry-ids" json:"registry-ids,omitempty" property:"registry-ids"` Protocol string `yaml:"protocol" json:"protocol,omitempty" property:"protocol"` RequestTimeout string `default:"3s" yaml:"request-timeout" json:"request-timeout,omitempty" property:"request-timeout"` ProxyFactory string `default:"default" yaml:"proxy" json:"proxy,omitempty" property:"proxy"` Check bool `yaml:"check" json:"check,omitempty" property:"check"` AdaptiveService bool `default:"false" yaml:"adaptive-service" json:"adaptive-service" property:"adaptive-service"` References map[string]*ReferenceConfig `yaml:"references" json:"references,omitempty" property:"references"` TracingKey string `yaml:"tracing-key" json:"tracing-key" property:"tracing-key"` FilterConf interface{} `yaml:"filter-conf" json:"filter-conf,omitempty" property:"filter-conf"` MaxWaitTimeForServiceDiscovery string `` /* 155-byte string literal not displayed */ MeshEnabled bool `yaml:"mesh-enabled" json:"mesh-enabled,omitempty" property:"mesh-enabled"` // contains filtered or unexported fields }
ConsumerConfig is Consumer default configuration
func GetConsumerConfig ¶
func GetConsumerConfig() *ConsumerConfig
func (*ConsumerConfig) DynamicUpdateProperties ¶ added in v3.0.2
func (cc *ConsumerConfig) DynamicUpdateProperties(newConsumerConfig *ConsumerConfig)
DynamicUpdateProperties dynamically update properties.
func (*ConsumerConfig) Init ¶
func (cc *ConsumerConfig) Init(rc *RootConfig) error
func (*ConsumerConfig) Load ¶
func (cc *ConsumerConfig) Load()
type ConsumerConfigBuilder ¶
type ConsumerConfigBuilder struct {
// contains filtered or unexported fields
}
func NewConsumerConfigBuilder ¶
func NewConsumerConfigBuilder() *ConsumerConfigBuilder
func (*ConsumerConfigBuilder) AddReference ¶
func (ccb *ConsumerConfigBuilder) AddReference(referenceKey string, referenceConfig *ReferenceConfig) *ConsumerConfigBuilder
func (*ConsumerConfigBuilder) Build ¶
func (ccb *ConsumerConfigBuilder) Build() *ConsumerConfig
func (*ConsumerConfigBuilder) SetCheck ¶
func (ccb *ConsumerConfigBuilder) SetCheck(check bool) *ConsumerConfigBuilder
func (*ConsumerConfigBuilder) SetFilter ¶
func (ccb *ConsumerConfigBuilder) SetFilter(filter string) *ConsumerConfigBuilder
func (*ConsumerConfigBuilder) SetFilterConf ¶
func (ccb *ConsumerConfigBuilder) SetFilterConf(filterConf interface{}) *ConsumerConfigBuilder
func (*ConsumerConfigBuilder) SetMaxWaitTimeForServiceDiscovery ¶
func (ccb *ConsumerConfigBuilder) SetMaxWaitTimeForServiceDiscovery(maxWaitTimeForServiceDiscovery string) *ConsumerConfigBuilder
func (*ConsumerConfigBuilder) SetMeshEnabled ¶ added in v3.1.0
func (ccb *ConsumerConfigBuilder) SetMeshEnabled(meshEnabled bool) *ConsumerConfigBuilder
func (*ConsumerConfigBuilder) SetProxyFactory ¶
func (ccb *ConsumerConfigBuilder) SetProxyFactory(proxyFactory string) *ConsumerConfigBuilder
func (*ConsumerConfigBuilder) SetReferences ¶
func (ccb *ConsumerConfigBuilder) SetReferences(references map[string]*ReferenceConfig) *ConsumerConfigBuilder
func (*ConsumerConfigBuilder) SetRegistryIDs ¶
func (ccb *ConsumerConfigBuilder) SetRegistryIDs(RegistryIDs ...string) *ConsumerConfigBuilder
func (*ConsumerConfigBuilder) SetRequestTimeout ¶
func (ccb *ConsumerConfigBuilder) SetRequestTimeout(requestTimeout string) *ConsumerConfigBuilder
func (*ConsumerConfigBuilder) SetRootConfig ¶
func (ccb *ConsumerConfigBuilder) SetRootConfig(rootConfig *RootConfig) *ConsumerConfigBuilder
type CustomConfig ¶
type CustomConfig struct {
ConfigMap map[string]interface{} `yaml:"config-map" json:"config-map,omitempty" property:"config-map"`
}
func (*CustomConfig) GetDefineValue ¶
func (c *CustomConfig) GetDefineValue(key string, default_value interface{}) interface{}
func (*CustomConfig) Init ¶
func (c *CustomConfig) Init() error
func (*CustomConfig) Prefix ¶
func (*CustomConfig) Prefix() string
type CustomConfigBuilder ¶
type CustomConfigBuilder struct {
// contains filtered or unexported fields
}
func NewCustomConfigBuilder ¶
func NewCustomConfigBuilder() *CustomConfigBuilder
func (*CustomConfigBuilder) Build ¶
func (ccb *CustomConfigBuilder) Build() *CustomConfig
func (*CustomConfigBuilder) SetDefineConfig ¶
func (ccb *CustomConfigBuilder) SetDefineConfig(key string, val interface{}) *CustomConfigBuilder
type Exporter ¶ added in v3.1.1
type Exporter struct {
Enabled *bool `default:"true" yaml:"enabled" json:"enabled,omitempty" property:"enabled"`
}
type File ¶ added in v3.1.0
type File struct { // log file name default dubbo.log Name string `default:"dubbo.log" yaml:"name"` // log max size default 100Mb MaxSize int `default:"100" yaml:"max-size"` // log max backups default 5 MaxBackups int `default:"5" yaml:"max-backups"` // log file max age default 3 day MaxAge int `default:"3" yaml:"max-age"` Compress *bool `default:"true" yaml:"compress"` }
type LoaderConfOption ¶
type LoaderConfOption interface {
// contains filtered or unexported methods
}
func WithDelim ¶
func WithDelim(delim string) LoaderConfOption
func WithGenre ¶
func WithGenre(suffix string) LoaderConfOption
WithGenre set load config file suffix Deprecated: replaced by WithSuffix
func WithRootConfig ¶
func WithRootConfig(rc *RootConfig) LoaderConfOption
func WithSuffix ¶
func WithSuffix(suffix file.Suffix) LoaderConfOption
WithSuffix set load config file suffix
type LoggerConfig ¶
type LoggerConfig struct { // logger driver default zap Driver string `default:"zap" yaml:"driver"` // logger level Level string `default:"info" yaml:"level"` // logger formatter default text Format string `default:"text" yaml:"format"` // supports simultaneous file and console eg: console,file default console Appender string `default:"console" yaml:"appender"` // logger file File *File `yaml:"file"` }
func (*LoggerConfig) DynamicUpdateProperties ¶ added in v3.0.5
func (l *LoggerConfig) DynamicUpdateProperties(new *LoggerConfig)
DynamicUpdateProperties dynamically update properties.
func (*LoggerConfig) Init ¶
func (l *LoggerConfig) Init() error
type LoggerConfigBuilder ¶
type LoggerConfigBuilder struct {
// contains filtered or unexported fields
}
func NewLoggerConfigBuilder ¶
func NewLoggerConfigBuilder() *LoggerConfigBuilder
func (*LoggerConfigBuilder) Build ¶
func (lcb *LoggerConfigBuilder) Build() *LoggerConfig
Build return config and set default value if nil
func (*LoggerConfigBuilder) SetAppender ¶ added in v3.1.0
func (lcb *LoggerConfigBuilder) SetAppender(appender string) *LoggerConfigBuilder
func (*LoggerConfigBuilder) SetDriver ¶ added in v3.1.0
func (lcb *LoggerConfigBuilder) SetDriver(driver string) *LoggerConfigBuilder
func (*LoggerConfigBuilder) SetFileCompress ¶ added in v3.1.0
func (lcb *LoggerConfigBuilder) SetFileCompress(compress bool) *LoggerConfigBuilder
func (*LoggerConfigBuilder) SetFileMaxAge ¶ added in v3.1.0
func (lcb *LoggerConfigBuilder) SetFileMaxAge(maxAge int) *LoggerConfigBuilder
func (*LoggerConfigBuilder) SetFileMaxBackups ¶ added in v3.1.0
func (lcb *LoggerConfigBuilder) SetFileMaxBackups(maxBackups int) *LoggerConfigBuilder
func (*LoggerConfigBuilder) SetFileMaxSize ¶ added in v3.1.0
func (lcb *LoggerConfigBuilder) SetFileMaxSize(maxSize int) *LoggerConfigBuilder
func (*LoggerConfigBuilder) SetFileName ¶ added in v3.1.0
func (lcb *LoggerConfigBuilder) SetFileName(name string) *LoggerConfigBuilder
func (*LoggerConfigBuilder) SetFormat ¶ added in v3.1.0
func (lcb *LoggerConfigBuilder) SetFormat(format string) *LoggerConfigBuilder
func (*LoggerConfigBuilder) SetLevel ¶ added in v3.1.0
func (lcb *LoggerConfigBuilder) SetLevel(level string) *LoggerConfigBuilder
type MetadataReportConfig ¶
type MetadataReportConfig struct { Protocol string `required:"true" yaml:"protocol" json:"protocol,omitempty"` Address string `required:"true" yaml:"address" json:"address"` Username string `yaml:"username" json:"username,omitempty"` Password string `yaml:"password" json:"password,omitempty"` Timeout string `yaml:"timeout" json:"timeout,omitempty"` Group string `yaml:"group" json:"group,omitempty"` Namespace string `yaml:"namespace" json:"namespace,omitempty"` // contains filtered or unexported fields }
MetadataReportConfig is app level configuration
func GetMetadataReportConfg ¶
func GetMetadataReportConfg() *MetadataReportConfig
func (*MetadataReportConfig) Init ¶
func (mc *MetadataReportConfig) Init(rc *RootConfig) error
func (*MetadataReportConfig) IsValid ¶
func (mc *MetadataReportConfig) IsValid() bool
func (MetadataReportConfig) Prefix ¶
func (MetadataReportConfig) Prefix() string
Prefix dubbo.consumer
func (*MetadataReportConfig) StartMetadataReport ¶
func (mc *MetadataReportConfig) StartMetadataReport() error
StartMetadataReport The entry of metadata report start
type MetadataReportConfigBuilder ¶
type MetadataReportConfigBuilder struct {
// contains filtered or unexported fields
}
func NewMetadataReportConfigBuilder ¶
func NewMetadataReportConfigBuilder() *MetadataReportConfigBuilder
func (*MetadataReportConfigBuilder) Build ¶
func (mrcb *MetadataReportConfigBuilder) Build() *MetadataReportConfig
func (*MetadataReportConfigBuilder) SetAddress ¶
func (mrcb *MetadataReportConfigBuilder) SetAddress(address string) *MetadataReportConfigBuilder
func (*MetadataReportConfigBuilder) SetGroup ¶
func (mrcb *MetadataReportConfigBuilder) SetGroup(group string) *MetadataReportConfigBuilder
func (*MetadataReportConfigBuilder) SetPassword ¶
func (mrcb *MetadataReportConfigBuilder) SetPassword(password string) *MetadataReportConfigBuilder
func (*MetadataReportConfigBuilder) SetProtocol ¶
func (mrcb *MetadataReportConfigBuilder) SetProtocol(protocol string) *MetadataReportConfigBuilder
func (*MetadataReportConfigBuilder) SetTimeout ¶
func (mrcb *MetadataReportConfigBuilder) SetTimeout(timeout string) *MetadataReportConfigBuilder
func (*MetadataReportConfigBuilder) SetUsername ¶
func (mrcb *MetadataReportConfigBuilder) SetUsername(username string) *MetadataReportConfigBuilder
type MethodConfig ¶
type MethodConfig struct { InterfaceId string InterfaceName string Name string `yaml:"name" json:"name,omitempty" property:"name"` Retries string `yaml:"retries" json:"retries,omitempty" property:"retries"` LoadBalance string `yaml:"loadbalance" json:"loadbalance,omitempty" property:"loadbalance"` Weight int64 `yaml:"weight" json:"weight,omitempty" property:"weight"` TpsLimitInterval string `yaml:"tps.limit.interval" json:"tps.limit.interval,omitempty" property:"tps.limit.interval"` TpsLimitRate string `yaml:"tps.limit.rate" json:"tps.limit.rate,omitempty" property:"tps.limit.rate"` TpsLimitStrategy string `yaml:"tps.limit.strategy" json:"tps.limit.strategy,omitempty" property:"tps.limit.strategy"` ExecuteLimit string `yaml:"execute.limit" json:"execute.limit,omitempty" property:"execute.limit"` ExecuteLimitRejectedHandler string `` /* 127-byte string literal not displayed */ Sticky bool `yaml:"sticky" json:"sticky,omitempty" property:"sticky"` RequestTimeout string `yaml:"timeout" json:"timeout,omitempty" property:"timeout"` }
MethodConfig defines method config
func (*MethodConfig) Init ¶
func (m *MethodConfig) Init() error
type MetricConfig ¶
type MetricConfig struct { Enable *bool `default:"false" yaml:"enable" json:"enable,omitempty" property:"enable"` Port string `default:"9090" yaml:"port" json:"port,omitempty" property:"port"` Path string `default:"/metrics" yaml:"path" json:"path,omitempty" property:"path"` Protocol string `default:"prometheus" yaml:"protocol" json:"protocol,omitempty" property:"protocol"` EnableMetadata *bool `default:"false" yaml:"enable-metadata" json:"enable-metadata,omitempty" property:"enable-metadata"` EnableRegistry *bool `default:"false" yaml:"enable-registry" json:"enable-registry,omitempty" property:"enable-registry"` EnableConfigCenter *bool `default:"false" yaml:"enable-config-center" json:"enable-config-center,omitempty" property:"enable-config-center"` Prometheus *PrometheusConfig `yaml:"prometheus" json:"prometheus" property:"prometheus"` Aggregation *AggregateConfig `yaml:"aggregation" json:"aggregation" property:"aggregation"` // contains filtered or unexported fields }
MetricConfig This is the config struct for all metrics implementation
func GetMetricConfig ¶
func GetMetricConfig() *MetricConfig
GetMetricConfig find the MetricConfig if it is nil, create a new one we use double-check to reduce race condition In general, it will be locked 0 or 1 time. So you don't need to worry about the race condition
func (*MetricConfig) DynamicUpdateProperties ¶ added in v3.0.5
func (mc *MetricConfig) DynamicUpdateProperties(newMetricConfig *MetricConfig)
DynamicUpdateProperties dynamically update properties.
func (*MetricConfig) Init ¶
func (mc *MetricConfig) Init(rc *RootConfig) error
func (*MetricConfig) ToReporterConfig ¶
func (mc *MetricConfig) ToReporterConfig() *metrics.ReporterConfig
type MetricConfigBuilder ¶
type MetricConfigBuilder struct {
// contains filtered or unexported fields
}
func NewMetricConfigBuilder ¶
func NewMetricConfigBuilder() *MetricConfigBuilder
func (*MetricConfigBuilder) Build ¶
func (mcb *MetricConfigBuilder) Build() *MetricConfig
func (*MetricConfigBuilder) SetConfigCenterEnabled ¶ added in v3.1.1
func (mcb *MetricConfigBuilder) SetConfigCenterEnabled(enabled bool) *MetricConfigBuilder
func (*MetricConfigBuilder) SetMetadataEnabled ¶ added in v3.1.1
func (mcb *MetricConfigBuilder) SetMetadataEnabled(enabled bool) *MetricConfigBuilder
func (*MetricConfigBuilder) SetRegistryEnabled ¶ added in v3.1.1
func (mcb *MetricConfigBuilder) SetRegistryEnabled(enabled bool) *MetricConfigBuilder
type MockService ¶
type MockService struct{}
MockService mocks the rpc service for test
func (*MockService) GetUser ¶
func (*MockService) GetUser(ctx context.Context, itf []interface{}, str *struct{}) error
GetUser mocks the GetUser method
func (*MockService) GetUser1 ¶
func (*MockService) GetUser1(ctx context.Context, itf []interface{}, str *struct{}) error
GetUser1 mocks the GetUser1 method
func (*MockService) Reference ¶
func (*MockService) Reference() string
Reference mocks the Reference method
type OtelConfig ¶ added in v3.1.1
type OtelConfig struct {
TraceConfig *OtelTraceConfig `yaml:"trace" json:"trace,omitempty" property:"trace"`
}
func (*OtelConfig) Init ¶ added in v3.1.1
func (oc *OtelConfig) Init(appConfig *ApplicationConfig) error
type OtelConfigBuilder ¶ added in v3.1.1
type OtelConfigBuilder struct {
// contains filtered or unexported fields
}
func NewOtelConfigBuilder ¶ added in v3.1.1
func NewOtelConfigBuilder() *OtelConfigBuilder
func (*OtelConfigBuilder) Build ¶ added in v3.1.1
func (ocb *OtelConfigBuilder) Build() *OtelConfig
type OtelTraceConfig ¶ added in v3.1.1
type OtelTraceConfig struct { Enable *bool `default:"false" yaml:"enable" json:"enable,omitempty" property:"enable"` Exporter string `default:"stdout" yaml:"exporter" json:"exporter,omitempty" property:"exporter"` // stdout, jaeger, zipkin, otlp-http, otlp-grpc Endpoint string `default:"" yaml:"endpoint" json:"endpoint,omitempty" property:"endpoint"` Propagator string `default:"w3c" yaml:"propagator" json:"propagator,omitempty" property:"propagator"` // one of w3c(standard), b3(for zipkin), SampleMode string `default:"ratio" yaml:"sample-mode" json:"sample-mode,omitempty" property:"sample-mode"` // one of always, never, ratio SampleRatio float64 `default:"0.5" yaml:"sample-ratio" json:"sample-ratio,omitempty" property:"sample-ratio"` // [0.0, 1.0] }
type ProfilesConfig ¶ added in v3.0.2
type ProfilesConfig struct { // active profiles Active string }
func (ProfilesConfig) Prefix ¶ added in v3.0.2
func (ProfilesConfig) Prefix() string
Prefix dubbo.profiles
type PrometheusConfig ¶ added in v3.1.1
type PrometheusConfig struct { Exporter *Exporter `yaml:"exporter" json:"exporter,omitempty" property:"exporter"` Pushgateway *PushgatewayConfig `yaml:"pushgateway" json:"pushgateway,omitempty" property:"pushgateway"` }
type ProtocolConfig ¶
type ProtocolConfig struct { Name string `default:"dubbo" validate:"required" yaml:"name" json:"name,omitempty" property:"name"` Ip string `yaml:"ip" json:"ip,omitempty" property:"ip"` Port string `default:"20000" yaml:"port" json:"port,omitempty" property:"port"` Params interface{} `yaml:"params" json:"params,omitempty" property:"params"` // MaxServerSendMsgSize max size of server send message, 1mb=1000kb=1000000b 1mib=1024kb=1048576b. // more detail to see https://pkg.go.dev/github.com/dustin/go-humanize#pkg-constants MaxServerSendMsgSize string `yaml:"max-server-send-msg-size" json:"max-server-send-msg-size,omitempty"` // MaxServerRecvMsgSize max size of server receive message MaxServerRecvMsgSize string `default:"4mib" yaml:"max-server-recv-msg-size" json:"max-server-recv-msg-size,omitempty"` }
ProtocolConfig is protocol configuration
func (*ProtocolConfig) Init ¶
func (p *ProtocolConfig) Init() error
type ProtocolConfigBuilder ¶
type ProtocolConfigBuilder struct {
// contains filtered or unexported fields
}
func NewProtocolConfigBuilder ¶
func NewProtocolConfigBuilder() *ProtocolConfigBuilder
func (*ProtocolConfigBuilder) Build ¶
func (pcb *ProtocolConfigBuilder) Build() *ProtocolConfig
func (*ProtocolConfigBuilder) SetIp ¶
func (pcb *ProtocolConfigBuilder) SetIp(ip string) *ProtocolConfigBuilder
func (*ProtocolConfigBuilder) SetMaxServerRecvMsgSize ¶ added in v3.1.0
func (pcb *ProtocolConfigBuilder) SetMaxServerRecvMsgSize(maxServerRecvMsgSize string) *ProtocolConfigBuilder
func (*ProtocolConfigBuilder) SetMaxServerSendMsgSize ¶ added in v3.1.0
func (pcb *ProtocolConfigBuilder) SetMaxServerSendMsgSize(maxServerSendMsgSize string) *ProtocolConfigBuilder
func (*ProtocolConfigBuilder) SetName ¶
func (pcb *ProtocolConfigBuilder) SetName(name string) *ProtocolConfigBuilder
func (*ProtocolConfigBuilder) SetParams ¶
func (pcb *ProtocolConfigBuilder) SetParams(params interface{}) *ProtocolConfigBuilder
func (*ProtocolConfigBuilder) SetPort ¶
func (pcb *ProtocolConfigBuilder) SetPort(port string) *ProtocolConfigBuilder
type ProviderConfig ¶
type ProviderConfig struct { Filter string `yaml:"filter" json:"filter,omitempty" property:"filter"` // Deprecated Register whether registration is required Register bool `yaml:"register" json:"register" property:"register"` // RegistryIDs is registry ids list RegistryIDs []string `yaml:"registry-ids" json:"registry-ids" property:"registry-ids"` // protocol ProtocolIDs []string `yaml:"protocol-ids" json:"protocol-ids" property:"protocol-ids"` // TracingKey is tracing ids list TracingKey string `yaml:"tracing-key" json:"tracing-key" property:"tracing-key"` // Services services Services map[string]*ServiceConfig `yaml:"services" json:"services,omitempty" property:"services"` ProxyFactory string `default:"default" yaml:"proxy" json:"proxy,omitempty" property:"proxy"` FilterConf interface{} `yaml:"filter_conf" json:"filter_conf,omitempty" property:"filter_conf"` ConfigType map[string]string `yaml:"config_type" json:"config_type,omitempty" property:"config_type"` // adaptive service AdaptiveService bool `yaml:"adaptive-service" json:"adaptive-service" property:"adaptive-service"` AdaptiveServiceVerbose bool `yaml:"adaptive-service-verbose" json:"adaptive-service-verbose" property:"adaptive-service-verbose"` // contains filtered or unexported fields }
ProviderConfig is the default configuration of service provider
func GetProviderConfig ¶
func GetProviderConfig() *ProviderConfig
func (*ProviderConfig) Init ¶
func (c *ProviderConfig) Init(rc *RootConfig) error
func (*ProviderConfig) Load ¶
func (c *ProviderConfig) Load()
func (ProviderConfig) Prefix ¶
func (ProviderConfig) Prefix() string
type ProviderConfigBuilder ¶
type ProviderConfigBuilder struct {
// contains filtered or unexported fields
}
func NewProviderConfigBuilder ¶
func NewProviderConfigBuilder() *ProviderConfigBuilder
func (*ProviderConfigBuilder) AddConfigType ¶
func (pcb *ProviderConfigBuilder) AddConfigType(key, value string) *ProviderConfigBuilder
func (*ProviderConfigBuilder) AddService ¶
func (pcb *ProviderConfigBuilder) AddService(serviceID string, serviceConfig *ServiceConfig) *ProviderConfigBuilder
func (*ProviderConfigBuilder) Build ¶
func (pcb *ProviderConfigBuilder) Build() *ProviderConfig
func (*ProviderConfigBuilder) SetConfigType ¶
func (pcb *ProviderConfigBuilder) SetConfigType(configType map[string]string) *ProviderConfigBuilder
func (*ProviderConfigBuilder) SetFilter ¶
func (pcb *ProviderConfigBuilder) SetFilter(filter string) *ProviderConfigBuilder
func (*ProviderConfigBuilder) SetFilterConf ¶
func (pcb *ProviderConfigBuilder) SetFilterConf(filterConf interface{}) *ProviderConfigBuilder
func (*ProviderConfigBuilder) SetProxyFactory ¶
func (pcb *ProviderConfigBuilder) SetProxyFactory(proxyFactory string) *ProviderConfigBuilder
func (*ProviderConfigBuilder) SetRegister ¶
func (pcb *ProviderConfigBuilder) SetRegister(register bool) *ProviderConfigBuilder
func (*ProviderConfigBuilder) SetRegistryIDs ¶
func (pcb *ProviderConfigBuilder) SetRegistryIDs(RegistryIDs ...string) *ProviderConfigBuilder
func (*ProviderConfigBuilder) SetRootConfig ¶
func (pcb *ProviderConfigBuilder) SetRootConfig(rootConfig *RootConfig) *ProviderConfigBuilder
func (*ProviderConfigBuilder) SetServices ¶
func (pcb *ProviderConfigBuilder) SetServices(services map[string]*ServiceConfig) *ProviderConfigBuilder
type PushgatewayConfig ¶ added in v3.1.1
type PushgatewayConfig struct { Enabled *bool `default:"false" yaml:"enabled" json:"enabled,omitempty" property:"enabled"` BaseUrl string `default:"" yaml:"base-url" json:"base-url,omitempty" property:"base-url"` Job string `default:"default_dubbo_job" yaml:"job" json:"job,omitempty" property:"job"` Username string `default:"" yaml:"username" json:"username,omitempty" property:"username"` Password string `default:"" yaml:"password" json:"password,omitempty" property:"password"` PushInterval int `default:"30" yaml:"push-interval" json:"push-interval,omitempty" property:"push-interval"` }
type ReferenceConfig ¶
type ReferenceConfig struct { InterfaceName string `yaml:"interface" json:"interface,omitempty" property:"interface"` Check *bool `yaml:"check" json:"check,omitempty" property:"check"` URL string `yaml:"url" json:"url,omitempty" property:"url"` Filter string `yaml:"filter" json:"filter,omitempty" property:"filter"` Protocol string `yaml:"protocol" json:"protocol,omitempty" property:"protocol"` RegistryIDs []string `yaml:"registry-ids" json:"registry-ids,omitempty" property:"registry-ids"` Cluster string `yaml:"cluster" json:"cluster,omitempty" property:"cluster"` Loadbalance string `yaml:"loadbalance" json:"loadbalance,omitempty" property:"loadbalance"` Retries string `yaml:"retries" json:"retries,omitempty" property:"retries"` Group string `yaml:"group" json:"group,omitempty" property:"group"` Version string `yaml:"version" json:"version,omitempty" property:"version"` Serialization string `yaml:"serialization" json:"serialization" property:"serialization"` ProvidedBy string `yaml:"provided_by" json:"provided_by,omitempty" property:"provided_by"` Methods []*MethodConfig `yaml:"methods" json:"methods,omitempty" property:"methods"` Async bool `yaml:"async" json:"async,omitempty" property:"async"` Params map[string]string `yaml:"params" json:"params,omitempty" property:"params"` Generic string `yaml:"generic" json:"generic,omitempty" property:"generic"` Sticky bool `yaml:"sticky" json:"sticky,omitempty" property:"sticky"` RequestTimeout string `yaml:"timeout" json:"timeout,omitempty" property:"timeout"` ForceTag bool `yaml:"force.tag" json:"force.tag,omitempty" property:"force.tag"` TracingKey string `yaml:"tracing-key" json:"tracing-key,omitempty" propertiy:"tracing-key"` MeshProviderPort int `yaml:"mesh-provider-port" json:"mesh-provider-port,omitempty" propertiy:"mesh-provider-port"` // contains filtered or unexported fields }
ReferenceConfig is the configuration of service consumer
func (*ReferenceConfig) GenericLoad ¶
func (rc *ReferenceConfig) GenericLoad(id string)
GenericLoad ...
func (*ReferenceConfig) GetInvoker ¶
func (rc *ReferenceConfig) GetInvoker() protocol.Invoker
GetInvoker get invoker from ReferenceConfig
func (*ReferenceConfig) GetProxy ¶
func (rc *ReferenceConfig) GetProxy() *proxy.Proxy
GetProxy gets proxy
func (*ReferenceConfig) GetRPCService ¶
func (rc *ReferenceConfig) GetRPCService() common.RPCService
GetRPCService gets RPCService from proxy
func (*ReferenceConfig) Implement ¶
func (rc *ReferenceConfig) Implement(v common.RPCService)
Implement @v is service provider implemented RPCService
func (*ReferenceConfig) Init ¶
func (rc *ReferenceConfig) Init(root *RootConfig) error
func (*ReferenceConfig) Prefix ¶
func (rc *ReferenceConfig) Prefix() string
func (*ReferenceConfig) Refer ¶
func (rc *ReferenceConfig) Refer(srv interface{})
Refer retrieves invokers from urls.
type ReferenceConfigBuilder ¶
type ReferenceConfigBuilder struct {
// contains filtered or unexported fields
}
func NewReferenceConfigBuilder ¶
func NewReferenceConfigBuilder() *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) AddMethodConfig ¶ added in v3.0.4
func (pcb *ReferenceConfigBuilder) AddMethodConfig(methodConfig *MethodConfig) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) Build ¶
func (pcb *ReferenceConfigBuilder) Build() *ReferenceConfig
func (*ReferenceConfigBuilder) SetAsync ¶ added in v3.0.4
func (pcb *ReferenceConfigBuilder) SetAsync(async bool) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetCluster ¶
func (pcb *ReferenceConfigBuilder) SetCluster(cluster string) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetFilter ¶ added in v3.0.4
func (pcb *ReferenceConfigBuilder) SetFilter(filter string) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetForceTag ¶ added in v3.0.4
func (pcb *ReferenceConfigBuilder) SetForceTag(forceTag bool) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetGeneric ¶
func (pcb *ReferenceConfigBuilder) SetGeneric(generic bool) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetGroup ¶ added in v3.0.4
func (pcb *ReferenceConfigBuilder) SetGroup(group string) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetInterface ¶
func (pcb *ReferenceConfigBuilder) SetInterface(interfaceName string) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetLoadbalance ¶ added in v3.0.4
func (pcb *ReferenceConfigBuilder) SetLoadbalance(loadbalance string) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetMethodConfig ¶ added in v3.0.4
func (pcb *ReferenceConfigBuilder) SetMethodConfig(methodConfigs []*MethodConfig) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetParams ¶ added in v3.0.4
func (pcb *ReferenceConfigBuilder) SetParams(params map[string]string) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetProtocol ¶
func (pcb *ReferenceConfigBuilder) SetProtocol(protocol string) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetProvidedBy ¶ added in v3.0.4
func (pcb *ReferenceConfigBuilder) SetProvidedBy(providedBy string) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetRegistryIDs ¶
func (pcb *ReferenceConfigBuilder) SetRegistryIDs(registryIDs ...string) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetRequestTimeout ¶ added in v3.0.4
func (pcb *ReferenceConfigBuilder) SetRequestTimeout(requestTimeout string) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetRetries ¶ added in v3.0.4
func (pcb *ReferenceConfigBuilder) SetRetries(retries string) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetSerialization ¶
func (pcb *ReferenceConfigBuilder) SetSerialization(serialization string) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetSticky ¶ added in v3.0.4
func (pcb *ReferenceConfigBuilder) SetSticky(sticky bool) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetTracingKey ¶ added in v3.0.4
func (pcb *ReferenceConfigBuilder) SetTracingKey(tracingKey string) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetURL ¶ added in v3.0.2
func (pcb *ReferenceConfigBuilder) SetURL(url string) *ReferenceConfigBuilder
func (*ReferenceConfigBuilder) SetVersion ¶ added in v3.0.4
func (pcb *ReferenceConfigBuilder) SetVersion(version string) *ReferenceConfigBuilder
type RegistryConfig ¶
type RegistryConfig struct { Protocol string `validate:"required" yaml:"protocol" json:"protocol,omitempty" property:"protocol"` Timeout string `default:"5s" validate:"required" yaml:"timeout" json:"timeout,omitempty" property:"timeout"` // unit: second Group string `yaml:"group" json:"group,omitempty" property:"group"` Namespace string `yaml:"namespace" json:"namespace,omitempty" property:"namespace"` TTL string `default:"15m" yaml:"ttl" json:"ttl,omitempty" property:"ttl"` // unit: minute Address string `validate:"required" yaml:"address" json:"address,omitempty" property:"address"` Username string `yaml:"username" json:"username,omitempty" property:"username"` Password string `yaml:"password" json:"password,omitempty" property:"password"` Simplified bool `yaml:"simplified" json:"simplified,omitempty" property:"simplified"` Preferred bool `yaml:"preferred" json:"preferred,omitempty" property:"preferred"` // Always use this registry first if set to true, useful when subscribe to multiple registriesConfig Zone string `yaml:"zone" json:"zone,omitempty" property:"zone"` // The region where the registry belongs, usually used to isolate traffics Weight int64 `yaml:"weight" json:"weight,omitempty" property:"weight"` // Affects traffic distribution among registriesConfig, useful when subscribe to multiple registriesConfig Take effect only when no preferred registry is specified. Params map[string]string `yaml:"params" json:"params,omitempty" property:"params"` RegistryType string `yaml:"registry-type"` UseAsMetaReport bool `default:"true" yaml:"use-as-meta-report" json:"use-as-meta-report,omitempty" property:"use-as-meta-report"` UseAsConfigCenter bool `default:"true" yaml:"use-as-config-center" json:"use-as-config-center,omitempty" property:"use-as-config-center"` }
RegistryConfig is the configuration of the registry center
func NewRegistryConfig ¶
func NewRegistryConfig(opts ...RegistryConfigOpt) *RegistryConfig
NewRegistryConfig creates New RegistryConfig with @opts
func NewRegistryConfigWithProtocolDefaultPort ¶
func NewRegistryConfigWithProtocolDefaultPort(protocol string) *RegistryConfig
NewRegistryConfigWithProtocolDefaultPort New default registry config the input @protocol can only be: "zookeeper" with default addr "127.0.0.1:2181" "nacos" with default addr "127.0.0.1:8848"
func (*RegistryConfig) DynamicUpdateProperties ¶ added in v3.0.2
func (c *RegistryConfig) DynamicUpdateProperties(updateRegistryConfig *RegistryConfig)
DynamicUpdateProperties update registry
func (*RegistryConfig) GetInstance ¶
func (*RegistryConfig) Init ¶
func (c *RegistryConfig) Init() error
type RegistryConfigBuilder ¶
type RegistryConfigBuilder struct {
// contains filtered or unexported fields
}
func NewRegistryConfigBuilder ¶
func NewRegistryConfigBuilder() *RegistryConfigBuilder
func (*RegistryConfigBuilder) AddParam ¶ added in v3.0.2
func (rcb *RegistryConfigBuilder) AddParam(key, value string) *RegistryConfigBuilder
func (*RegistryConfigBuilder) Build ¶
func (rcb *RegistryConfigBuilder) Build() *RegistryConfig
func (*RegistryConfigBuilder) SetAddress ¶
func (rcb *RegistryConfigBuilder) SetAddress(address string) *RegistryConfigBuilder
func (*RegistryConfigBuilder) SetGroup ¶
func (rcb *RegistryConfigBuilder) SetGroup(group string) *RegistryConfigBuilder
func (*RegistryConfigBuilder) SetNamespace ¶
func (rcb *RegistryConfigBuilder) SetNamespace(namespace string) *RegistryConfigBuilder
func (*RegistryConfigBuilder) SetParams ¶
func (rcb *RegistryConfigBuilder) SetParams(params map[string]string) *RegistryConfigBuilder
func (*RegistryConfigBuilder) SetPassword ¶
func (rcb *RegistryConfigBuilder) SetPassword(password string) *RegistryConfigBuilder
func (*RegistryConfigBuilder) SetPreferred ¶
func (rcb *RegistryConfigBuilder) SetPreferred(preferred bool) *RegistryConfigBuilder
func (*RegistryConfigBuilder) SetProtocol ¶
func (rcb *RegistryConfigBuilder) SetProtocol(protocol string) *RegistryConfigBuilder
func (*RegistryConfigBuilder) SetRegistryType ¶
func (rcb *RegistryConfigBuilder) SetRegistryType(registryType string) *RegistryConfigBuilder
func (*RegistryConfigBuilder) SetSimplified ¶
func (rcb *RegistryConfigBuilder) SetSimplified(simplified bool) *RegistryConfigBuilder
func (*RegistryConfigBuilder) SetTTL ¶
func (rcb *RegistryConfigBuilder) SetTTL(ttl string) *RegistryConfigBuilder
func (*RegistryConfigBuilder) SetTimeout ¶
func (rcb *RegistryConfigBuilder) SetTimeout(timeout string) *RegistryConfigBuilder
func (*RegistryConfigBuilder) SetUsername ¶
func (rcb *RegistryConfigBuilder) SetUsername(username string) *RegistryConfigBuilder
func (*RegistryConfigBuilder) SetWeight ¶
func (rcb *RegistryConfigBuilder) SetWeight(weight int64) *RegistryConfigBuilder
func (*RegistryConfigBuilder) SetZone ¶
func (rcb *RegistryConfigBuilder) SetZone(zone string) *RegistryConfigBuilder
type RegistryConfigOpt ¶
type RegistryConfigOpt func(config *RegistryConfig) *RegistryConfig
func WithRegistryAddress ¶
func WithRegistryAddress(addr string) RegistryConfigOpt
WithRegistryAddress returns RegistryConfigOpt with given @addr registry address
func WithRegistryGroup ¶
func WithRegistryGroup(group string) RegistryConfigOpt
WithRegistryGroup returns RegistryConfigOpt with given @group registry group
func WithRegistryParams ¶
func WithRegistryParams(params map[string]string) RegistryConfigOpt
WithRegistryParams returns RegistryConfigOpt with given registry @params
func WithRegistryPassword ¶
func WithRegistryPassword(psw string) RegistryConfigOpt
WithRegistryPassword returns RegistryConfigOpt with given @psw registry password
func WithRegistryPreferred ¶
func WithRegistryPreferred(preferred bool) RegistryConfigOpt
WithRegistryPreferred returns RegistryConfig with given @preferred registry preferred flag
func WithRegistryProtocol ¶
func WithRegistryProtocol(regProtocol string) RegistryConfigOpt
WithRegistryProtocol returns RegistryConfigOpt with given @regProtocol name
func WithRegistrySimplified ¶
func WithRegistrySimplified(simplified bool) RegistryConfigOpt
WithRegistrySimplified returns RegistryConfigOpt with given @simplified registry simplified flag
func WithRegistryTTL ¶
func WithRegistryTTL(ttl string) RegistryConfigOpt
WithRegistryTTL returns RegistryConfigOpt with given @ttl registry ttl
func WithRegistryTimeOut ¶
func WithRegistryTimeOut(timeout string) RegistryConfigOpt
WithRegistryTimeOut returns RegistryConfigOpt with given @timeout registry config
func WithRegistryUserName ¶
func WithRegistryUserName(userName string) RegistryConfigOpt
WithRegistryUserName returns RegistryConfigOpt with given @userName registry userName
func WithRegistryWeight ¶
func WithRegistryWeight(weight int64) RegistryConfigOpt
WithRegistryWeight returns RegistryConfigOpt with given @weight registry weight flag
type RemoteConfig ¶
type RemoteConfig struct { Protocol string `yaml:"protocol" json:"protocol,omitempty" property:"protocol"` Address string `yaml:"address" json:"address,omitempty" property:"address"` Timeout string `default:"5s" yaml:"timeout" json:"timeout,omitempty" property:"timeout"` Username string `yaml:"username" json:"username,omitempty" property:"username"` Password string `yaml:"password" json:"password,omitempty" property:"password"` Params map[string]string `yaml:"params" json:"params,omitempty"` }
RemoteConfig usually we need some middleware, including nacos, zookeeper this represents an instance of this middleware so that other module, like config center, registry could reuse the config but now, only metadata report, metadata service, service discovery use this structure
func (*RemoteConfig) GetParam ¶
func (rc *RemoteConfig) GetParam(key string, def string) string
GetParam will return the value of the key. If not found, def will be return; def => default value
func (*RemoteConfig) GetTimeout ¶
func (rc *RemoteConfig) GetTimeout() time.Duration
GetTimeout return timeout duration. if the configure is invalid, or missing, the default value 5s will be returned
func (*RemoteConfig) Init ¶
func (rc *RemoteConfig) Init() error
type RemoteConfigBuilder ¶
type RemoteConfigBuilder struct {
// contains filtered or unexported fields
}
func NewRemoteConfigBuilder ¶
func NewRemoteConfigBuilder() *RemoteConfigBuilder
func (*RemoteConfigBuilder) AddParam ¶
func (rcb *RemoteConfigBuilder) AddParam(key, value string) *RemoteConfigBuilder
func (*RemoteConfigBuilder) Build ¶
func (rcb *RemoteConfigBuilder) Build() *RemoteConfig
func (*RemoteConfigBuilder) SetAddress ¶
func (rcb *RemoteConfigBuilder) SetAddress(address string) *RemoteConfigBuilder
func (*RemoteConfigBuilder) SetParams ¶
func (rcb *RemoteConfigBuilder) SetParams(params map[string]string) *RemoteConfigBuilder
func (*RemoteConfigBuilder) SetPassword ¶
func (rcb *RemoteConfigBuilder) SetPassword(password string) *RemoteConfigBuilder
func (*RemoteConfigBuilder) SetProtocol ¶
func (rcb *RemoteConfigBuilder) SetProtocol(protocol string) *RemoteConfigBuilder
func (*RemoteConfigBuilder) SetTimeout ¶
func (rcb *RemoteConfigBuilder) SetTimeout(timeout string) *RemoteConfigBuilder
func (*RemoteConfigBuilder) SetUsername ¶
func (rcb *RemoteConfigBuilder) SetUsername(username string) *RemoteConfigBuilder
type RootConfig ¶
type RootConfig struct { Application *ApplicationConfig `validate:"required" yaml:"application" json:"application,omitempty" property:"application"` Protocols map[string]*ProtocolConfig `validate:"required" yaml:"protocols" json:"protocols" property:"protocols"` Registries map[string]*RegistryConfig `yaml:"registries" json:"registries" property:"registries"` ConfigCenter *CenterConfig `yaml:"config-center" json:"config-center,omitempty"` MetadataReport *MetadataReportConfig `yaml:"metadata-report" json:"metadata-report,omitempty" property:"metadata-report"` Provider *ProviderConfig `yaml:"provider" json:"provider" property:"provider"` Consumer *ConsumerConfig `yaml:"consumer" json:"consumer" property:"consumer"` Otel *OtelConfig `yaml:"otel" json:"otel,omitempty" property:"otel"` Metric *MetricConfig `yaml:"metrics" json:"metrics,omitempty" property:"metrics"` Tracing map[string]*TracingConfig `yaml:"tracing" json:"tracing,omitempty" property:"tracing"` Logger *LoggerConfig `yaml:"logger" json:"logger,omitempty" property:"logger"` Shutdown *ShutdownConfig `yaml:"shutdown" json:"shutdown,omitempty" property:"shutdown"` Router []*RouterConfig `yaml:"router" json:"router,omitempty" property:"router"` EventDispatcherType string `default:"direct" yaml:"event-dispatcher-type" json:"event-dispatcher-type,omitempty"` CacheFile string `yaml:"cache_file" json:"cache_file,omitempty" property:"cache_file"` Custom *CustomConfig `yaml:"custom" json:"custom,omitempty" property:"custom"` Profiles *ProfilesConfig `yaml:"profiles" json:"profiles,omitempty" property:"profiles"` TLSConfig *TLSConfig `yaml:"tls_config" json:"tls_config,omitempty" property:"tls_config"` }
RootConfig is the root config
func GetRootConfig ¶
func GetRootConfig() *RootConfig
func (*RootConfig) Init ¶
func (rc *RootConfig) Init() error
Init is to start dubbo-go framework, load local configuration, or read configuration from config-center if necessary. It's deprecated for user to call rootConfig.Init() manually, try config.Load(config.WithRootConfig(rootConfig)) instead.
func (*RootConfig) Process ¶ added in v3.0.1
func (rc *RootConfig) Process(event *config_center.ConfigChangeEvent)
Process receive changing listener's event, dynamic update config
func (*RootConfig) Start ¶
func (rc *RootConfig) Start()
type RootConfigBuilder ¶
type RootConfigBuilder struct {
// contains filtered or unexported fields
}
func NewRootConfigBuilder ¶
func NewRootConfigBuilder() *RootConfigBuilder
func (*RootConfigBuilder) AddProtocol ¶
func (rb *RootConfigBuilder) AddProtocol(protocolID string, protocolConfig *ProtocolConfig) *RootConfigBuilder
func (*RootConfigBuilder) AddRegistry ¶
func (rb *RootConfigBuilder) AddRegistry(registryID string, registryConfig *RegistryConfig) *RootConfigBuilder
func (*RootConfigBuilder) Build ¶
func (rb *RootConfigBuilder) Build() *RootConfig
func (*RootConfigBuilder) SetApplication ¶
func (rb *RootConfigBuilder) SetApplication(application *ApplicationConfig) *RootConfigBuilder
func (*RootConfigBuilder) SetCacheFile ¶
func (rb *RootConfigBuilder) SetCacheFile(cacheFile string) *RootConfigBuilder
func (*RootConfigBuilder) SetConfigCenter ¶
func (rb *RootConfigBuilder) SetConfigCenter(configCenterConfig *CenterConfig) *RootConfigBuilder
func (*RootConfigBuilder) SetConsumer ¶
func (rb *RootConfigBuilder) SetConsumer(consumer *ConsumerConfig) *RootConfigBuilder
func (*RootConfigBuilder) SetCustom ¶
func (rb *RootConfigBuilder) SetCustom(customConfig *CustomConfig) *RootConfigBuilder
func (*RootConfigBuilder) SetEventDispatcherType ¶
func (rb *RootConfigBuilder) SetEventDispatcherType(eventDispatcherType string) *RootConfigBuilder
func (*RootConfigBuilder) SetLogger ¶
func (rb *RootConfigBuilder) SetLogger(logger *LoggerConfig) *RootConfigBuilder
func (*RootConfigBuilder) SetMetadataReport ¶
func (rb *RootConfigBuilder) SetMetadataReport(metadataReport *MetadataReportConfig) *RootConfigBuilder
func (*RootConfigBuilder) SetMetric ¶
func (rb *RootConfigBuilder) SetMetric(metric *MetricConfig) *RootConfigBuilder
func (*RootConfigBuilder) SetOtel ¶ added in v3.1.1
func (rb *RootConfigBuilder) SetOtel(otel *OtelConfig) *RootConfigBuilder
func (*RootConfigBuilder) SetProtocols ¶
func (rb *RootConfigBuilder) SetProtocols(protocols map[string]*ProtocolConfig) *RootConfigBuilder
func (*RootConfigBuilder) SetProvider ¶
func (rb *RootConfigBuilder) SetProvider(provider *ProviderConfig) *RootConfigBuilder
func (*RootConfigBuilder) SetRegistries ¶
func (rb *RootConfigBuilder) SetRegistries(registries map[string]*RegistryConfig) *RootConfigBuilder
func (*RootConfigBuilder) SetRouter ¶
func (rb *RootConfigBuilder) SetRouter(router []*RouterConfig) *RootConfigBuilder
func (*RootConfigBuilder) SetShutDown ¶ added in v3.0.1
func (rb *RootConfigBuilder) SetShutDown(shutDownConfig *ShutdownConfig) *RootConfigBuilder
func (*RootConfigBuilder) SetShutdown ¶
func (rb *RootConfigBuilder) SetShutdown(shutdown *ShutdownConfig) *RootConfigBuilder
func (*RootConfigBuilder) SetTLSConfig ¶ added in v3.1.0
func (rb *RootConfigBuilder) SetTLSConfig(tlsConfig *TLSConfig) *RootConfigBuilder
type RouterConfig ¶
type RouterConfig struct { Scope string `validate:"required" yaml:"scope" json:"scope,omitempty" property:"scope"` // must be chosen from `service` and `application`. Key string `validate:"required" yaml:"key" json:"key,omitempty" property:"key"` // specifies which service or application the rule body acts on. Force *bool `default:"false" yaml:"force" json:"force,omitempty" property:"force"` Runtime *bool `default:"false" yaml:"runtime" json:"runtime,omitempty" property:"runtime"` Enabled *bool `default:"true" yaml:"enabled" json:"enabled,omitempty" property:"enabled"` Valid *bool `default:"true" yaml:"valid" json:"valid,omitempty" property:"valid"` Priority int `default:"0" yaml:"priority" json:"priority,omitempty" property:"priority"` Conditions []string `yaml:"conditions" json:"conditions,omitempty" property:"conditions"` Tags []Tag `yaml:"tags" json:"tags,omitempty" property:"tags"` }
RouterConfig is the configuration of the router.
func (*RouterConfig) Init ¶
func (c *RouterConfig) Init() error
type RouterConfigBuilder ¶
type RouterConfigBuilder struct {
// contains filtered or unexported fields
}
func NewRouterConfigBuilder ¶
func NewRouterConfigBuilder() *RouterConfigBuilder
func (*RouterConfigBuilder) AddCondition ¶
func (rcb *RouterConfigBuilder) AddCondition(condition string) *RouterConfigBuilder
func (*RouterConfigBuilder) AddTag ¶
func (rcb *RouterConfigBuilder) AddTag(tag Tag) *RouterConfigBuilder
func (*RouterConfigBuilder) Build ¶
func (rcb *RouterConfigBuilder) Build() *RouterConfig
func (*RouterConfigBuilder) SetConditions ¶
func (rcb *RouterConfigBuilder) SetConditions(conditions []string) *RouterConfigBuilder
func (*RouterConfigBuilder) SetEnabled ¶ added in v3.0.2
func (rcb *RouterConfigBuilder) SetEnabled(enabled bool) *RouterConfigBuilder
func (*RouterConfigBuilder) SetForce ¶
func (rcb *RouterConfigBuilder) SetForce(force bool) *RouterConfigBuilder
func (*RouterConfigBuilder) SetKey ¶
func (rcb *RouterConfigBuilder) SetKey(key string) *RouterConfigBuilder
func (*RouterConfigBuilder) SetPriority ¶
func (rcb *RouterConfigBuilder) SetPriority(priority int) *RouterConfigBuilder
func (*RouterConfigBuilder) SetRuntime ¶
func (rcb *RouterConfigBuilder) SetRuntime(runtime bool) *RouterConfigBuilder
func (*RouterConfigBuilder) SetScope ¶
func (rcb *RouterConfigBuilder) SetScope(scope string) *RouterConfigBuilder
func (*RouterConfigBuilder) SetTags ¶
func (rcb *RouterConfigBuilder) SetTags(tags []Tag) *RouterConfigBuilder
func (*RouterConfigBuilder) SetValid ¶
func (rcb *RouterConfigBuilder) SetValid(valid bool) *RouterConfigBuilder
type ServiceConfig ¶
type ServiceConfig struct { Filter string `yaml:"filter" json:"filter,omitempty" property:"filter"` ProtocolIDs []string `yaml:"protocol-ids" json:"protocol-ids,omitempty" property:"protocol-ids"` // multi protocolIDs support, split by ',' Interface string `yaml:"interface" json:"interface,omitempty" property:"interface"` RegistryIDs []string `yaml:"registry-ids" json:"registry-ids,omitempty" property:"registry-ids"` Cluster string `default:"failover" yaml:"cluster" json:"cluster,omitempty" property:"cluster"` Loadbalance string `default:"random" yaml:"loadbalance" json:"loadbalance,omitempty" property:"loadbalance"` Group string `yaml:"group" json:"group,omitempty" property:"group"` Version string `yaml:"version" json:"version,omitempty" property:"version" ` Methods []*MethodConfig `yaml:"methods" json:"methods,omitempty" property:"methods"` Warmup string `yaml:"warmup" json:"warmup,omitempty" property:"warmup"` Retries string `yaml:"retries" json:"retries,omitempty" property:"retries"` Serialization string `yaml:"serialization" json:"serialization" property:"serialization"` Params map[string]string `yaml:"params" json:"params,omitempty" property:"params"` Token string `yaml:"token" json:"token,omitempty" property:"token"` AccessLog string `yaml:"accesslog" json:"accesslog,omitempty" property:"accesslog"` TpsLimiter string `yaml:"tps.limiter" json:"tps.limiter,omitempty" property:"tps.limiter"` TpsLimitInterval string `yaml:"tps.limit.interval" json:"tps.limit.interval,omitempty" property:"tps.limit.interval"` TpsLimitRate string `yaml:"tps.limit.rate" json:"tps.limit.rate,omitempty" property:"tps.limit.rate"` TpsLimitStrategy string `yaml:"tps.limit.strategy" json:"tps.limit.strategy,omitempty" property:"tps.limit.strategy"` TpsLimitRejectedHandler string `yaml:"tps.limit.rejected.handler" json:"tps.limit.rejected.handler,omitempty" property:"tps.limit.rejected.handler"` ExecuteLimit string `yaml:"execute.limit" json:"execute.limit,omitempty" property:"execute.limit"` ExecuteLimitRejectedHandler string `` /* 127-byte string literal not displayed */ Auth string `yaml:"auth" json:"auth,omitempty" property:"auth"` NotRegister bool `yaml:"not_register" json:"not_register,omitempty" property:"not_register"` ParamSign string `yaml:"param.sign" json:"param.sign,omitempty" property:"param.sign"` Tag string `yaml:"tag" json:"tag,omitempty" property:"tag"` TracingKey string `yaml:"tracing-key" json:"tracing-key,omitempty" propertiy:"tracing-key"` RCProtocolsMap map[string]*ProtocolConfig RCRegistriesMap map[string]*RegistryConfig ProxyFactoryKey string // contains filtered or unexported fields }
ServiceConfig is the configuration of the service provider
func (*ServiceConfig) GetExportedUrls ¶
func (s *ServiceConfig) GetExportedUrls() []*common.URL
GetExportedUrls will return the url in service config's exporter
func (*ServiceConfig) Implement ¶
func (s *ServiceConfig) Implement(rpcService common.RPCService)
Implement only store the @s and return
func (*ServiceConfig) Init ¶
func (s *ServiceConfig) Init(rc *RootConfig) error
func (*ServiceConfig) InitExported ¶
func (s *ServiceConfig) InitExported()
InitExported will set exported as false atom bool
func (*ServiceConfig) IsExport ¶
func (s *ServiceConfig) IsExport() bool
IsExport will return whether the service config is exported or not
func (*ServiceConfig) Prefix ¶
func (s *ServiceConfig) Prefix() string
Prefix returns dubbo.service.${InterfaceName}.
func (*ServiceConfig) Unexport ¶
func (s *ServiceConfig) Unexport()
Unexport will call unexport of all exporters service config exported
type ServiceConfigBuilder ¶
type ServiceConfigBuilder struct {
// contains filtered or unexported fields
}
func NewServiceConfigBuilder ¶
func NewServiceConfigBuilder() *ServiceConfigBuilder
func (*ServiceConfigBuilder) AddRCProtocol ¶
func (pcb *ServiceConfigBuilder) AddRCProtocol(protocolName string, protocolConfig *ProtocolConfig) *ServiceConfigBuilder
func (*ServiceConfigBuilder) AddRCRegistry ¶
func (pcb *ServiceConfigBuilder) AddRCRegistry(registryName string, registryConfig *RegistryConfig) *ServiceConfigBuilder
func (*ServiceConfigBuilder) Build ¶
func (pcb *ServiceConfigBuilder) Build() *ServiceConfig
func (*ServiceConfigBuilder) SetCluster ¶
func (pcb *ServiceConfigBuilder) SetCluster(cluster string) *ServiceConfigBuilder
func (*ServiceConfigBuilder) SetGroup ¶
func (pcb *ServiceConfigBuilder) SetGroup(group string) *ServiceConfigBuilder
func (*ServiceConfigBuilder) SetInterface ¶
func (pcb *ServiceConfigBuilder) SetInterface(interfaceName string) *ServiceConfigBuilder
func (*ServiceConfigBuilder) SetLoadBalancce ¶
func (pcb *ServiceConfigBuilder) SetLoadBalancce(lb string) *ServiceConfigBuilder
func (*ServiceConfigBuilder) SetMetadataType ¶
func (pcb *ServiceConfigBuilder) SetMetadataType(setMetadataType string) *ServiceConfigBuilder
func (*ServiceConfigBuilder) SetNotRegister ¶ added in v3.0.2
func (pcb *ServiceConfigBuilder) SetNotRegister(notRegister bool) *ServiceConfigBuilder
func (*ServiceConfigBuilder) SetProtocolIDs ¶
func (pcb *ServiceConfigBuilder) SetProtocolIDs(protocolIDs ...string) *ServiceConfigBuilder
func (*ServiceConfigBuilder) SetProxyFactoryKey ¶
func (pcb *ServiceConfigBuilder) SetProxyFactoryKey(proxyFactoryKey string) *ServiceConfigBuilder
func (*ServiceConfigBuilder) SetRPCService ¶
func (pcb *ServiceConfigBuilder) SetRPCService(service common.RPCService) *ServiceConfigBuilder
func (*ServiceConfigBuilder) SetRegistryIDs ¶
func (pcb *ServiceConfigBuilder) SetRegistryIDs(registryIDs ...string) *ServiceConfigBuilder
func (*ServiceConfigBuilder) SetSerialization ¶
func (pcb *ServiceConfigBuilder) SetSerialization(serialization string) *ServiceConfigBuilder
func (*ServiceConfigBuilder) SetServiceID ¶
func (pcb *ServiceConfigBuilder) SetServiceID(id string) *ServiceConfigBuilder
func (*ServiceConfigBuilder) SetVersion ¶
func (pcb *ServiceConfigBuilder) SetVersion(version string) *ServiceConfigBuilder
func (*ServiceConfigBuilder) SetWarmUpTie ¶
func (pcb *ServiceConfigBuilder) SetWarmUpTie(warmUp string) *ServiceConfigBuilder
type ServiceDiscoveryConfig ¶
type ServiceDiscoveryConfig struct { // Protocol indicate which implementation will be used. // for example, if the Protocol is nacos, it means that we will use nacosServiceDiscovery Protocol string `yaml:"protocol" json:"protocol,omitempty" property:"protocol"` // Group, usually you don't need to config this field. // you can use this to do some isolation Group string `yaml:"group" json:"group,omitempty"` // RemoteRef is the reference point to RemoteConfig which will be used to create remotes instances. RemoteRef string `yaml:"remote_ref" json:"remote_ref,omitempty" property:"remote_ref"` }
ServiceDiscoveryConfig will be used to create
func (ServiceDiscoveryConfig) Init ¶
func (ServiceDiscoveryConfig) Init() error
func (ServiceDiscoveryConfig) Prefix ¶
func (ServiceDiscoveryConfig) Prefix() string
type ServiceDiscoveryConfigBuilder ¶
type ServiceDiscoveryConfigBuilder struct {
// contains filtered or unexported fields
}
func NewServiceDiscoveryConfigBuilder ¶
func NewServiceDiscoveryConfigBuilder() *ServiceDiscoveryConfigBuilder
func (*ServiceDiscoveryConfigBuilder) Build ¶
func (sdcb *ServiceDiscoveryConfigBuilder) Build() *ServiceDiscoveryConfig
func (*ServiceDiscoveryConfigBuilder) SetGroup ¶
func (sdcb *ServiceDiscoveryConfigBuilder) SetGroup(group string) *ServiceDiscoveryConfigBuilder
func (*ServiceDiscoveryConfigBuilder) SetProtocol ¶
func (sdcb *ServiceDiscoveryConfigBuilder) SetProtocol(protocol string) *ServiceDiscoveryConfigBuilder
func (*ServiceDiscoveryConfigBuilder) SetRemoteRef ¶
func (sdcb *ServiceDiscoveryConfigBuilder) SetRemoteRef(remoteRef string) *ServiceDiscoveryConfigBuilder
type ShutdownConfig ¶
type ShutdownConfig struct { /* * Total timeout. Even though we don't release all resources, * the applicationConfig will shutdown if the costing time is over this configuration. The unit is ms. * default value is 60 * 1000 ms = 1 minutes * In general, it should be bigger than 3 * StepTimeout. */ Timeout string `default:"60s" yaml:"timeout" json:"timeout,omitempty" property:"timeout"` /* * the timeout on each step. You should evaluate the response time of request * and the time that client noticed that server shutdown. * For example, if your client will received the notification within 10s when you start to close server, * and the 99.9% requests will return response in 2s, so the StepTimeout will be bigger than(10+2) * 1000ms, * maybe (10 + 2*3) * 1000ms is a good choice. */ StepTimeout string `default:"3s" yaml:"step-timeout" json:"step.timeout,omitempty" property:"step.timeout"` /* * ConsumerUpdateWaitTime means when provider is shutting down, after the unregister, time to wait for client to * update invokers. During this time, incoming invocation can be treated normally. */ ConsumerUpdateWaitTime string `default:"3s" yaml:"consumer-update-wait-time" json:"consumerUpdate.waitTIme,omitempty" property:"consumerUpdate.waitTIme"` // when we try to shutdown the applicationConfig, we will reject the new requests. In most cases, you don't need to configure this. RejectRequestHandler string `yaml:"reject-handler" json:"reject-handler,omitempty" property:"reject_handler"` // internal listen kill signal,the default is true. InternalSignal *bool `default:"true" yaml:"internal-signal" json:"internal.signal,omitempty" property:"internal.signal"` // offline request window length OfflineRequestWindowTimeout string `yaml:"offline-request-window-timeout" json:"offlineRequestWindowTimeout,omitempty" property:"offlineRequestWindowTimeout"` // true -> new request will be rejected. RejectRequest atomic.Bool // active invocation ConsumerActiveCount atomic.Int32 ProviderActiveCount atomic.Int32 // provider last received request timestamp ProviderLastReceivedRequestTime atomic.Time }
ShutdownConfig is used as configuration for graceful shutdown
func GetShutDown ¶ added in v3.0.1
func GetShutDown() *ShutdownConfig
func (*ShutdownConfig) GetConsumerUpdateWaitTime ¶ added in v3.0.1
func (config *ShutdownConfig) GetConsumerUpdateWaitTime() time.Duration
func (*ShutdownConfig) GetInternalSignal ¶ added in v3.0.4
func (config *ShutdownConfig) GetInternalSignal() bool
func (*ShutdownConfig) GetOfflineRequestWindowTimeout ¶ added in v3.0.4
func (config *ShutdownConfig) GetOfflineRequestWindowTimeout() time.Duration
func (*ShutdownConfig) GetStepTimeout ¶
func (config *ShutdownConfig) GetStepTimeout() time.Duration
func (*ShutdownConfig) GetTimeout ¶
func (config *ShutdownConfig) GetTimeout() time.Duration
func (*ShutdownConfig) Init ¶ added in v3.0.1
func (config *ShutdownConfig) Init() error
type ShutdownConfigBuilder ¶
type ShutdownConfigBuilder struct {
// contains filtered or unexported fields
}
func NewShutDownConfigBuilder ¶
func NewShutDownConfigBuilder() *ShutdownConfigBuilder
func (*ShutdownConfigBuilder) Build ¶
func (scb *ShutdownConfigBuilder) Build() *ShutdownConfig
func (*ShutdownConfigBuilder) SetInternalSignal ¶ added in v3.0.1
func (scb *ShutdownConfigBuilder) SetInternalSignal(internalSignal bool) *ShutdownConfigBuilder
func (*ShutdownConfigBuilder) SetOfflineRequestWindowTimeout ¶ added in v3.0.4
func (scb *ShutdownConfigBuilder) SetOfflineRequestWindowTimeout(offlineRequestWindowTimeout string) *ShutdownConfigBuilder
func (*ShutdownConfigBuilder) SetRejectRequest ¶
func (scb *ShutdownConfigBuilder) SetRejectRequest(rejectRequest bool) *ShutdownConfigBuilder
func (*ShutdownConfigBuilder) SetRejectRequestHandler ¶
func (scb *ShutdownConfigBuilder) SetRejectRequestHandler(rejectRequestHandler string) *ShutdownConfigBuilder
func (*ShutdownConfigBuilder) SetStepTimeout ¶
func (scb *ShutdownConfigBuilder) SetStepTimeout(stepTimeout string) *ShutdownConfigBuilder
func (*ShutdownConfigBuilder) SetTimeout ¶
func (scb *ShutdownConfigBuilder) SetTimeout(timeout string) *ShutdownConfigBuilder
type TLSConfig ¶ added in v3.0.4
type TLSConfig struct { CACertFile string `yaml:"ca-cert-file" json:"ca-cert-file" property:"ca-cert-file"` TLSCertFile string `yaml:"tls-cert-file" json:"tls-cert-file" property:"tls-cert-file"` TLSKeyFile string `yaml:"tls-key-file" json:"tls-key-file" property:"tls-key-file"` TLSServerName string `yaml:"tls-server-name" json:"tls-server-name" property:"tls-server-name"` }
TLSConfig tls config
func GetTLSConfig ¶ added in v3.1.0
func GetTLSConfig() *TLSConfig
type TLSConfigBuilder ¶ added in v3.1.0
type TLSConfigBuilder struct {
// contains filtered or unexported fields
}
func NewTLSConfigBuilder ¶ added in v3.1.0
func NewTLSConfigBuilder() *TLSConfigBuilder
func (*TLSConfigBuilder) Build ¶ added in v3.1.0
func (tcb *TLSConfigBuilder) Build() *TLSConfig
func (*TLSConfigBuilder) SetCACertFile ¶ added in v3.1.0
func (tcb *TLSConfigBuilder) SetCACertFile(caCertFile string) *TLSConfigBuilder
func (*TLSConfigBuilder) SetTLSCertFile ¶ added in v3.1.0
func (tcb *TLSConfigBuilder) SetTLSCertFile(tlsCertFile string) *TLSConfigBuilder
func (*TLSConfigBuilder) SetTLSKeyFile ¶ added in v3.1.0
func (tcb *TLSConfigBuilder) SetTLSKeyFile(tlsKeyFile string) *TLSConfigBuilder
func (*TLSConfigBuilder) SetTLSServerName ¶ added in v3.1.0
func (tcb *TLSConfigBuilder) SetTLSServerName(tlsServerName string) *TLSConfigBuilder
type Tag ¶
type Tag struct { Name string `yaml:"name" json:"name,omitempty" property:"name"` Match []*common.ParamMatch `yaml:"match" json:"match,omitempty" property:"match"` Addresses []string `yaml:"addresses" json:"addresses,omitempty" property:"addresses"` }
type TracingConfig ¶
type TracingConfig struct { Name string `default:"jaeger" yaml:"name" json:"name,omitempty" property:"name"` // jaeger or zipkin(todo) ServiceName string `yaml:"serviceName" json:"serviceName,omitempty" property:"serviceName"` Address string `yaml:"address" json:"address,omitempty" property:"address"` UseAgent *bool `default:"false" yaml:"use-agent" json:"use-agent,omitempty" property:"use-agent"` }
TracingConfig is the configuration of the tracing.
func GetTracingConfig ¶
func GetTracingConfig(tracingKey string) *TracingConfig
func (*TracingConfig) Init ¶
func (c *TracingConfig) Init() error
Source Files ¶
- application_config.go
- config_center_config.go
- config_loader.go
- config_loader_options.go
- config_resolver.go
- config_setter.go
- config_utils.go
- consumer_config.go
- custom_config.go
- doc.go
- graceful_shutdown.go
- graceful_shutdown_config.go
- graceful_shutdown_signal_linux.go
- logger_config.go
- metadata_report_config.go
- method_config.go
- metric_config.go
- mock_rpcservice.go
- otel_config.go
- profiles_config.go
- protocol_config.go
- provider_config.go
- reference_config.go
- registry_config.go
- remote_config.go
- root_config.go
- router_config.go
- service.go
- service_config.go
- service_discovery_config.go
- ssl_config.go
- tls_config.go
- tracing_config.go