Documentation ¶
Index ¶
- Constants
- type Connector
- func (c *Connector) GetAllServices() ([]*discovery.MicroService, error)
- func (c *Connector) GetServiceExistence(microServiceId string) bool
- func (c *Connector) GetServiceInstances(entries []*event.MicroserviceEntry) map[string][]*discovery.MicroServiceInstance
- func (c *Connector) RefreshAppInstanceWatcherCache(appWatcherIds sync.Map)
- func (c *Connector) RegisterAppInstanceWatcher(name string, appId string, callback func(event event.ChangeEvent)) (string, error)
- func (c *Connector) UnregisterInstanceWatcher(serviceId string) error
- type Controller
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 (*Connector) GetAllServices ¶
func (c *Connector) GetAllServices() ([]*discovery.MicroService, error)
Retrieve all service center MicroServices, without their instances, from the registry.
func (*Connector) GetServiceExistence ¶
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 ¶
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 ¶
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
Click to show internal directories.
Click to hide internal directories.