event

package
v3.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2021 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

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

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

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

AddListener add event listener

func (*EventPublishingServiceDiscovery) Destroy

func (epsd *EventPublishingServiceDiscovery) Destroy() error

Destroy delegate function

func (*EventPublishingServiceDiscovery) DispatchEvent

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

Register delegate function

func (*EventPublishingServiceDiscovery) String

func (epsd *EventPublishingServiceDiscovery) String() string

String returns serviceDiscovery.String()

func (*EventPublishingServiceDiscovery) Unregister

Unregister unregister the instance and drop ServiceInstancePreUnregisteredEvent and ServiceInstanceUnregisteredEvent

func (*EventPublishingServiceDiscovery) Update

Update returns the result of serviceDiscovery.Update

type ProtocolPortsMetadataCustomizer

type ProtocolPortsMetadataCustomizer struct {
}

ProtocolPortsMetadataCustomizer will update the endpoints

func (*ProtocolPortsMetadataCustomizer) Customize

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

type ServiceDiscoveryEvent struct {
	observer.BaseEvent
	// contains filtered or unexported fields
}

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

type ServiceInstanceEvent struct {
	observer.BaseEvent
	// contains filtered or unexported fields
}

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

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

OnEvent on ServiceInstancesChangedEvent the service instances change event

func (*ServiceInstancesChangedListenerImpl) RemoveListener

func (lstn *ServiceInstancesChangedListenerImpl) RemoveListener(serviceKey string)

RemoveListener remove notify listener

Jump to

Keyboard shortcuts

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