config

package
v3.2.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: Apache-2.0 Imports: 61 Imported by: 131

Documentation

Overview

Package config assembles all Dubbo configurations and works as the entrance of the whole Dubbo process.

Deprecated: This package is for internal use only starting from 3.2.0, users must not depend on this package directly.

Index

Constants

View Source
const (
	MaxWheelTimeSpan = 900e9 // 900s, 15 minute
)

Variables

View Source
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,
	}
)
View Source
var NewInfoInvoker func(url *common.URL, info interface{}, svc common.RPCService) protocol.Invoker

NewInfoInvoker is used to resolve circular dependencies temporarily. source: server/compat.go func compatNewInfoInvoker(url *common.URL, info interface{}, svc common.RPCService) protocol.Invoker

Functions

func BeforeShutdown

func BeforeShutdown()

BeforeShutdown provides processing flow before shutdown

func GetCallback

func GetCallback(name string) func(response common.CallbackResponse)

GetCallback gets CallbackResponse by @name

func GetClientTlsConfig added in v3.0.4

func GetClientTlsConfig(opt *TLSConfig) (*tls.Config, error)

GetClientTlsConfig build client tls config from TLSConfig

func GetClientTlsConfigBuilder deprecated

func GetClientTlsConfigBuilder() getty.TlsConfigBuilder

Deprecated: use TLSConfig instead.

func GetConfigResolver

func GetConfigResolver(conf *loaderConf) *koanf.Koanf

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 GetProviderServiceInfo

func GetProviderServiceInfo(name string) interface{}

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

func GetServerTlsConfig(opt *TLSConfig) (*tls.Config, error)

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 LoadRegistries

func LoadRegistries(registryIds []string, registries map[string]*RegistryConfig, roleType common.RoleType) []*common.URL

func NewLoaderConf

func NewLoaderConf(opts ...LoaderConfOption) *loaderConf

func RPCService

func RPCService(service common.RPCService)

RPCService create rpc service for consumer

func SetClientInfoService

func SetClientInfoService(info interface{}, service common.RPCService)

SetClientInfoService is used by new Triple generated code use interface{} to represent info because config package can not depend on client package. When refactoring work finished, this info should be with *client.ClientInfo type and this function would be implemented. todo(DMWangnima): refactor and implement this function

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 implementation of RPCService

func SetProviderServiceWithInfo

func SetProviderServiceWithInfo(service common.RPCService, info interface{})

SetProviderServiceWithInfo is called by init() of implementation of RPCService

func SetRootConfig

func SetRootConfig(r RootConfig)

func SetServerTlsConfigBuilder deprecated

func SetServerTlsConfigBuilder(configBuilder getty.TlsConfigBuilder)

Deprecated: use TLSConfig instead.

Types

type AffinityAware

type AffinityAware struct {
	Key   string `default:"" yaml:"key" json:"key,omitempty" property:"key"`
	Ratio int32  `default:"0" yaml:"ratio" json:"ratio,omitempty" property:"ratio"`
}

type AffinityRouter

type AffinityRouter 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.
	Runtime       bool          `default:"false" yaml:"runtime" json:"runtime,omitempty" property:"runtime"`
	Enabled       bool          `default:"true" yaml:"enabled" json:"enabled,omitempty" property:"enabled"`
	AffinityAware AffinityAware `yaml:"affinityAware" json:"affinityAware,omitempty" property:"affinityAware"`
}

AffinityRouter -- RouteConfigVersion == v3.1

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 `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 (*ApplicationConfigBuilder) SetEnvironment

func (acb *ApplicationConfigBuilder) SetEnvironment(environment string) *ApplicationConfigBuilder

func (*ApplicationConfigBuilder) SetMetadataType

func (acb *ApplicationConfigBuilder) SetMetadataType(metadataType string) *ApplicationConfigBuilder

func (*ApplicationConfigBuilder) SetModule

func (*ApplicationConfigBuilder) SetName

func (*ApplicationConfigBuilder) SetOrganization

func (acb *ApplicationConfigBuilder) SetOrganization(organization string) *ApplicationConfigBuilder

func (*ApplicationConfigBuilder) SetOwner

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

func (CenterConfig) Prefix

func (CenterConfig) Prefix() string

Prefix dubbo.config-center

type ConditionRouter

type ConditionRouter 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"`
	Conditions []*ConditionRule `yaml:"conditions" json:"conditions,omitempty" property:"conditions"`
}

