component

package
v0.0.0-...-7a5359b Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigurationCenter

type ConfigurationCenter interface {
	Start() error

	Events() <-chan *types.ConfigEvent

	FindConfiguratorConfig(serviceName string) *types.ConfiguratorConfig

	Stop() error
}

ConfigurationCenter ...

type Converter

type Converter interface {
	// ToConfiguredService convert service to cs
	ToConfiguredService(s *types2.ServiceEvent) *v1.ConfiguredService

	// ToServiceConfig
	ToServiceConfig(cc *types2.ConfiguratorConfig) *v1.ServiceConfig
}

Converter a series of operation for convert meshach's model to CRD it allows that there are differences between various registry such as zk, nanos, etc. finally all services and configs will be convert to the unified models we have defined.

type EventHandler

type EventHandler interface {
	// AddService you should handle the event described that a service has been created
	AddService(event *types.ServiceEvent)
	// DeleteService you should handle the event describe that a service has been removed
	DeleteService(event *types.ServiceEvent)
	// AddInstance you should handle the event described that an instance has been registered
	AddInstance(event *types.ServiceEvent)
	// AddInstance you should handle the event described that an instance has been registered
	ReplaceInstances(event *types.ServiceEvent)
	// AddInstance you should handle the event describe that an instance has been unregistered
	DeleteInstance(event *types.ServiceEvent)

	// ReplaceAccessorInstances replacing the instances' host in an accessor CR should be done when
	// a subscribed mapping between any accessor and any service has been changed.
	ReplaceAccessorInstances(event *types.ServiceEvent, getScopedServices func(s string) map[string]struct{})

	// AddConfigEntry you should handle the event depicted that a dynamic configuration has been added
	AddConfigEntry(event *types.ConfigEvent)
	// ChangeConfigEntry you should handle the event depicted that a dynamic configuration has been changed
	ChangeConfigEntry(event *types.ConfigEvent)
	// DeleteConfigEntry you should handle the event depicted that a dynamic configuration has been deleted
	DeleteConfigEntry(event *types.ConfigEvent)
}

EventHandler described all component comes from adapter needs to be handle by various event handler.

type Registry

type Registry interface {
	Start() error

	// Received the notification component indicates services or instances has been modified.
	ServiceEvents() <-chan *types.ServiceEvent

	// Received all accessors that accesses a service.
	AccessorEvents() <-chan *types.ServiceEvent

	// GetCachedScopedMapping Retrieve the services with the scoped key from the cache.
	GetCachedScopedMapping(scopedKey string) map[string]struct{}

	GetCachedService(serviceName string) *types.Service

	Stop()
}

Registry ...

Jump to

Keyboard shortcuts

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