Documentation ¶
Index ¶
- Constants
- Variables
- func IsNoAgentsErr(err error) bool
- func ListenAndServe(a Acceptor, port string, lgr lager.Lager) error
- func NewRequestReceiver(ch chan Request) mux.Receiver
- func NoAgentsErr(t string) error
- func NoAgentsFromRequest(request ResolveRequest) (err error)
- func NoAgentsWithNameErr(t string, name string) error
- func ToMultiStep(s Step) multistep.Step
- type Acceptor
- type Agent
- type AgentConn
- type BasicCommunicator
- type BasicExecutor
- type BasicJob
- type BasicRunner
- type BasicUI
- type Client
- type ClientConn
- type ClientResolver
- type ClientResolverConfig
- type Communicator
- type Config
- type ConnConfig
- type Executor
- type Job
- type MultiClientResolver
- type MultiRegistrator
- type Registrator
- type Registry
- type Request
- type RequestReceiver
- type ResolveRequest
- type Routable
- type Runner
- type StateBag
- type Step
- type StepsJob
- type UI
Constants ¶
const ( // RequestType is a mux type for requests RequestType = uint8(67) )
Variables ¶
var ( // ErrInvalidAddr = error resolving TCP addr ErrInvalidAddr = errors.New("Invalid Address") // ErrListen = error listening on TCP port ErrListen = errors.New("Unable to listen on specified port") )
var ( // ErrInvalidLager = nil Lager ErrInvalidLager = errors.New("Invalid Config Lager") // ErrInvalidPool = nil Pool ErrInvalidPool = errors.New("Invalid Config Pool") )
var ( // ErrNoConfigs occurs when there are no configs to work with ErrNoConfigs = errors.New("no configs provided") )
var ( // ErrSigReceived is used when a signal is received while running a job ErrSigReceived = errors.New("Signal Received") )
Functions ¶
func IsNoAgentsErr ¶
IsNoAgentsErr returns whether this error is a no agents responded error
func ListenAndServe ¶
ListenAndServe is a common function for listening on a port and accepting connections
func NewRequestReceiver ¶
NewRequestReceiver creates a new request receiver
func NoAgentsErr ¶
NoAgentsErr creates an error for no agents that responded with type
func NoAgentsFromRequest ¶
func NoAgentsFromRequest(request ResolveRequest) (err error)
NoAgentsFromRequest creates an error for no agents that responded from a request
func NoAgentsWithNameErr ¶
NoAgentsWithNameErr creates an error for no agents that responded with type and name
func ToMultiStep ¶
ToMultiStep converts Step to multistep.Step
Types ¶
type AgentConn ¶
type AgentConn interface { mux.Server Logs() chan string Signals() chan os.Signal Lager() lager.Lager }
AgentConn is a connection created on an agent
type BasicCommunicator ¶
BasicCommunicator is a basic implementation of Communicator
func (*BasicCommunicator) Communicate ¶
func (c *BasicCommunicator) Communicate(exitCh chan struct{})
Communicate faciliates communication the parent and child
func (*BasicCommunicator) DrainLogs ¶
func (c *BasicCommunicator) DrainLogs()
DrainLogs drains logs from the child and sends them to the parent.
func (*BasicCommunicator) ForwardSignals ¶
func (c *BasicCommunicator) ForwardSignals(exit chan struct{})
ForwardSignals forwards signals from the parent to the child. Forwarding stops when exit closes
type BasicJob ¶
type BasicJob struct {
// contains filtered or unexported fields
}
BasicJob executes a StepsJob on Run
type BasicUI ¶
BasicUI is a simple implementation of UI
type Client ¶
type Client interface { Dial(address string) (ClientConn, error) DialTimeout(address string, time time.Duration) (ClientConn, error) }
Client creates ClientConns
type ClientConn ¶
type ClientConn interface { mux.Client Run(request Request) error Logs() <-chan string Signals() chan<- os.Signal }
ClientConn is a connection to an AgentConn
type ClientResolver ¶
type ClientResolver interface {
Resolve(request ResolveRequest) (ClientConn, error)
}
ClientResolver defines the interface for a resolver client.
type ClientResolverConfig ¶
ClientResolverConfig defines the parameters for ClientResolver
type Communicator ¶
type Communicator interface { Communicate(exitCh chan struct{}) Add(num int) Done() Wait() }
Communicator defines an interface for communicating quantum connections
func NewBasicCommunicator ¶
func NewBasicCommunicator(parent AgentConn, child ClientConn) Communicator
NewBasicCommunicator creates a new basic communicator between parent and child
func NewCommunicator ¶
func NewCommunicator(parent AgentConn, child ClientConn) Communicator
NewCommunicator creates a default communicator
type ConnConfig ¶
ConnConfig are configuration settings needed for Conn
func DefaultConnConfig ¶
func DefaultConnConfig() *ConnConfig
DefaultConnConfig is the default ConnConfig
func (*ConnConfig) ToMux ¶
func (c *ConnConfig) ToMux() *mux.Config
ToMux creates a mux.Config from ConnConfig
type Job ¶
type Job interface { // Used to match requests to jobs Routable Configure([]byte) error Run(AgentConn) error }
Job is executed by Quantum
type MultiClientResolver ¶
type MultiClientResolver struct {
Resolvers []ClientResolver
}
MultiClientResolver implements ClientResolver by trying to resolve a client be iterating through provided ClientResolvers.
func (*MultiClientResolver) Resolve ¶
func (r *MultiClientResolver) Resolve(request ResolveRequest) (conn ClientConn, err error)
Resolve resolves a ResolveRequest by iterating through r.Resolvers
type MultiRegistrator ¶
type MultiRegistrator struct {
Registrators []Registrator
}
MultiRegistrator holds multiple Registry instances
func (*MultiRegistrator) Deregister ¶
func (r *MultiRegistrator) Deregister() error
Deregister calls Deregister on Registries
type Registrator ¶
Registrator registers and deregisters services
type Request ¶
Request contains Type and Data. Type is the ID, Data is the request data
func NewRequest ¶
NewRequest creates a request using the request type and request data as strings
type RequestReceiver ¶
type RequestReceiver struct {
// contains filtered or unexported fields
}
RequestReceiver receives Request
type ResolveRequest ¶
ResolveRequest describes the parameters for client resolution
type Routable ¶
type Routable interface {
Type() string
}
Routable defines an interface for routing an object