servicediscovery

package
v3.1.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: Apache-2.0 Imports: 19 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ServiceMappingListenerStart = iota
	ServiceMappingListenerStop
)

Variables

This section is empty.

Functions

func GetMetadataInfo

func GetMetadataInfo(instance registry.ServiceInstance, revision string) (*common.MetadataInfo, error)

GetMetadataInfo get metadata info when MetadataStorageTypePropertyName is null

func NewServiceInstancesChangedListener

func NewServiceInstancesChangedListener(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

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

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

OnEvent on ServiceMappingChangedEvent the service mapping change event

func (*ServiceMappingChangedListenerImpl) Stop

func (lstn *ServiceMappingChangedListenerImpl) Stop()

Stop on ServiceMappingChangedEvent the service mapping change event

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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