Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
Register registers an instance with this discovery service Upon successful registration, this instance of the discovery service will send periodic heartbeats to check the service it alive, and is then responsible for removing it if it dies
func Unregister ¶
Unregister removes an instance, by ID, plus any endpoints running within this instance
Types ¶
type Endpoint ¶
type Endpoint struct { // Name of this endpoint Name string // Subscribe is the topic to SUB to if this endpoint is a subscription endpoint Subscribe string // Sla that this endpoint promises to keep Sla Sla }
Endpoint is a single H2 endpoint which can either be called via REQ/REP or will SUB to messages (for PUB/SUB)
type Filter ¶
Filter defines a single way of filtering out instances, where returning true indicates something SHOULD be removed (filtered out)
func MatchingService ¶
MatchingService filter by service name (exact match)
func MatchingServicePrefix ¶
MatchingServicePrefix filter by service name
type Instance ¶
type Instance struct { Id string Hostname string MachineClass string Name string Description string AzName string Source string OwnerEmail string OwnerMobile string OwnerTeam string Version uint64 Endpoints []*Endpoint }
Instance is a single running version of a service on a single host
func (Instance) GetSubTopics ¶
GetSubTopics returns a list of the Subscribe topics for each Endpoint this instance contains
type Instances ¶
type Instances []*Instance
Instances represents a list of instances
func AllInstances ¶
func AllInstances() Instances
AllInstances returns a snapshot of all instances for further in-memory manipulation
type Sla ¶
type Sla struct { // Mean is the mean avg response time (time to generate response) promised for this endpoint Mean uint32 // Upper95 is 95th percentile response promised for this endpoint Upper95 uint32 }
Sla defines how we expect an instance to perform in terms of response times, resource usage etc.