Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceDiscovery ¶
type ServiceDiscovery interface { // RegisterWorker or re-register worker with a heartBeat timestamp that proves the worker is alive and well. RegisterWorker(worker ServiceWorker, heartBeatTime time.Time) error // ListWorkers for a ServiceRole, earliestLastSeen is used to filter out workers that haven't hearbeat after said time ListWorkers(service ServiceRole, earliestLastSeen time.Time) ([]*ServiceWorker, error) }
ServiceDiscovery allows us to find workers for a serviceRole and also to register a worker that belongs to a serviceRole
type ServiceRole ¶
type ServiceRole struct { ServiceName string // name of the service this server belongs to (FooService) Role string // role of this server, ie: apiserver, adminserver, worker DeployGroup string // many deployments, ie: dev, prod-us, prod-eu, etc.. }
ServiceRole specifies a service we run on a specific deployment unit
func (*ServiceRole) ServiceId ¶
func (svc *ServiceRole) ServiceId() string
type ServiceWorker ¶
type ServiceWorker struct { Service ServiceRole WorkerId string LastSeen time.Time Endpoint string }
ServiceWorker is an instance that runs a given service
Directories ¶
Path | Synopsis |
---|---|
package dynamodb implements ServiceDiscovery interface using dynamodb tables.
|
package dynamodb implements ServiceDiscovery interface using dynamodb tables. |
inmemory implements a in memory only service discovery
|
inmemory implements a in memory only service discovery |
Click to show internal directories.
Click to hide internal directories.