Documentation
¶
Overview ¶
Package dubbo provides the Go implementation for Dubbo, an RPC and microservice framework.
See dubbo.apache.org for more information about Dubbo.
Index ¶
- func AllowHotReloadContains(substr string)
- func AllowHotReloadExact(key string)
- func AllowHotReloadPrefix(prefix string)
- func CompatGlobalProtocolConfig(c *config.ProtocolConfig) *global.ProtocolConfig
- func CompatGlobalProtocolConfigMap(m map[string]*config.ProtocolConfig) map[string]*global.ProtocolConfig
- func CompatGlobalServiceConfig(c *config.ServiceConfig) *global.ServiceConfig
- func CompatGlobalTLSConfig(c *config.TLSConfig) *global.TLSConfig
- func GetConfigResolver(conf *loaderConf) *koanf.Koanf
- func GetConsumerConnection(interfaceName string) (*client.Connection, error)
- func Load(opts ...LoaderConfOption) error
- func NewLoaderConf(opts ...LoaderConfOption) *loaderConf
- func SetConsumerService(svc common.RPCService)
- func SetConsumerServiceWithInfo(svc common.RPCService, info *client.ClientInfo)
- func SetProviderService(svc common.RPCService)
- func SetProviderServiceWithInfo(svc common.RPCService, info *common.ServiceInfo)
- func StopFileWatcher()
- type Instance
- type InstanceOption
- func WithConfigCenter(opts ...config_center.Option) InstanceOption
- func WithEnvironment(environment string) InstanceOption
- func WithGroup(group string) InstanceOption
- func WithLogger(opts ...logger.Option) InstanceOption
- func WithMetadataReport(opts ...metadata.ReportOption) InstanceOption
- func WithMetadataServicePort(port int) InstanceOption
- func WithMetadataServiceProtocol(protocol string) InstanceOption
- func WithMetrics(opts ...metrics.Option) InstanceOption
- func WithModule(module string) InstanceOption
- func WithName(name string) InstanceOption
- func WithOrganization(organization string) InstanceOption
- func WithOwner(owner string) InstanceOption
- func WithProtocol(opts ...protocol.ServerOption) InstanceOption
- func WithRegistry(opts ...registry.Option) InstanceOption
- func WithRemoteMetadata() InstanceOption
- func WithRouter(opts ...router.Option) InstanceOption
- func WithShutdown(opts ...graceful_shutdown.Option) InstanceOption
- func WithTLS(opts ...tls.Option) InstanceOption
- func WithTag(tag string) InstanceOption
- func WithTracing(opts ...trace.Option) InstanceOption
- func WithVersion(version string) InstanceOption
- type InstanceOptions
- func (rc *InstanceOptions) CloneApplication() *global.ApplicationConfig
- func (rc *InstanceOptions) CloneConfigCenter() *global.CenterConfig
- func (rc *InstanceOptions) CloneConsumer() *global.ConsumerConfig
- func (rc *InstanceOptions) CloneCustom() *global.CustomConfig
- func (rc *InstanceOptions) CloneLogger() *global.LoggerConfig
- func (rc *InstanceOptions) CloneMetadataReport() *global.MetadataReportConfig
- func (rc *InstanceOptions) CloneMetrics() *global.MetricsConfig
- func (rc *InstanceOptions) CloneOtel() *global.OtelConfig
- func (rc *InstanceOptions) CloneProfiles() *global.ProfilesConfig
- func (rc *InstanceOptions) CloneProtocols() map[string]*global.ProtocolConfig
- func (rc *InstanceOptions) CloneProvider() *global.ProviderConfig
- func (rc *InstanceOptions) CloneRegistries() map[string]*global.RegistryConfig
- func (rc *InstanceOptions) CloneRouter() []*global.RouterConfig
- func (rc *InstanceOptions) CloneShutdown() *global.ShutdownConfig
- func (rc *InstanceOptions) CloneTLSConfig() *global.TLSConfig
- func (rc *InstanceOptions) Prefix() string
- type LoaderConfOption
- func WithBytes(bytes []byte) LoaderConfOption
- func WithDelim(delim string) LoaderConfOption
- func WithGenre(suffix string) LoaderConfOption
- func WithInstanceOptions(opts *InstanceOptions) LoaderConfOption
- func WithPath(path string) LoaderConfOption
- func WithSuffix(suffix file.Suffix) LoaderConfOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowHotReloadContains ¶ added in v3.3.1
func AllowHotReloadContains(substr string)
func AllowHotReloadExact ¶ added in v3.3.1
func AllowHotReloadExact(key string)
func AllowHotReloadPrefix ¶ added in v3.3.1
func AllowHotReloadPrefix(prefix string)
func CompatGlobalProtocolConfig ¶ added in v3.3.1
func CompatGlobalProtocolConfig(c *config.ProtocolConfig) *global.ProtocolConfig
func CompatGlobalProtocolConfigMap ¶ added in v3.3.1
func CompatGlobalProtocolConfigMap(m map[string]*config.ProtocolConfig) map[string]*global.ProtocolConfig
func CompatGlobalServiceConfig ¶ added in v3.3.1
func CompatGlobalServiceConfig(c *config.ServiceConfig) *global.ServiceConfig
func CompatGlobalTLSConfig ¶ added in v3.3.1
func GetConfigResolver ¶
GetConfigResolver get config resolver
func GetConsumerConnection ¶ added in v3.3.1
func GetConsumerConnection(interfaceName string) (*client.Connection, error)
func Load ¶
func Load(opts ...LoaderConfOption) error
func NewLoaderConf ¶
func NewLoaderConf(opts ...LoaderConfOption) *loaderConf
func SetConsumerService ¶ added in v3.3.1
func SetConsumerService(svc common.RPCService)
func SetConsumerServiceWithInfo ¶
func SetConsumerServiceWithInfo(svc common.RPCService, info *client.ClientInfo)
SetConsumerServiceWithInfo sets the consumer service with the client information.
func SetProviderService ¶ added in v3.3.1
func SetProviderService(svc common.RPCService)
func SetProviderServiceWithInfo ¶
func SetProviderServiceWithInfo(svc common.RPCService, info *common.ServiceInfo)
SetProviderServiceWithInfo sets the provider service with the server information.
Types ¶
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance is the highest layer conception that user could touch. It is mapped from RootConfig. When users want to inject global configurations and configure common modules for client layer and server layer, user-side code would be like this:
ins, err := NewInstance() cli, err := ins.NewClient()
func NewInstance ¶
func NewInstance(opts ...InstanceOption) (*Instance, error)
NewInstance receives InstanceOption and initializes RootConfig. There are some processing tasks during initialization.
type InstanceOption ¶
type InstanceOption func(*InstanceOptions)
func WithConfigCenter ¶
func WithConfigCenter(opts ...config_center.Option) InstanceOption
func WithEnvironment ¶
func WithEnvironment(environment string) InstanceOption
func WithGroup ¶
func WithGroup(group string) InstanceOption
func WithLogger ¶
func WithLogger(opts ...logger.Option) InstanceOption
func WithMetadataReport ¶
func WithMetadataReport(opts ...metadata.ReportOption) InstanceOption
func WithMetadataServicePort ¶
func WithMetadataServicePort(port int) InstanceOption
func WithMetadataServiceProtocol ¶
func WithMetadataServiceProtocol(protocol string) InstanceOption
func WithMetrics ¶
func WithMetrics(opts ...metrics.Option) InstanceOption
func WithModule ¶
func WithModule(module string) InstanceOption
func WithName ¶
func WithName(name string) InstanceOption
func WithOrganization ¶
func WithOrganization(organization string) InstanceOption
func WithOwner ¶
func WithOwner(owner string) InstanceOption
func WithProtocol ¶
func WithProtocol(opts ...protocol.ServerOption) InstanceOption
TODO: deal this fuction this function I want handle the protocol.Option which both server and client can use together. like:
func WithProtocol(opts ...protocol.Option) InstanceOption {
proOpts := protocol.NewOptions(opts...)
log.Warnf("proOpts: %+v", proOpts)
return func(insOpts *InstanceOptions) {
if insOpts.Protocols == nil {
insOpts.Protocols = make(map[string]*global.ProtocolConfig)
}
insOpts.Protocols[proOpts.ID] = proOpts.Protocol
}
}
but now only work in server side for compat old API.
func WithRegistry ¶
func WithRegistry(opts ...registry.Option) InstanceOption
func WithRemoteMetadata ¶
func WithRemoteMetadata() InstanceOption
func WithRouter ¶ added in v3.3.1
func WithRouter(opts ...router.Option) InstanceOption
func WithShutdown ¶
func WithShutdown(opts ...graceful_shutdown.Option) InstanceOption
func WithTLS ¶ added in v3.3.1
func WithTLS(opts ...tls.Option) InstanceOption
func WithTag ¶
func WithTag(tag string) InstanceOption
func WithTracing ¶
func WithTracing(opts ...trace.Option) InstanceOption
WithTracing otel configuration, currently only supports tracing
func WithVersion ¶
func WithVersion(version string) InstanceOption
type InstanceOptions ¶
type InstanceOptions struct {
Application *global.ApplicationConfig `validate:"required" yaml:"application" json:"application,omitempty" property:"application"`
Protocols map[string]*global.ProtocolConfig `validate:"required" yaml:"protocols" json:"protocols" property:"protocols"`
Registries map[string]*global.RegistryConfig `yaml:"registries" json:"registries" property:"registries"`
ConfigCenter *global.CenterConfig `yaml:"config-center" json:"config-center,omitempty"`
MetadataReport *global.MetadataReportConfig `yaml:"metadata-report" json:"metadata-report,omitempty" property:"metadata-report"`
Provider *global.ProviderConfig `yaml:"provider" json:"provider" property:"provider"`
Consumer *global.ConsumerConfig `yaml:"consumer" json:"consumer" property:"consumer"`
Metrics *global.MetricsConfig `yaml:"metrics" json:"metrics,omitempty" property:"metrics"`
Otel *global.OtelConfig `yaml:"otel" json:"otel,omitempty" property:"otel"`
Logger *global.LoggerConfig `yaml:"logger" json:"logger,omitempty" property:"logger"`
Shutdown *global.ShutdownConfig `yaml:"shutdown" json:"shutdown,omitempty" property:"shutdown"`
// todo(DMwangnima): router feature would be supported in the future
Router []*global.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 *global.CustomConfig `yaml:"custom" json:"custom,omitempty" property:"custom"`
Profiles *global.ProfilesConfig `yaml:"profiles" json:"profiles,omitempty" property:"profiles"`
TLSConfig *global.TLSConfig `yaml:"tls_config" json:"tls_config,omitempty" property:"tls_config"`
}
func (*InstanceOptions) CloneApplication ¶
func (rc *InstanceOptions) CloneApplication() *global.ApplicationConfig
func (*InstanceOptions) CloneConfigCenter ¶
func (rc *InstanceOptions) CloneConfigCenter() *global.CenterConfig
func (*InstanceOptions) CloneConsumer ¶
func (rc *InstanceOptions) CloneConsumer() *global.ConsumerConfig
func (*InstanceOptions) CloneCustom ¶
func (rc *InstanceOptions) CloneCustom() *global.CustomConfig
func (*InstanceOptions) CloneLogger ¶
func (rc *InstanceOptions) CloneLogger() *global.LoggerConfig
func (*InstanceOptions) CloneMetadataReport ¶
func (rc *InstanceOptions) CloneMetadataReport() *global.MetadataReportConfig
func (*InstanceOptions) CloneMetrics ¶
func (rc *InstanceOptions) CloneMetrics() *global.MetricsConfig
func (*InstanceOptions) CloneOtel ¶
func (rc *InstanceOptions) CloneOtel() *global.OtelConfig
func (*InstanceOptions) CloneProfiles ¶
func (rc *InstanceOptions) CloneProfiles() *global.ProfilesConfig
func (*InstanceOptions) CloneProtocols ¶
func (rc *InstanceOptions) CloneProtocols() map[string]*global.ProtocolConfig
func (*InstanceOptions) CloneProvider ¶
func (rc *InstanceOptions) CloneProvider() *global.ProviderConfig
func (*InstanceOptions) CloneRegistries ¶
func (rc *InstanceOptions) CloneRegistries() map[string]*global.RegistryConfig
func (*InstanceOptions) CloneRouter ¶ added in v3.3.1
func (rc *InstanceOptions) CloneRouter() []*global.RouterConfig
func (*InstanceOptions) CloneShutdown ¶
func (rc *InstanceOptions) CloneShutdown() *global.ShutdownConfig
func (*InstanceOptions) CloneTLSConfig ¶
func (rc *InstanceOptions) CloneTLSConfig() *global.TLSConfig
func (*InstanceOptions) Prefix ¶
func (rc *InstanceOptions) Prefix() string
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 WithInstanceOptions ¶
func WithInstanceOptions(opts *InstanceOptions) LoaderConfOption
func WithSuffix ¶
func WithSuffix(suffix file.Suffix) LoaderConfOption
WithSuffix set load config file suffix
Directories
¶
| Path | Synopsis |
|---|---|
|
Package client provides APIs for starting RPC calls.
|
Package client provides APIs for starting RPC calls. |
|
Package cluster provides various LoadBalance and Cluster policies for client-side traffic management.
|
Package cluster provides various LoadBalance and Cluster policies for client-side traffic management. |
|
cluster/adaptivesvc
Package adaptivesvc implements adaptive service cluster strategy.
|
Package adaptivesvc implements adaptive service cluster strategy. |
|
cluster/available
Package available implements Available cluster strategy.
|
Package available implements Available cluster strategy. |
|
cluster/base
Package base implements invoker for the manipulation of cluster strategy.
|
Package base implements invoker for the manipulation of cluster strategy. |
|
cluster/broadcast
Package broadcast implements Broadcast cluster strategy.
|
Package broadcast implements Broadcast cluster strategy. |
|
cluster/failback
Package failback implements Failback cluster strategy.
|
Package failback implements Failback cluster strategy. |
|
cluster/failfast
Package failfast implements Failfast cluster strategy.
|
Package failfast implements Failfast cluster strategy. |
|
cluster/failover
Package failover implements Failover cluster strategy.
|
Package failover implements Failover cluster strategy. |
|
cluster/failsafe
Package failsafe implements Failsafe cluster strategy.
|
Package failsafe implements Failsafe cluster strategy. |
|
cluster/forking
Package forking implements forking cluster strategy.
|
Package forking implements forking cluster strategy. |
|
cluster/zoneaware
Package zoneaware implements zoneaware cluster strategy.
|
Package zoneaware implements zoneaware cluster strategy. |
|
cluster_impl
Package cluster_impl is for being compatible with older dubbo-go, please use `imports` package.
|
Package cluster_impl is for being compatible with older dubbo-go, please use `imports` package. |
|
loadbalance/aliasmethod
Package aliasmethod implements alias-method algorithm load balance strategy.
|
Package aliasmethod implements alias-method algorithm load balance strategy. |
|
loadbalance/consistenthashing
Package consistenthashing implements ConsistentHash load balance strategy.
|
Package consistenthashing implements ConsistentHash load balance strategy. |
|
loadbalance/iwrr
Package iwrr implements Interleaved Weighted Round Robin load balance strategy.
|
Package iwrr implements Interleaved Weighted Round Robin load balance strategy. |
|
loadbalance/leastactive
Package leastactive implements LeastActive load balance strategy.
|
Package leastactive implements LeastActive load balance strategy. |
|
loadbalance/p2c
Package p2c implements p2c load balance strategy.
|
Package p2c implements p2c load balance strategy. |
|
loadbalance/random
Package random implements Random load balance strategy.
|
Package random implements Random load balance strategy. |
|
loadbalance/roundrobin
Package roundrobin implements RoundRobin load balance strategy.
|
Package roundrobin implements RoundRobin load balance strategy. |
|
metrics
Package mock_metrics is a generated GoMock package.
|
Package mock_metrics is a generated GoMock package. |
|
Package common contains the utilities and SPI plugin mechanism used across Dubbo project.
|
Package common contains the utilities and SPI plugin mechanism used across Dubbo project. |
|
Package config assembles all Dubbo configurations and works as the entrance of the whole Dubbo process.
|
Package config assembles all Dubbo configurations and works as the entrance of the whole Dubbo process. |
|
Package config_center provides Config Center definition and implementations for listening service governance rules.
|
Package config_center provides Config Center definition and implementations for listening service governance rules. |
|
apollo
Package apollo implements config center around Apollo.
|
Package apollo implements config center around Apollo. |
|
file
Package file implements config center around file system.
|
Package file implements config center around file system. |
|
nacos
Package nacos implements config center around Nacos.
|
Package nacos implements config center around Nacos. |
|
zookeeper
Package zookeeper implements config center around zookeeper.
|
Package zookeeper implements config center around zookeeper. |
|
Package filter provides Filter definition and implementations for RPC call interception.
|
Package filter provides Filter definition and implementations for RPC call interception. |
|
accesslog
Package accesslog providers logging filter.
|
Package accesslog providers logging filter. |
|
adaptivesvc
Package adaptivesvc providers AdaptiveService filter.
|
Package adaptivesvc providers AdaptiveService filter. |
|
auth
Package auth providers authorization filter.
|
Package auth providers authorization filter. |
|
echo
Package echo providers health check filter.
|
Package echo providers health check filter. |
|
exec_limit
Package exec_limit provides a filter for limiting the number of in-progress request and it's thread-safe.
|
Package exec_limit provides a filter for limiting the number of in-progress request and it's thread-safe. |
|
filter_impl
Package filter_impl is for being compatible with older dubbo-go, please use `imports` package.
|
Package filter_impl is for being compatible with older dubbo-go, please use `imports` package. |
|
generic
Package generic provides generic invoke filter.
|
Package generic provides generic invoke filter. |
|
graceful_shutdown
Package graceful_shutdown provides a filter for shutting down gracefully.
|
Package graceful_shutdown provides a filter for shutting down gracefully. |
|
handler
Package filter is a generated GoMock package.
|
Package filter is a generated GoMock package. |
|
hystrix
Package hystrix provides hystrix filter.
|
Package hystrix provides hystrix filter. |
|
otel/trace
Package trace instruments dubbogo with open-telemetry (https://github.com/open-telemetry/opentelemetry-go).
|
Package trace instruments dubbogo with open-telemetry (https://github.com/open-telemetry/opentelemetry-go). |
|
seata
Package seata provides a filter when use seata-golang, use this filter to transfer xid.
|
Package seata provides a filter when use seata-golang, use this filter to transfer xid. |
|
sentinel
Package sentinel provides a filter when using sentinel.
|
Package sentinel provides a filter when using sentinel. |
|
token
Package token provides token filter.
|
Package token provides token filter. |
|
tps
Package tps provides a filter for limiting the requests by TPS.
|
Package tps provides a filter for limiting the requests by TPS. |
|
tps/limiter
Package filter is a generated GoMock package.
|
Package filter is a generated GoMock package. |
|
tps/strategy
Package filter is a generated GoMock package.
|
Package filter is a generated GoMock package. |
|
tracing
Package tracing provides tracing collection filter.
|
Package tracing provides tracing collection filter. |
|
Package global defines XxxConfigs for collecting Dubbo configurations and is for internal use only.
|
Package global defines XxxConfigs for collecting Dubbo configurations and is for internal use only. |
|
Package imports is a one-stop collection of Dubbo SPI implementations that aims to help users with plugin installation by leveraging Go package initialization.
|
Package imports is a one-stop collection of Dubbo SPI implementations that aims to help users with plugin installation by leveraging Go package initialization. |
|
Package internal contains dubbo-go-internal code, to avoid polluting the top-level dubbo-go package.
|
Package internal contains dubbo-go-internal code, to avoid polluting the top-level dubbo-go package. |
|
Package logger is unified facade provided by Dubbo to work with different logger frameworks, eg, Zapper, Logrus.
|
Package logger is unified facade provided by Dubbo to work with different logger frameworks, eg, Zapper, Logrus. |
|
core
Package logger is unified facade provided by Dubbo to work with different logger frameworks, eg, Zapper, Logrus.
|
Package logger is unified facade provided by Dubbo to work with different logger frameworks, eg, Zapper, Logrus. |
|
Package metadata collects and exposes information of all services for service discovery purpose.
|
Package metadata collects and exposes information of all services for service discovery purpose. |
|
Package metrics is for collecting RPC and many other metrics.
|
Package metrics is for collecting RPC and many other metrics. |
|
otel
|
|
|
trace
Package trace is for collecting tracing data and adapting with backend tracing systems.
|
Package trace is for collecting tracing data and adapting with backend tracing systems. |
|
dubbo
Package dubbo implements dubbo rpc protocol.
|
Package dubbo implements dubbo rpc protocol. |
|
dubbo/example/new/client
command
|
|
|
dubbo/example/new/server
command
|
|
|
dubbo3
Package dubbo3 implements dubbo3.0 rpc protocol.
|
Package dubbo3 implements dubbo3.0 rpc protocol. |
|
grpc
Package grpc implements grpc rpc protocol.
|
Package grpc implements grpc rpc protocol. |
|
jsonrpc
Package jsonrpc implements json rpc protocol.
|
Package jsonrpc implements json rpc protocol. |
|
mock
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
|
rest
Package rest implements restful rpc protocol.
|
Package rest implements restful rpc protocol. |
|
triple/health/triple_health
Code generated by protoc-gen-triple.
|
Code generated by protoc-gen-triple. |
|
triple/reflection/triple_reflection
Code generated by protoc-gen-triple.
|
Code generated by protoc-gen-triple. |
|
triple/triple_protocol
Package triple is a slim RPC framework built on Protocol Buffers and net/http.
|
Package triple is a slim RPC framework built on Protocol Buffers and net/http. |
|
triple/triple_protocol/internal/assert
Package assert is a minimal assert package using reflection.
|
Package assert is a minimal assert package using reflection. |
|
triple/triple_protocol/internal/gen/proto/connect/ping/v1/pingv1connect
The connect.ping.v1 package contains an echo service designed to test the connect-go implementation.
|
The connect.ping.v1 package contains an echo service designed to test the connect-go implementation. |
|
Package proxy is a core RPC concept and is especially designed for Dubbo2 protocol.
|
Package proxy is a core RPC concept and is especially designed for Dubbo2 protocol. |
|
Package registry defines interfaces to be implemented by service register and service discovery driver.
|
Package registry defines interfaces to be implemented by service register and service discovery driver. |
|
directory
Package directory implements registry around file system.
|
Package directory implements registry around file system. |
|
etcdv3
Package etcdv3 implements registry around etcd.
|
Package etcdv3 implements registry around etcd. |
|
nacos
Package nacos implements registry around Nacos.
|
Package nacos implements registry around Nacos. |
|
polaris
Package polaris implements registry around polaris.
|
Package polaris implements registry around polaris. |
|
zookeeper
Package zookeeper implements registry around zookeeper.
|
Package zookeeper implements registry around zookeeper. |
|
Package remoting provides facilities for decoding and encoding, client and server.
|
Package remoting provides facilities for decoding and encoding, client and server. |
|
Package server provides APIs for registering services and starting an RPC server.
|
Package server provides APIs for registering services and starting an RPC server. |

