Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLocalTransportPair ¶
func NewLocalTransportPair() (*LocalTransport, *LocalTransport)
Create a linked pair of LocalTransport instances. This is similar to the POSIX pipe() method.
Types ¶
type FakeWorker ¶
type FakeWorker struct { // The protocol with which to communicate with this worker. Use this // as a protocol for testing worker-runner. RunnerProtocol *protocol.Protocol // The protocol representing the worker side; register for messages on // this to confirm that messages were received WorkerProtocol *protocol.Protocol // contains filtered or unexported fields }
FakeWorker implements a fake worker, in terms of the protocol at least
func NewFakeWorkerWithCapabilities ¶
func NewFakeWorkerWithCapabilities(capabilities ...string) *FakeWorker
Create a new fake worker with the given capabilities. The worker side of this protocol is started, but the runner side is not -- that is up to the caller.
func (*FakeWorker) Close ¶
func (wkr *FakeWorker) Close()
Close down the fake worker. Call this to dispose of resources.
func (*FakeWorker) MessageReceivedFunc ¶
func (wkr *FakeWorker) MessageReceivedFunc(msgType string, matcher func(msg protocol.Message) bool) func() bool
Generate a function that can be called to assert that message of the given type has or has not been received. This is useful for building assertions.
type LocalTransport ¶
type LocalTransport struct {
// contains filtered or unexported fields
}
LocalTransport is a transport for which both sides are in the same process.
func (*LocalTransport) Close ¶
func (transp *LocalTransport) Close()
func (*LocalTransport) Send ¶
func (transp *LocalTransport) Send(msg protocol.Message)
Click to show internal directories.
Click to hide internal directories.