Documentation
¶
Overview ¶
Package reprproxy implements a proxy for (or an aggregation of) multiple remote agent representations. The proxy is a single point of interaction for all agents.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Debugf may be set from a controlling package. Debugf = func(string, ...interface{}) {} // NewAgentRepresentation is a factory function for creating // representations when the AgentDiscovery detects changes. It may be // swapped for tests. NewAgentRepresentation = newRealRepr )
Functions ¶
func New ¶
func New(d AgentDiscovery) *proxy
New creates and returns a new Aggreegator. It instantiates (and terminates) agent representations based on wisdom received from the AgentDiscovery component.
func NewFakeRepr ¶
func NewFakeRepr(endpoint string) agentrepr.Representation
NewFakeRepr may be swapped for NewAgentRepresentation in tests.
Types ¶
type AgentDiscovery ¶
AgentDiscovery allows components to find out about the remote agents available in a scheduling domain.
type Proxy ¶
type Proxy interface { Subscribe(c chan<- map[string]agent.StateEvent) Unsubscribe(c chan<- map[string]agent.StateEvent) Schedule(endpoint, id string, c agent.ContainerConfig) error Unschedule(endpoint, id string) error Snapshot() map[string]agent.StateEvent Quit() }
Proxy defines everything needed from a Proxy implementation. It collects a bunch of individual remote agents, and provides a unified interface to them.
Proxy safisfies the xf.ActualBroadcaster and xf.TaskScheduler interfaces.
type StaticAgentDiscovery ¶
type StaticAgentDiscovery []string
StaticAgentDiscovery encodes a fixed set of endpoints.
func (StaticAgentDiscovery) Subscribe ¶
func (d StaticAgentDiscovery) Subscribe(c chan<- []string)
Subscribe satisfies the AgentDiscovery interface.
func (StaticAgentDiscovery) Unsubscribe ¶
func (d StaticAgentDiscovery) Unsubscribe(chan<- []string)
Unsubscribe satisfies the AgentDiscovery interface.