reprproxy

package
v0.0.0-...-de830e9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2014 License: BSD-2-Clause Imports: 7 Imported by: 0

README

reprproxy

The reprproxy manages representations of remote agents.

Architecture

TODO

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

View Source
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

type AgentDiscovery interface {
	Subscribe(chan<- []string)
	Unsubscribe(chan<- []string)
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL