registry

package
v0.0.0-...-2c3524d Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const AppCtx = "ApplicationContext"

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 MergeInstances

func MergeInstances(insMap1 map[string][]registry.ServiceInstance, insMap2 map[string][]registry.ServiceInstance) map[string][]registry.ServiceInstance

func MergeMapping

func MergeMapping(mapping1 map[string]*gxset.HashSet, mapping2 map[string]*gxset.HashSet) map[string]*gxset.HashSet

func ToDescString

func ToDescString(s *common.ServiceInfo) string

Types

type AdminInstanceEvent

type AdminInstanceEvent struct {
	Action   remoting.EventType
	Instance registry.ServiceInstance
	Key      string // store the key for Service.Key()
}

type ApplicationContext

type ApplicationContext struct {
	// contains filtered or unexported fields
}

func NewApplicationContext

func NewApplicationContext() *ApplicationContext

func (*ApplicationContext) AddAllInstances

func (ac *ApplicationContext) AddAllInstances(key string, value []registry.ServiceInstance)

func (*ApplicationContext) AddServiceUrls

func (ac *ApplicationContext) AddServiceUrls(newServiceUrls map[string][]*common.URL)

func (*ApplicationContext) DeleteAllInstance

func (ac *ApplicationContext) DeleteAllInstance(key string, instance registry.ServiceInstance)

func (*ApplicationContext) DeleteRevisionToMetadata

func (ac *ApplicationContext) DeleteRevisionToMetadata(key string)

func (*ApplicationContext) DeleteServiceUrl

func (ac *ApplicationContext) DeleteServiceUrl(key string, url *common.URL)

func (*ApplicationContext) GetAllInstances

func (ac *ApplicationContext) GetAllInstances() map[string][]registry.ServiceInstance

GetAllInstances returns the reference to the allInstances map with read lock

func (*ApplicationContext) GetMapping

func (ac *ApplicationContext) GetMapping() map[string]*gxset.HashSet

func (*ApplicationContext) GetOldRevision

func (ac *ApplicationContext) GetOldRevision(instance registry.ServiceInstance) string

func (*ApplicationContext) GetRevisionToMetadata

func (ac *ApplicationContext) GetRevisionToMetadata(revision string) *common.MetadataInfo

GetRevisionToMetadata returns the reference to the revisionToMetadata map with read lock

func (*ApplicationContext) GetServiceUrls

func (ac *ApplicationContext) GetServiceUrls() map[string][]*common.URL

GetServiceUrls returns the reference to the serviceUrls map with read lock

func (*ApplicationContext) NewRevisionToMetadata

func (ac *ApplicationContext) NewRevisionToMetadata(newRevisionToMetadata map[string]*common.MetadataInfo)

func (*ApplicationContext) UpdateAllInstances

func (ac *ApplicationContext) UpdateAllInstances(key string, instance registry.ServiceInstance)

func (*ApplicationContext) UpdateMapping

func (ac *ApplicationContext) UpdateMapping(mapping map[string]*gxset.HashSet)

func (*ApplicationContext) UpdateRevisionToMetadata

func (ac *ApplicationContext) UpdateRevisionToMetadata(key string, newKey string, value *common.MetadataInfo)

func (*ApplicationContext) UpdateServiceUrls

func (ac *ApplicationContext) UpdateServiceUrls(interfaceKey string, url *common.URL)

type DubboSDNotifyListener

type DubboSDNotifyListener struct {
	// contains filtered or unexported fields
}

DubboSDNotifyListener The Service Discovery Changed Event Listener

func (*DubboSDNotifyListener) Accept

func (lstn *DubboSDNotifyListener) Accept(e observer.Event) bool

Accept return true if the name is the same

func (*DubboSDNotifyListener) AddListenerAndNotify

func (lstn *DubboSDNotifyListener) AddListenerAndNotify(serviceKey string, notify registry.NotifyListener)

AddListenerAndNotify add notify listener and notify to listen service event

func (*DubboSDNotifyListener) GetEventType

func (lstn *DubboSDNotifyListener) GetEventType() reflect.Type

GetEventType returns ServiceInstancesChangedEvent

func (*DubboSDNotifyListener) GetPriority

func (lstn *DubboSDNotifyListener) GetPriority() int

GetPriority returns -1, it will be the first invoked listener

func (*DubboSDNotifyListener) GetServiceNames

func (lstn *DubboSDNotifyListener) GetServiceNames() *gxset.HashSet

GetServiceNames return all listener service names

func (*DubboSDNotifyListener) OnEvent

func (lstn *DubboSDNotifyListener) OnEvent(e observer.Event) error