ConditionRouter -- when RouteConfigVersion == v3.1, decode by this

type ConditionRule

type ConditionRule struct {
	From ConditionRuleFrom `yaml:"from" json:"from,omitempty" property:"from"`
	To   []ConditionRuleTo `yaml:"to" json:"to,omitempty" property:"to"`
}

func (*ConditionRule) Equal

func (x *ConditionRule) Equal(t *ConditionRule) bool

type ConditionRuleDisable

type ConditionRuleDisable struct {
	Match string `yaml:"match" json:"match,omitempty" property:"match"`
}

type ConditionRuleFrom

type ConditionRuleFrom struct {
	Match string `yaml:"match" json:"match,omitempty" property:"match"`
}

type ConditionRuleTo

type ConditionRuleTo struct {
	Match  string `yaml:"match" json:"match,omitempty" property:"match"`
	Weight int    `default:"100" yaml:"weight" json:"weight,omitempty" property:"weight"`
}

type ConfigCenterConfigBuilder

type ConfigCenterConfigBuilder struct {
	// contains filtered or unexported fields
}

func NewConfigCenterConfigBuilder

func NewConfigCenterConfigBuilder() *ConfigCenterConfigBuilder

func (*ConfigCenterConfigBuilder) Build

func (*ConfigCenterConfigBuilder) SetAddress

func (*ConfigCenterConfigBuilder) SetDataID

func (*ConfigCenterConfigBuilder) SetGroup

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()

func (ConsumerConfig) Prefix

func (ConsumerConfig) Prefix() string

Prefix dubbo.consumer

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 WithBytes

func WithBytes(bytes []byte) LoaderConfOption

WithBytes set load config bytes

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 WithPath

func WithPath(path string) LoaderConfOption

WithPath set load config path

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

func (*LoggerConfig) Prefix

func (l *LoggerConfig) Prefix() string

Prefix dubbo.logger

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"`
	Params    map[string]string `yaml:"params"  json:"parameters,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

func (*MetadataReportConfig) ToUrl

func (mc *MetadataReportConfig) ToUrl() (*common.URL, error)

type MetadataReportConfigBuilder

type MetadataReportConfigBuilder struct {
	// contains filtered or unexported fields
}

func NewMetadataReportConfigBuilder

func NewMetadataReportConfigBuilder() *MetadataReportConfigBuilder

func (*MetadataReportConfigBuilder) Build

func (*MetadataReportConfigBuilder) SetAddress

func (*MetadataReportConfigBuilder) SetGroup

func (*MetadataReportConfigBuilder) SetPassword

func (mrcb *MetadataReportConfigBuilder) SetPassword(password string) *MetadataReportConfigBuilder

func (*MetadataReportConfigBuilder) SetProtocol

func (mrcb *MetadataReportConfigBuilder) SetProtocol(protocol string) *MetadataReportConfigBuilder

func (*MetadataReportConfigBuilder) SetTimeout

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

func (*MethodConfig) Prefix

func (m *MethodConfig) Prefix() string

nolint

type MethodOption

type MethodOption func(*MethodOptions)

func WithExecuteLimit

func WithExecuteLimit(limit int) MethodOption

func WithExecuteLimitRejectedHandler

func WithExecuteLimitRejectedHandler(handler string) MethodOption

func WithInterfaceId

func WithInterfaceId(id string) MethodOption

func WithInterfaceName

func WithInterfaceName(name string) MethodOption

func WithLoadBalance

func WithLoadBalance(lb string) MethodOption

func WithName

func WithName(name string) MethodOption

func WithRequestTimeout

func WithRequestTimeout(millSeconds time.Duration) MethodOption

func WithRetries

func WithRetries(retries int) MethodOption

func WithSticky

func WithSticky() MethodOption

func WithTpsLimitInterval

func WithTpsLimitInterval(interval int) MethodOption

func WithTpsLimitRate

func WithTpsLimitRate(rate int) MethodOption

func WithTpsLimitStrategy

func WithTpsLimitStrategy(strategy string) MethodOption

func WithWeight

func WithWeight(weight int64) MethodOption

type MethodOptions

type MethodOptions struct {
	Method *global.MethodConfig
}

func NewMethodOptions

func NewMethodOptions(opts ...MethodOption) *MethodOptions

type MetricConfigBuilder

type MetricConfigBuilder struct {
	// contains filtered or unexported fields
}

func NewMetricConfigBuilder

func NewMetricConfigBuilder() *MetricConfigBuilder

func (*MetricConfigBuilder) Build

func (mcb *MetricConfigBuilder) Build() *MetricsConfig

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 MetricsConfig

type MetricsConfig 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
}

MetricsConfig This is the config struct for all metrics implementation

func GetMetricConfig

func GetMetricConfig() *MetricsConfig

GetMetricConfig find the MetricsConfig 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 (*MetricsConfig) DynamicUpdateProperties

func (mc *MetricsConfig) DynamicUpdateProperties(newMetricConfig *MetricsConfig)

DynamicUpdateProperties dynamically update properties.

func (*MetricsConfig) Init

func (mc *MetricsConfig) Init(rc *RootConfig) error

func (*MetricsConfig) ToReporterConfig

func (mc *MetricsConfig) ToReporterConfig() *metrics.ReporterConfig

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:"tracing" 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:"tri" validate:"required" yaml:"name" json:"name,omitempty" property:"name"`
	Ip     string      `yaml:"ip"  json:"ip,omitempty" property:"ip"`
	Port   string      `default:"50051" 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

func (ProtocolConfig) Prefix

func (ProtocolConfig) Prefix() string

Prefix dubbo.config-center

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 (*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 (*ProtocolConfigBuilder) SetParams

func (pcb *ProtocolConfigBuilder) SetParams(params interface{}) *ProtocolConfigBuilder

func (*ProtocolConfigBuilder) SetPort

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 (*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 (*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 (*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   string            `yaml:"use-as-meta-report" json:"use-as-meta-report,omitempty" property:"use-as-meta-report"`
	UseAsConfigCenter string            `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 (c *RegistryConfig) GetInstance(roleType common.RoleType) (registry.Registry, error)

