Documentation ¶
Overview ¶
Package flow can be used to test MQTT packet flows.
Index ¶
- type Conn
- type Flow
- func (f *Flow) Close() *Flow
- func (f *Flow) Delay(d time.Duration) *Flow
- func (f *Flow) End() *Flow
- func (f *Flow) Receive(pkt packet.GenericPacket) *Flow
- func (f *Flow) Run(fn func()) *Flow
- func (f *Flow) Send(pkt packet.GenericPacket) *Flow
- func (f *Flow) Skip() *Flow
- func (f *Flow) Test(conn Conn) error
- func (f *Flow) TestAsync(conn Conn, timeout time.Duration) <-chan error
- func (f *Flow) Wait(ch chan struct{}) *Flow
- type Pipe
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn interface { Send(pkt packet.GenericPacket) error Receive() (packet.GenericPacket, error) Close() error }
A Conn defines an abstract interface for connections used with a Flow.
type Flow ¶
type Flow struct {
// contains filtered or unexported fields
}
A Flow is a sequence of actions that can be tested against a connection.
func (*Flow) Receive ¶
func (f *Flow) Receive(pkt packet.GenericPacket) *Flow
Receive will receive and match one packet.
func (*Flow) Send ¶
func (f *Flow) Send(pkt packet.GenericPacket) *Flow
Send will send and one packet.
type Pipe ¶
type Pipe struct {
// contains filtered or unexported fields
}
The Pipe pipes packets from Send to Receive.
Click to show internal directories.
Click to hide internal directories.