Documentation ¶
Index ¶
- func GetCustomizableServiceInstanceListener() observer.EventListener
- func GetLogEventListener() observer.EventListener
- func GetServiceNameMappingListener() observer.EventListener
- 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 EventPublishingServiceDiscovery
- func (epsd *EventPublishingServiceDiscovery) AddListener(listener registry.ServiceInstancesChangedListener) error
- func (epsd *EventPublishingServiceDiscovery) Destroy() error
- func (epsd *EventPublishingServiceDiscovery) DispatchEvent(event *registry.ServiceInstancesChangedEvent) error
- func (epsd *EventPublishingServiceDiscovery) DispatchEventByServiceName(serviceName string) error
- func (epsd *EventPublishingServiceDiscovery) DispatchEventForInstances(serviceName string, instances []registry.ServiceInstance) error
- func (epsd *EventPublishingServiceDiscovery) GetDefaultPageSize() int
- func (epsd *EventPublishingServiceDiscovery) GetHealthyInstancesByPage(serviceName string, offset int, pageSize int, healthy bool) gxpage.Pager
- func (epsd *EventPublishingServiceDiscovery) GetInstances(serviceName string) []registry.ServiceInstance
- func (epsd *EventPublishingServiceDiscovery) GetInstancesByPage(serviceName string, offset int, pageSize int) gxpage.Pager
- func (epsd *EventPublishingServiceDiscovery) GetRequestInstances(serviceNames []string, offset int, requestedSize int) map[string]gxpage.Pager
- func (epsd *EventPublishingServiceDiscovery) GetServices() *gxset.HashSet
- func (epsd *EventPublishingServiceDiscovery) Register(instance registry.ServiceInstance) error
- func (epsd *EventPublishingServiceDiscovery) String() string
- func (epsd *EventPublishingServiceDiscovery) Unregister(instance registry.ServiceInstance) error
- func (epsd *EventPublishingServiceDiscovery) Update(instance registry.ServiceInstance) error
- type ProtocolPortsMetadataCustomizer
- type ServiceConfigExportedEvent
- type ServiceDiscoveryDestroyedEvent
- type ServiceDiscoveryDestroyingEvent
- type ServiceDiscoveryEvent
- type ServiceDiscoveryExceptionEvent
- type ServiceDiscoveryInitializedEvent
- type ServiceDiscoveryInitializingEvent
- type ServiceInstanceEvent
- type ServiceInstancePreRegisteredEvent
- type ServiceInstancePreUnregisteredEvent
- type ServiceInstanceRegisteredEvent
- type ServiceInstanceUnregisteredEvent
- 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 GetCustomizableServiceInstanceListener ¶
func GetCustomizableServiceInstanceListener() observer.EventListener
GetCustomizableServiceInstanceListener returns an instance if the instance was not initialized, we create one
func GetLogEventListener ¶
func GetLogEventListener() observer.EventListener
func GetServiceNameMappingListener ¶
func GetServiceNameMappingListener() observer.EventListener
GetServiceNameMappingListener returns an instance
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 EventPublishingServiceDiscovery ¶
type EventPublishingServiceDiscovery struct {
// contains filtered or unexported fields
}
EventPublishingServiceDiscovery will enhance Service Discovery Publish some event about service discovery
func NewEventPublishingServiceDiscovery ¶
func NewEventPublishingServiceDiscovery(serviceDiscovery registry.ServiceDiscovery) *EventPublishingServiceDiscovery
NewEventPublishingServiceDiscovery is a constructor
func (*EventPublishingServiceDiscovery) AddListener ¶
func (epsd *EventPublishingServiceDiscovery) AddListener(listener registry.ServiceInstancesChangedListener) error
AddListener add event listener
func (*EventPublishingServiceDiscovery) Destroy ¶
func (epsd *EventPublishingServiceDiscovery) Destroy() error
Destroy delegate function
func (*EventPublishingServiceDiscovery) DispatchEvent ¶
func (epsd *EventPublishingServiceDiscovery) DispatchEvent(event *registry.ServiceInstancesChangedEvent) error
DispatchEvent pass the event to serviceDiscovery
func (*EventPublishingServiceDiscovery) DispatchEventByServiceName ¶
func (epsd *EventPublishingServiceDiscovery) DispatchEventByServiceName(serviceName string) error
DispatchEventByServiceName pass serviceName to serviceDiscovery
func (*EventPublishingServiceDiscovery) DispatchEventForInstances ¶
func (epsd *EventPublishingServiceDiscovery) DispatchEventForInstances(serviceName string, instances []registry.ServiceInstance) error
DispatchEventForInstances pass params to serviceDiscovery
func (*EventPublishingServiceDiscovery) GetDefaultPageSize ¶
func (epsd *EventPublishingServiceDiscovery) GetDefaultPageSize() int
GetDefaultPageSize returns the result of serviceDiscovery.GetDefaultPageSize
func (*EventPublishingServiceDiscovery) GetHealthyInstancesByPage ¶
func (epsd *EventPublishingServiceDiscovery) GetHealthyInstancesByPage(serviceName string, offset int, pageSize int, healthy bool) gxpage.Pager
GetHealthyInstancesByPage returns the result of serviceDiscovery.GetHealthyInstancesByPage
func (*EventPublishingServiceDiscovery) GetInstances ¶
func (epsd *EventPublishingServiceDiscovery) GetInstances(serviceName string) []registry.ServiceInstance
GetInstances returns the result of serviceDiscovery.GetInstances
func (*EventPublishingServiceDiscovery) GetInstancesByPage ¶
func (epsd *EventPublishingServiceDiscovery) GetInstancesByPage(serviceName string, offset int, pageSize int) gxpage.Pager
GetInstancesByPage returns the result of serviceDiscovery.GetInstancesByPage
func (*EventPublishingServiceDiscovery) GetRequestInstances ¶
func (epsd *EventPublishingServiceDiscovery) GetRequestInstances(serviceNames []string, offset int, requestedSize int) map[string]gxpage.Pager
GetRequestInstances returns result from serviceDiscovery.GetRequestInstances
func (*EventPublishingServiceDiscovery) GetServices ¶
func (epsd *EventPublishingServiceDiscovery) GetServices() *gxset.HashSet
GetServices returns the result of serviceDiscovery.GetServices
func (*EventPublishingServiceDiscovery) Register ¶
func (epsd *EventPublishingServiceDiscovery) Register(instance registry.ServiceInstance) error
Register delegate function
func (*EventPublishingServiceDiscovery) String ¶
func (epsd *EventPublishingServiceDiscovery) String() string
String returns serviceDiscovery.String()
func (*EventPublishingServiceDiscovery) Unregister ¶
func (epsd *EventPublishingServiceDiscovery) Unregister(instance registry.ServiceInstance) error
Unregister unregister the instance and drop ServiceInstancePreUnregisteredEvent and ServiceInstanceUnregisteredEvent
func (*EventPublishingServiceDiscovery) Update ¶
func (epsd *EventPublishingServiceDiscovery) Update(instance registry.ServiceInstance) error
Update returns the result of serviceDiscovery.Update
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 ServiceConfigExportedEvent ¶
type ServiceConfigExportedEvent struct { observer.BaseEvent ServiceConfig *config.ServiceConfig }
ServiceConfigExportedEvent represents an service was exported
func NewServiceConfigExportedEvent ¶
func NewServiceConfigExportedEvent(serviceConfig *config.ServiceConfig) *ServiceConfigExportedEvent
NewServiceConfigExportedEvent create an instance
type ServiceDiscoveryDestroyedEvent ¶
type ServiceDiscoveryDestroyedEvent struct {
ServiceDiscoveryEvent
}
ServiceDiscoveryDestroyedEvent this event will be dispatched after service discovery be destroyed
func NewServiceDiscoveryDestroyedEvent ¶
func NewServiceDiscoveryDestroyedEvent(discovery registry.ServiceDiscovery, original registry.ServiceDiscovery) *ServiceDiscoveryDestroyedEvent
NewServiceDiscoveryDestroyedEvent create a ServiceDiscoveryDestroyedEvent
type ServiceDiscoveryDestroyingEvent ¶
type ServiceDiscoveryDestroyingEvent struct {
ServiceDiscoveryEvent
}
ServiceDiscoveryDestroyingEvent this event will be dispatched before service discovery be destroyed
func NewServiceDiscoveryDestroyingEvent ¶
func NewServiceDiscoveryDestroyingEvent(discovery registry.ServiceDiscovery, original registry.ServiceDiscovery) *ServiceDiscoveryDestroyingEvent
NewServiceDiscoveryDestroyingEvent create a ServiceDiscoveryDestroyingEvent
type ServiceDiscoveryEvent ¶
ServiceDiscoveryEvent means that something happens to service discovery instance
func NewServiceDiscoveryEvent ¶
func NewServiceDiscoveryEvent(discovery registry.ServiceDiscovery, original registry.ServiceDiscovery) *ServiceDiscoveryEvent
NewServiceDiscoveryEvent returns an instance
func (*ServiceDiscoveryEvent) GetOriginal ¶
func (sde *ServiceDiscoveryEvent) GetOriginal() registry.ServiceDiscovery
GetOriginal actually I think we can remove this method.
func (*ServiceDiscoveryEvent) GetServiceDiscovery ¶
func (sde *ServiceDiscoveryEvent) GetServiceDiscovery() registry.ServiceDiscovery
GetServiceDiscovery returns the event source
type ServiceDiscoveryExceptionEvent ¶
type ServiceDiscoveryExceptionEvent struct { ServiceDiscoveryEvent // contains filtered or unexported fields }
ServiceDiscoveryExceptionEvent this event will be dispatched when the error occur in service discovery
func NewServiceDiscoveryExceptionEvent ¶
func NewServiceDiscoveryExceptionEvent(discovery registry.ServiceDiscovery, original registry.ServiceDiscovery, err error) *ServiceDiscoveryExceptionEvent
NewServiceDiscoveryExceptionEvent create a ServiceDiscoveryExceptionEvent
type ServiceDiscoveryInitializedEvent ¶
type ServiceDiscoveryInitializedEvent struct {
ServiceDiscoveryEvent
}
ServiceDiscoveryInitializedEvent this event will be dispatched after service discovery initialize
func NewServiceDiscoveryInitializedEvent ¶
func NewServiceDiscoveryInitializedEvent(discovery registry.ServiceDiscovery, original registry.ServiceDiscovery) *ServiceDiscoveryInitializedEvent
NewServiceDiscoveryInitializedEvent create a ServiceDiscoveryInitializedEvent
type ServiceDiscoveryInitializingEvent ¶
type ServiceDiscoveryInitializingEvent struct {
ServiceDiscoveryEvent
}
ServiceDiscoveryInitializingEvent this event will be dispatched before service discovery initialize
func NewServiceDiscoveryInitializingEvent ¶
func NewServiceDiscoveryInitializingEvent(discovery registry.ServiceDiscovery, original registry.ServiceDiscovery) *ServiceDiscoveryInitializingEvent
NewServiceDiscoveryInitializingEvent create a ServiceDiscoveryInitializingEvent
type ServiceInstanceEvent ¶
ServiceInstanceEvent means something happen to this ServiceInstance like register this service instance
func NewServiceInstanceEvent ¶
func NewServiceInstanceEvent(source interface{}, instance registry.ServiceInstance) *ServiceInstanceEvent
NewServiceInstanceEvent create a ServiceInstanceEvent
type ServiceInstancePreRegisteredEvent ¶
type ServiceInstancePreRegisteredEvent struct {
ServiceInstanceEvent
}
ServiceInstancePreRegisteredEvent this event will be dispatched before service instance be registered
func NewServiceInstancePreRegisteredEvent ¶
func NewServiceInstancePreRegisteredEvent(source interface{}, instance registry.ServiceInstance) *ServiceInstancePreRegisteredEvent
NewServiceInstancePreRegisteredEvent create a ServiceInstancePreRegisteredEvent
type ServiceInstancePreUnregisteredEvent ¶
type ServiceInstancePreUnregisteredEvent struct {
ServiceInstanceEvent
}
ServiceInstancePreUnregisteredEvent this event will be dispatched before service instance be unregistered
func NewServiceInstancePreUnregisteredEvent ¶
func NewServiceInstancePreUnregisteredEvent(source interface{}, instance registry.ServiceInstance) *ServiceInstancePreUnregisteredEvent
NewServiceInstancePreUnregisteredEvent create a ServiceInstancePreUnregisteredEvent
type ServiceInstanceRegisteredEvent ¶
type ServiceInstanceRegisteredEvent struct {
ServiceInstanceEvent
}
ServiceInstanceRegisteredEvent this event will be dispatched after service instance be registered
func NewServiceInstanceRegisteredEvent ¶
func NewServiceInstanceRegisteredEvent(source interface{}, instance registry.ServiceInstance) *ServiceInstanceRegisteredEvent
NewServiceInstanceRegisteredEvent create a ServiceInstanceRegisteredEvent
type ServiceInstanceUnregisteredEvent ¶
type ServiceInstanceUnregisteredEvent struct {
ServiceInstanceEvent
}
ServiceInstanceRegisteredEvent this event will be dispatched after service instance be unregistered
func NewServiceInstanceUnregisteredEvent ¶
func NewServiceInstanceUnregisteredEvent(source interface{}, instance registry.ServiceInstance) *ServiceInstanceUnregisteredEvent
NewServiceInstanceUnregisteredEvent create a ServiceInstanceUnregisteredEvent
type ServiceInstancesChangedListenerImpl ¶
type ServiceInstancesChangedListenerImpl struct {
// contains filtered or unexported fields
}
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
Source Files ¶
- base_configuration_listener.go
- customizable_service_instance_listener.go
- event_publishing_service_discovery.go
- log_event_listener.go
- metadata_service_url_params_customizer.go
- protocol_ports_metadata_customizer.go
- service_config_exported_event.go
- service_discovery_event.go
- service_instance_event.go
- service_instances_changed_listener_impl.go
- service_name_mapping_listener.go
- service_revision_customizer.go