Documentation ¶
Index ¶
- func NewServiceInstancesChangedListener(services *gxset.HashSet) registry.ServiceInstancesChangedListener
- 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 ProtocolPortsMetadataCustomizer
- type ServiceInstancesChangedListenerImpl
- func (lstn *ServiceInstancesChangedListenerImpl) Accept(e observer.Event) bool
- func (lstn *ServiceInstancesChangedListenerImpl) AddListenerAndNotify(serviceKey string, notify registry.NotifyListener)
- func (lstn *ServiceInstancesChangedListenerImpl) GetEventType() reflect.Type
- func (lstn *ServiceInstancesChangedListenerImpl) GetPriority() int
- func (lstn *ServiceInstancesChangedListenerImpl) GetServiceNames() *gxset.HashSet
- func (lstn *ServiceInstancesChangedListenerImpl) OnEvent(e observer.Event) error
- func (lstn *ServiceInstancesChangedListenerImpl) RemoveListener(serviceKey string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServiceInstancesChangedListener ¶
func NewServiceInstancesChangedListener(services *gxset.HashSet) registry.ServiceInstancesChangedListener
func ToConfigurators ¶
func ToConfigurators(urls []*common.URL, f func(url *common.URL) config_center.Configurator) []config_center.Configurator
ToConfigurators converts @urls by @f to config_center.Configurators
Types ¶
type BaseConfigurationListener ¶
type BaseConfigurationListener struct {
// contains filtered or unexported fields
}
nolint
func (*BaseConfigurationListener) Configurators ¶
func (bcl *BaseConfigurationListener) Configurators() []config_center.Configurator
Configurators gets Configurator from config center
func (*BaseConfigurationListener) InitWith ¶
func (bcl *BaseConfigurationListener) InitWith(key string, listener config_center.ConfigurationListener, f func(url *common.URL) config_center.Configurator)
InitWith will init BaseConfigurationListener by @key+@Listener+@f
func (*BaseConfigurationListener) OverrideUrl ¶
func (bcl *BaseConfigurationListener) OverrideUrl(url *common.URL)
OverrideUrl gets existing configuration rule and overrides provider url before exporting.
func (*BaseConfigurationListener) Process ¶
func (bcl *BaseConfigurationListener) Process(event *config_center.ConfigChangeEvent)
Process the notification event once there's any change happens on the config.
type ProtocolPortsMetadataCustomizer ¶
type ProtocolPortsMetadataCustomizer struct { }
ProtocolPortsMetadataCustomizer will update the endpoints
func (*ProtocolPortsMetadataCustomizer) Customize ¶
func (p *ProtocolPortsMetadataCustomizer) Customize(instance registry.ServiceInstance)
Customize put the the string like [{"protocol": "dubbo", "port": 123}] into instance's metadata
func (*ProtocolPortsMetadataCustomizer) GetPriority ¶
func (p *ProtocolPortsMetadataCustomizer) GetPriority() int
GetPriority will return 0, which means it will be invoked at the beginning
type ServiceInstancesChangedListenerImpl ¶
type ServiceInstancesChangedListenerImpl struct {
// contains filtered or unexported fields
}
ServiceInstancesChangedListenerImpl The Service Discovery Changed Event Listener
func (*ServiceInstancesChangedListenerImpl) Accept ¶
func (lstn *ServiceInstancesChangedListenerImpl) Accept(e observer.Event) bool
Accept return true if the name is the same
func (*ServiceInstancesChangedListenerImpl) AddListenerAndNotify ¶
func (lstn *ServiceInstancesChangedListenerImpl) AddListenerAndNotify(serviceKey string, notify registry.NotifyListener)
AddListenerAndNotify add notify listener and notify to listen service event
func (*ServiceInstancesChangedListenerImpl) GetEventType ¶
func (lstn *ServiceInstancesChangedListenerImpl) GetEventType() reflect.Type
GetEventType returns ServiceInstancesChangedEvent
func (*ServiceInstancesChangedListenerImpl) GetPriority ¶
func (lstn *ServiceInstancesChangedListenerImpl) GetPriority() int
GetPriority returns -1, it will be the first invoked listener
func (*ServiceInstancesChangedListenerImpl) GetServiceNames ¶
func (lstn *ServiceInstancesChangedListenerImpl) GetServiceNames() *gxset.HashSet
GetServiceNames return all listener service names
func (*ServiceInstancesChangedListenerImpl) OnEvent ¶
func (lstn *ServiceInstancesChangedListenerImpl) OnEvent(e observer.Event) error
OnEvent on ServiceInstancesChangedEvent the service instances change event
func (*ServiceInstancesChangedListenerImpl) RemoveListener ¶
func (lstn *ServiceInstancesChangedListenerImpl) RemoveListener(serviceKey string)
RemoveListener remove notify listener