Documentation ¶
Overview ¶
Package track provides a simple interface for tracking known proxies by endpoint/name and correctly handling expiration and exclusivity. The provided Tracker type wraps a workpool.Pool, updating per-key counts as new proxies are discovered and/or old proxies are expired.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // ProxyExpiry is the duration an entry will be held sice the last // successful connection to, or message about, a given proxy. ProxyExpiry time.Duration // TickRate is the rate at which expired entries are cleared from // the cache of known proxies. TickRate time.Duration }
Config configures basic Tracker parameters.
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
SetDefaults set default values for Config.
type Tracker ¶
type Tracker struct { Config // contains filtered or unexported fields }
Tracker is a helper for tracking proxies located behind reverse tunnels and triggering agent spawning as needed. Tracker wraps a workpool.Pool instance and manages a cache of proxies which *may* exist. As proxies are discovered, or old proxies expire, the target counts are automatically updated for the associated key in the workpool. Agents can attempt to "claim" exclusivity for a given proxy, ensuring that multiple agents are not run against the same proxy.
func (*Tracker) StopAll ¶
func (p *Tracker) StopAll()
StopAll permanently deactivates this tracker and cleans up all background goroutines.
func (*Tracker) TrackExpected ¶
TrackExpected starts/refreshes tracking for expected proxies. Called by agents when gossip messages are received.