Documentation ¶
Index ¶
- Constants
- func GetMetadataInfo(app string, instance registry.ServiceInstance, revision string) (*common.MetadataInfo, error)
- func NewServiceInstancesChangedListener(app string, services *gxset.HashSet) registry.ServiceInstancesChangedListener
- type ServiceDiscoveryRegistry
- func (s *ServiceDiscoveryRegistry) Destroy()
- func (s *ServiceDiscoveryRegistry) GetServiceDiscovery() registry.ServiceDiscovery
- func (s *ServiceDiscoveryRegistry) GetURL() *common.URL
- func (s *ServiceDiscoveryRegistry) IsAvailable() bool
- func (s *ServiceDiscoveryRegistry) LoadSubscribeInstances(url *common.URL, notify registry.NotifyListener) error
- func (s *ServiceDiscoveryRegistry) Register(url *common.URL) error
- func (s *ServiceDiscoveryRegistry) Subscribe(url *common.URL, notify registry.NotifyListener) error
- func (s *ServiceDiscoveryRegistry) SubscribeURL(url *common.URL, notify registry.NotifyListener, services *gxset.HashSet)
- func (s *ServiceDiscoveryRegistry) UnRegister(url *common.URL) error
- func (s *ServiceDiscoveryRegistry) UnSubscribe(url *common.URL, listener registry.NotifyListener) error
- 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)
- type ServiceMappingChangedListenerImpl
Constants ¶
const ( ServiceMappingListenerStart = iota ServiceMappingListenerStop )
Variables ¶
This section is empty.
Functions ¶
func GetMetadataInfo ¶
func GetMetadataInfo(app string, instance registry.ServiceInstance, revision string) (*common.MetadataInfo, error)
GetMetadataInfo get metadata info when MetadataStorageTypePropertyName is null
func NewServiceInstancesChangedListener ¶
func NewServiceInstancesChangedListener(app string, services *gxset.HashSet) registry.ServiceInstancesChangedListener
Types ¶
type ServiceDiscoveryRegistry ¶
type ServiceDiscoveryRegistry struct {
// contains filtered or unexported fields
}
ServiceDiscoveryRegistry is the implementation of application-level registry. It's completely different from other registry implementations This implementation is based on ServiceDiscovery abstraction and ServiceNameMapping In order to keep compatible with interface-level registry, this implementation is
func (*ServiceDiscoveryRegistry) Destroy ¶
func (s *ServiceDiscoveryRegistry) Destroy()
func (*ServiceDiscoveryRegistry) GetServiceDiscovery ¶
func (s *ServiceDiscoveryRegistry) GetServiceDiscovery() registry.ServiceDiscovery
func (*ServiceDiscoveryRegistry) GetURL ¶
func (s *ServiceDiscoveryRegistry) GetURL() *common.URL
func (*ServiceDiscoveryRegistry) IsAvailable ¶
func (s *ServiceDiscoveryRegistry) IsAvailable() bool
func (*ServiceDiscoveryRegistry) LoadSubscribeInstances ¶
func (s *ServiceDiscoveryRegistry) LoadSubscribeInstances(url *common.URL, notify registry.NotifyListener) error
LoadSubscribeInstances load subscribe instance
func (*ServiceDiscoveryRegistry) Register ¶
func (s *ServiceDiscoveryRegistry) Register(url *common.URL) error
func (*ServiceDiscoveryRegistry) Subscribe ¶
func (s *ServiceDiscoveryRegistry) Subscribe(url *common.URL, notify registry.NotifyListener) error
func (*ServiceDiscoveryRegistry) SubscribeURL ¶
func (s *ServiceDiscoveryRegistry) SubscribeURL(url *common.URL, notify registry.NotifyListener, services *gxset.HashSet)
func (*ServiceDiscoveryRegistry) UnRegister ¶
func (s *ServiceDiscoveryRegistry) UnRegister(url *common.URL) error
func (*ServiceDiscoveryRegistry) UnSubscribe ¶
func (s *ServiceDiscoveryRegistry) UnSubscribe(url *common.URL, listener registry.NotifyListener) error
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
type ServiceMappingChangedListenerImpl ¶
type ServiceMappingChangedListenerImpl struct {
// contains filtered or unexported fields
}
func NewMappingListener ¶
func NewMappingListener(registryUrl *common.URL, serviceUrl *common.URL, oldServiceNames *gxset.HashSet, listener registry.NotifyListener) *ServiceMappingChangedListenerImpl
func (*ServiceMappingChangedListenerImpl) OnEvent ¶
func (lstn *ServiceMappingChangedListenerImpl) OnEvent(e observer.Event) error
OnEvent on ServiceMappingChangedEvent the service mapping change event
func (*ServiceMappingChangedListenerImpl) Stop ¶
func (lstn *ServiceMappingChangedListenerImpl) Stop()
Stop on ServiceMappingChangedEvent the service mapping change event