OnEvent on ServiceInstancesChangedEvent the service instances change event

func (*DubboSDNotifyListener) RemoveListener

func (lstn *DubboSDNotifyListener) RemoveListener(serviceKey string)

RemoveListener remove notify listener

type Endpoint

type Endpoint struct {
	Port     int    `json:"port,omitempty"`
	Protocol string `json:"protocol,omitempty"`
}

Endpoint nolint

type InterfaceContext

type InterfaceContext struct {
	// contains filtered or unexported fields
}

func NewInterfaceContext

func NewInterfaceContext() *InterfaceContext

func (*InterfaceContext) AddInstance

func (ac *InterfaceContext) AddInstance(key string, instance *registry.DefaultServiceInstance)

func (*InterfaceContext) GetAllInstances

func (ac *InterfaceContext) GetAllInstances() map[string][]registry.ServiceInstance

func (*InterfaceContext) GetInstance

func (ac *InterfaceContext) GetInstance(key string, addr string) (registry.ServiceInstance, bool)

func (*InterfaceContext) GetInstances

func (ac *InterfaceContext) GetInstances(key string) []registry.ServiceInstance

func (*InterfaceContext) GetMapping

func (ac *InterfaceContext) GetMapping() map[string]*gxset.HashSet

func (*InterfaceContext) GetMetadata

func (ac *InterfaceContext) GetMetadata(r string) *common.MetadataInfo

func (*InterfaceContext) RemoveInstance

func (ac *InterfaceContext) RemoveInstance(key string, addr string)

func (*InterfaceContext) UpdateMapping

func (ac *InterfaceContext) UpdateMapping(inf string, appName string)

type InterfaceServiceChangedNotifyListener

type InterfaceServiceChangedNotifyListener struct {
	// contains filtered or unexported fields
}

func NewInterfaceServiceChangedNotifyListener

func NewInterfaceServiceChangedNotifyListener(
	listener *NotifyListener,
	ctx *InterfaceContext,
) *InterfaceServiceChangedNotifyListener

func (*InterfaceServiceChangedNotifyListener) CreateOrUpdateServiceInfo

func (iscnl *InterfaceServiceChangedNotifyListener) CreateOrUpdateServiceInfo(url *common.URL)

func (*InterfaceServiceChangedNotifyListener) Notify

Notify OnEvent on ServiceInstancesChangedEvent the service instances change event

func (*InterfaceServiceChangedNotifyListener) NotifyAll

func (iscnl *InterfaceServiceChangedNotifyListener) NotifyAll(events []*registry.ServiceEvent, f func())

type NotifyListener

type NotifyListener struct {
	manager.ResourceManager
	// contains filtered or unexported fields
}

func NewNotifyListener

func NewNotifyListener(
	manager manager.ResourceManager,
	cache *sync.Map,
	writer events.Emitter,
	grc *ApplicationContext,
) *NotifyListener

func (*NotifyListener) Notify

func (l *NotifyListener) Notify(event *registry.ServiceEvent)

func (*NotifyListener) NotifyAll

func (l *NotifyListener) NotifyAll(events []*registry.ServiceEvent, f func())

func (*NotifyListener) NotifyAllInstances

func (l *NotifyListener) NotifyAllInstances(events []*AdminInstanceEvent, f func())

func (*NotifyListener) NotifyInstance

func (l *NotifyListener) NotifyInstance(event *AdminInstanceEvent)

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry(delegate dubboRegistry.Registry, sdDelegate dubboRegistry.ServiceDiscovery, ctx *ApplicationContext, infCtx *InterfaceContext) *Registry

func (*Registry) Delegate

func (r *Registry) Delegate() dubboRegistry.Registry

func (*Registry) Destroy

func (r *Registry) Destroy() error

func (*Registry) Subscribe

func (r *Registry) Subscribe(
	metadataReport report.MetadataReport,
	resourceManager core_manager.ResourceManager,
	cache *sync.Map,
	discovery dubboRegistry.ServiceDiscovery,
	out events.Emitter,
	systemNamespace string,
) error

type ServiceMappingChangedListenerImpl

type ServiceMappingChangedListenerImpl struct {
	// contains filtered or unexported fields
}

func NewMappingListener

func NewMappingListener(
	interfaceKey string,
	oldServiceNames *gxset.HashSet,
	listener registry.NotifyListener,
	writer events.Emitter,
	systemNamespace string,
	delSDRegistry registry.ServiceDiscovery,
	ctx *ApplicationContext,
) *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

Jump to

Keyboard shortcuts

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