Documentation ¶
Index ¶
- Constants
- func ToConfigurators(urls []*common.URL, f func(url *common.URL) config_center.Configurator) []config_center.Configurator
- type BaseConfigurationListener
- func (bcl *BaseConfigurationListener) Configurators() []config_center.Configurator
- func (bcl *BaseConfigurationListener) InitWith(key string, listener config_center.ConfigurationListener, ...)
- func (bcl *BaseConfigurationListener) OverrideUrl(url *common.URL)
- func (bcl *BaseConfigurationListener) Process(event *config_center.ConfigChangeEvent)
- type BaseRegistry
- func (r *BaseRegistry) Destroy()
- func (r *BaseRegistry) Done() chan struct{}
- func (r *BaseRegistry) GetUrl() common.URL
- func (r *BaseRegistry) InitBaseRegistry(url *common.URL, facadeRegistry FacadeBasedRegistry) Registry
- func (r *BaseRegistry) IsAvailable() bool
- func (r *BaseRegistry) Register(conf common.URL) error
- func (r *BaseRegistry) RestartCallBack() bool
- func (r *BaseRegistry) Subscribe(url *common.URL, notifyListener NotifyListener)
- func (r *BaseRegistry) WaitGroup() *sync.WaitGroup
- type FacadeBasedRegistry
- type Listener
- type MockRegistry
- func (r *MockRegistry) Destroy()
- func (r *MockRegistry) GetUrl() common.URL
- func (r *MockRegistry) IsAvailable() bool
- func (r *MockRegistry) MockEvent(event *ServiceEvent)
- func (*MockRegistry) Register(url common.URL) error
- func (r *MockRegistry) Subscribe(url *common.URL, notifyListener NotifyListener)
- type NotifyListener
- type Registry
- type ServiceEvent
Constants ¶
const ( // RegistryConnDelay connection delay RegistryConnDelay = 3 // MaxWaitInterval max wait interval MaxWaitInterval = 3 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func ToConfigurators ¶
func ToConfigurators(urls []*common.URL, f func(url *common.URL) config_center.Configurator) []config_center.Configurator
ToConfigurators ...
Types ¶
type BaseConfigurationListener ¶
type BaseConfigurationListener struct {
// contains filtered or unexported fields
}
BaseConfigurationListener ...
func (*BaseConfigurationListener) Configurators ¶
func (bcl *BaseConfigurationListener) Configurators() []config_center.Configurator
Configurators ...
func (*BaseConfigurationListener) InitWith ¶
func (bcl *BaseConfigurationListener) InitWith(key string, listener config_center.ConfigurationListener, f func(url *common.URL) config_center.Configurator)
InitWith ...
func (*BaseConfigurationListener) OverrideUrl ¶
func (bcl *BaseConfigurationListener) OverrideUrl(url *common.URL)
OverrideUrl ...
func (*BaseConfigurationListener) Process ¶
func (bcl *BaseConfigurationListener) Process(event *config_center.ConfigChangeEvent)
Process ...
type BaseRegistry ¶
BaseRegistry is a common logic abstract for registry. It implement Registry interface.
func (*BaseRegistry) Done ¶
func (r *BaseRegistry) Done() chan struct{}
Done open for outside to listen the event of registry Destroy() called.
func (*BaseRegistry) GetUrl ¶
func (r *BaseRegistry) GetUrl() common.URL
GetUrl for get registry's url
func (*BaseRegistry) InitBaseRegistry ¶
func (r *BaseRegistry) InitBaseRegistry(url *common.URL, facadeRegistry FacadeBasedRegistry) Registry
InitBaseRegistry for init some local variables and set BaseRegistry's subclass to it
func (*BaseRegistry) IsAvailable ¶
func (r *BaseRegistry) IsAvailable() bool
IsAvailable judge to is registry not closed by chan r.done
func (*BaseRegistry) Register ¶
func (r *BaseRegistry) Register(conf common.URL) error
Register implement interface registry to register
func (*BaseRegistry) RestartCallBack ¶
func (r *BaseRegistry) RestartCallBack() bool
RestartCallBack for reregister when reconnect
func (*BaseRegistry) Subscribe ¶
func (r *BaseRegistry) Subscribe(url *common.URL, notifyListener NotifyListener)
Subscribe :subscribe from registry, event will notify by notifyListener
func (*BaseRegistry) WaitGroup ¶
func (r *BaseRegistry) WaitGroup() *sync.WaitGroup
WaitGroup open for outside add the waitgroup to add some logic before registry destroyed over(graceful down)
type FacadeBasedRegistry ¶
type FacadeBasedRegistry interface { Registry // CreatePath create the path in the registry CreatePath(string) error // DoRegister actually do the register job DoRegister(string, string) error // DoSubscribe actually subscribe the URL DoSubscribe(conf *common.URL) (Listener, error) // CloseAndNilClient close the client and then reset the client in registry to nil // you should notice that this method will be invoked inside a lock. // So you should implement this method as light weighted as you can. CloseAndNilClient() // CloseListener close listeners CloseListener() // InitListeners init listeners InitListeners() }
* FacadeBasedRegistry interface is subclass of Registry, and it is designed for registry who want to inherit BaseRegistry. * You have to implement the interface to inherit BaseRegistry.
type Listener ¶
type Listener interface { Next() (*ServiceEvent, error) Close() }
Listener Deprecated!
type MockRegistry ¶
type MockRegistry struct {
// contains filtered or unexported fields
}
MockRegistry ...
func (*MockRegistry) MockEvent ¶
func (r *MockRegistry) MockEvent(event *ServiceEvent)
MockEvent ...
func (*MockRegistry) Subscribe ¶
func (r *MockRegistry) Subscribe(url *common.URL, notifyListener NotifyListener)
Subscribe ...
type Registry ¶
type Registry interface { common.Node //used for service provider calling , register services to registry //And it is also used for service consumer calling , register services cared about ,for dubbo's admin monitoring. Register(url common.URL) error //Will relace mode1 in dubbogo version v1.1.0 //mode2 : callback mode, subscribe with notify(notify listener). Subscribe(*common.URL, NotifyListener) }
- -----------------------------------NOTICE---------------------------------------------
- If there is no special case, you'd better inherit BaseRegistry and implement the
- FacadeBasedRegistry interface instead of directly implementing the Registry interface.
- --------------------------------------------------------------------------------------
Registry Extension - Registry
type ServiceEvent ¶
ServiceEvent ...
func (ServiceEvent) String ¶
func (e ServiceEvent) String() string