plugin

package
v0.0.0-...-a9562c4 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2014 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileWatcherPrefix = "receptor-watcher-"
	FileReactorPrefix = "receptor-reactor-"
)

Plugin filename patterns

Variables

This section is empty.

Functions

func ServeReactor

func ServeReactor(reactor pipe.Reactor)

func ServeWatcher

func ServeWatcher(watcher pipe.Watcher)

ServeWatcher exports the watcher as a plugin

Types

type Lookup

type Lookup struct {
	// contains filtered or unexported fields
}

Lookup looks up plugins and manages the setup and teardown phase.

func NewLookup

func NewLookup(pluginPath string) *Lookup

NewLookup creates a new Looup instance

func (*Lookup) Cleanup

func (s *Lookup) Cleanup(timeout time.Duration)

Cleanup kills all plugin processes and removes sockets. Each cleanup step times out in parallel, which results in a potentional higher timeout for the whole cleanup. Blocks until completed.

func (*Lookup) Reactor

func (s *Lookup) Reactor(name string) (pipe.Reactor, error)

Reactor looks up an reactor identified by name. Manages the startup of the associated plugin-process.

func (*Lookup) Watcher

func (s *Lookup) Watcher(name string) (pipe.Watcher, error)

Watcher looks up an watcher identified by name. Manages the startup of the associated plugin-process.

type LookupService

type LookupService interface {
	Watcher(name string) (pipe.Watcher, error)
	Reactor(name string) (pipe.Reactor, error)
	Cleanup(timeout time.Duration)
}

LookupService looks up watchers and reactors.

type Process

type Process struct {
	// contains filtered or unexported fields
}

Process manages the start and shutdown of a plugin process

func NewProcess

func NewProcess(path string, args []string, actorName string) *Process

func (*Process) Start

func (p *Process) Start() error

func (*Process) Stop

func (p *Process) Stop()

func (*Process) Wait

func (p *Process) Wait()

func (*Process) WaitCh

func (p *Process) WaitCh() <-chan struct{}

type RPCReactor

type RPCReactor struct {
	// contains filtered or unexported fields
}

RPCReactor defines a remotely executed reactor

func NewRPCReactor

func NewRPCReactor(socket string) (*RPCReactor, error)

func (*RPCReactor) Accept

func (r *RPCReactor) Accept(cfg json.RawMessage) (pipe.Endpoint, error)

Handle job and return a handler to start

func (*RPCReactor) Setup

func (r *RPCReactor) Setup(cfg json.RawMessage) error

type RPCReactorEndpoint

type RPCReactorEndpoint struct {
	// contains filtered or unexported fields
}

func (*RPCReactorEndpoint) Handle

func (e *RPCReactorEndpoint) Handle(eventCh chan pipe.Event, closeCh chan struct{})

type RPCWatcher

type RPCWatcher struct {
	// contains filtered or unexported fields
}

RPCWatcher defines a remotely executed watcher

func NewRPCWatcher

func NewRPCWatcher(socket string) (*RPCWatcher, error)

func (*RPCWatcher) Accept

func (w *RPCWatcher) Accept(cfg json.RawMessage) (pipe.Endpoint, error)

Handle job and return a handler to start watching

func (*RPCWatcher) Setup

func (w *RPCWatcher) Setup(cfg json.RawMessage) error

type RPCWatcherEndpoint

type RPCWatcherEndpoint struct {
	// contains filtered or unexported fields
}

func (*RPCWatcherEndpoint) Handle

func (e *RPCWatcherEndpoint) Handle(eventCh chan pipe.Event, closeCh chan struct{})

Jump to

Keyboard shortcuts

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