Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NodeTracker ¶
type NodeTracker interface { // Runs the node tracker until the context is closed. Run(ctx context.Context) // List returns a list of all nodes being tracked. The list returned will be // a copy of the underlying list of nodes. Intended for admin interfaces, // not performance critical code. Thread safe. List() []string // Select will use the provided key to pick a node from the list of tracked // nodes and return it. Returns an error if there are no nodes available. // Thread safe. Select(key uint64) (string, error) }
NodeTracker is an interface for tracking and selecting nodes in a cluster
func NewRedisNodeTracker ¶
func NewRedisNodeTracker(redisAddr, namespace, nodeid string, updateInterval, expiryInterval time.Duration) NodeTracker
NewRedisNodeTracker returns a NodeTracker based on a Redis backend
Click to show internal directories.
Click to hide internal directories.