func (*RegistryConfig) Init

func (c *RegistryConfig) Init() error

func (RegistryConfig) Prefix

func (RegistryConfig) Prefix() string

Prefix dubbo.registries

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 (*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

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

func (*RemoteConfig) Prefix

func (rc *RemoteConfig) Prefix() string

Prefix dubbo.remote.

func (*RemoteConfig) ToURL

func (rc *RemoteConfig) ToURL() (*common.URL, error)

ToURL config to url

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"`
	Metrics             *MetricsConfig             `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) Prefix

func (rc *RootConfig) Prefix() string

Prefix dubbo

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 *MetricsConfig) *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"`
	ScriptType string   `yaml:"type" json:"type,omitempty" property:"type"`
	Script     string   `yaml:"script" json:"script,omitempty" property:"script"`
}

RouterConfig is the configuration of the router.

func (*RouterConfig) Init

func (c *RouterConfig) Init() error

func (RouterConfig) Prefix

func (RouterConfig) Prefix() string

Prefix dubbo.router

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 (*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) Export

func (s *ServiceConfig) Export() error

Export exports the service

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) Prefix

func (ServiceDiscoveryConfig) Prefix() string

type ServiceDiscoveryConfigBuilder

type ServiceDiscoveryConfigBuilder struct {
	// contains filtered or unexported fields
}

func NewServiceDiscoveryConfigBuilder

func NewServiceDiscoveryConfigBuilder() *ServiceDiscoveryConfigBuilder

func (*ServiceDiscoveryConfigBuilder) Build

func (*ServiceDiscoveryConfigBuilder) SetGroup

func (*ServiceDiscoveryConfigBuilder) SetProtocol

func (*ServiceDiscoveryConfigBuilder) SetRemoteRef

type Setter

type Setter interface {
	Set(name string, config interface{})
}

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

func (*ShutdownConfig) Prefix

func (config *ShutdownConfig) Prefix() string

Prefix dubbo.shutdown

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

func (*TLSConfig) Prefix added in v3.1.0

func (t *TLSConfig) Prefix() string

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. Deprecated: It's designed to be replaced with config.OtelConfig

func GetTracingConfig

func GetTracingConfig(tracingKey string) *TracingConfig

func (*TracingConfig) Init

func (c *TracingConfig) Init() error

func (TracingConfig) Prefix

func (TracingConfig) Prefix() string

Prefix dubbo.router

Directories

Path Synopsis
parsers

Jump to

Keyboard shortcuts

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