registry

package
v1.3.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2020 License: Apache-2.0 Imports: 18 Imported by: 7

Documentation

Index

Constants

View Source
const (
	// RegistryConnDelay connection delay
	RegistryConnDelay = 3
	// MaxWaitInterval max wait interval
	MaxWaitInterval = 3 * time.Second
)

Variables

This section is empty.

Functions

func ToConfigurators added in v1.2.0

func ToConfigurators(urls []*common.URL, f func(url *common.URL) config_center.Configurator) []config_center.Configurator

Types

type BaseConfigurationListener added in v1.2.0

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

func (*BaseConfigurationListener) Configurators added in v1.2.0

func (bcl *BaseConfigurationListener) Configurators() []config_center.Configurator

func (*BaseConfigurationListener) InitWith added in v1.2.0

func (*BaseConfigurationListener) OverrideUrl added in v1.2.0

func (bcl *BaseConfigurationListener) OverrideUrl(url *common.URL)

func (*BaseConfigurationListener) Process added in v1.2.0

type BaseRegistry added in v1.3.0

type BaseRegistry struct {
	*common.URL
	// contains filtered or unexported fields
}

BaseRegistry is a common logic abstract for registry. It implement Registry interface.

func (*BaseRegistry) Destroy added in v1.3.0

func (r *BaseRegistry) Destroy()

Destroy for graceful down

func (*BaseRegistry) Done added in v1.3.0

func (r *BaseRegistry) Done() chan struct{}

Done open for outside to listen the event of registry Destroy() called.

func (*BaseRegistry) GetUrl added in v1.3.0

func (r *BaseRegistry) GetUrl() common.URL

GetUrl for get registry's url

func (*BaseRegistry) InitBaseRegistry added in v1.3.0

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 added in v1.3.0

func (r *BaseRegistry) IsAvailable() bool

IsAvailable judge to is registry not closed by chan r.done

func (*BaseRegistry) Register added in v1.3.0

func (r *BaseRegistry) Register(conf common.URL) error

Register implement interface registry to register

func (*BaseRegistry) RestartCallBack added in v1.3.0

func (r *BaseRegistry) RestartCallBack() bool

RestartCallBack for reregister when reconnect

func (*BaseRegistry) Subscribe added in v1.3.0

func (r *BaseRegistry) Subscribe(url *common.URL, notifyListener NotifyListener)

Subscribe :subscribe from registry, event will notify by notifyListener

func (*BaseRegistry) WaitGroup added in v1.3.0

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 added in v1.3.0

type FacadeBasedRegistry interface {
	Registry
	CreatePath(string) error
	DoRegister(string, string) error
	DoSubscribe(conf *common.URL) (Listener, error)
	CloseAndNilClient()
	CloseListener()
	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 added in v1.1.0

type Listener interface {
	Next() (*ServiceEvent, error)
	Close()
}

Listener Deprecated!

type MockRegistry added in v1.1.0

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

func (*MockRegistry) Destroy added in v1.1.0

func (r *MockRegistry) Destroy()

func (*MockRegistry) GetUrl added in v1.1.0

func (r *MockRegistry) GetUrl() common.URL

func (*MockRegistry) IsAvailable added in v1.1.0

func (r *MockRegistry) IsAvailable() bool

func (*MockRegistry) MockEvent added in v1.1.0

func (r *MockRegistry) MockEvent(event *ServiceEvent)

func (*MockRegistry) Register added in v1.1.0

func (*MockRegistry) Register(url common.URL) error

func (*MockRegistry) Subscribe added in v1.1.0

func (r *MockRegistry) Subscribe(url *common.URL, notifyListener NotifyListener)

type NotifyListener added in v1.2.0

type NotifyListener interface {
	Notify(*ServiceEvent)
}

NotifyListener ...

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

func NewMockRegistry added in v1.1.0

func NewMockRegistry(url *common.URL) (Registry, error)

type ServiceEvent added in v1.1.0

type ServiceEvent struct {
	Action  remoting.EventType
	Service common.URL
}

func (ServiceEvent) String added in v1.1.0

func (e ServiceEvent) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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