servicecenter

package
v0.0.0-...-b133e42 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Time in seconds to wait before re-registering a deleted Servicecomb Service Center Watcher service
	REREGISTER_INTERVAL time.Duration = time.Second * 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector struct {
	AppInstanceWatcherCache sync.Map // Maps appId to id of a instance watcher service. Need app-specific watchers to avoid cross-app errors.
	// contains filtered or unexported fields
}

Servicecomb Service Center go-chassis client

func NewConnector

func NewConnector(addr string) *Connector

func (*Connector) GetAllServices

func (c *Connector) GetAllServices() ([]*discovery.MicroService, error)

Retrieve all service center MicroServices, without their instances, from the registry.

func (*Connector) GetServiceExistence

func (c *Connector) GetServiceExistence(microServiceId string) bool

Check whether a service center MicroService exists in the registry.

func (*Connector) GetServiceInstances

func (c *Connector) GetServiceInstances(entries []*event.MicroserviceEntry) map[string][]*discovery.MicroServiceInstance

GetServiceInstances fetch newly received service instances.

func (*Connector) RefreshAppInstanceWatcherCache

func (c *Connector) RefreshAppInstanceWatcherCache(appWatcherIds sync.Map)

Save the ids of currently active service center Watcher services mapped to the appIds that they are responsible for.

func (*Connector) RegisterAppInstanceWatcher

func (c *Connector) RegisterAppInstanceWatcher(name string, appId string, callback func(event event.ChangeEvent)) (string, error)

Register a new service center Watcher service that watches instance-level change events for all service center services sharing a specific appId.

func (*Connector) UnregisterInstanceWatcher

func (c *Connector) UnregisterInstanceWatcher(serviceId string) error

Unregister a service center Watcher service.

type Controller

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

func NewController

func NewController(addr string, e chan []event.ChangeEvent) *Controller

func (*Controller) Run

func (c *Controller) Run(ctx context.Context)

Run until a stop signal is received

func (*Controller) Stop

func (c *Controller) Stop()

Stop the controller.

Jump to

Keyboard shortcuts

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