Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoAvailableServers is returned when there are no available servers ErrNoAvailableServers = errors.New("no available M-Lab servers") )
Functions ¶
func NewHeartbeatStatusTracker ¶
func NewHeartbeatStatusTracker(client MemorystoreClient[v2.HeartbeatMessage]) *heartbeatStatusTracker
NewHeartbeatStatusTracker returns a new StatusTracker implementation that uses a Memorystore client to cache (and later import) instance data from the Heartbeat Service. StopImport() must be called to release resources.
Types ¶
type Locator ¶
type Locator struct {
StatusTracker
}
Locator manages requests to "locate" mlab-ns servers.
func NewServerLocator ¶
func NewServerLocator(tracker StatusTracker) *Locator
NewServerLocator creates a new Locator instance.
type MemorystoreClient ¶
type MemorystoreClient[V any] interface { Put(key string, field string, value redis.Scanner, expire bool) error GetAll() (map[string]V, error) }
MemorystoreClient is a client for reading and writing data in Memorystore. The interface takes in a type argument which specifies the types of values that are stored and can be retrived.
type StatusTracker ¶
type StatusTracker interface { RegisterInstance(rm v2.Registration) error UpdateHealth(hostname string, hm v2.Health) error UpdatePrometheus(hostnames, machines map[string]bool) error Instances() map[string]v2.HeartbeatMessage StopImport() }
StatusTracker defines the interface for tracking the status of experiment instances.
Click to show internal directories.
Click to hide internal directories.