Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // NewSession opens a new AMQP session to the server. NewSession(opts ...amqp.SessionOption) (Session, error) // Close disconnects the connection. Close() error }
Client is an interface for the subset of go-amqp *Client functions that we actually use, adapted slightly to also interact with our own custom Session interface. Using these interfaces in our messaging abstraction, instead of using the go-amqp types directly, allows for the possibility of utilizing mock implementations for testing purposes. Adding only the subset of functions that we actually use limits the effort involved in creating such mocks.
type Receiver ¶
type Receiver interface { // Receive a Message. Receive(ctx context.Context) (*amqp.Message, error) // Close closes the Sender and AMQP link. Close(ctx context.Context) error }
Receiver is an interface for the subset of go-amqp *Receiver functions that we actually use. Using this interface in our messaging abstraction, instead of using the go-amqp type directly, allows for the possibility of utilizing mock implementations for testing purposes. Adding only the subset of functions that we actually use limits the effort involved in creating such mocks.
type Sender ¶
type Sender interface { // Send sends a Message. Send(ctx context.Context, msg *amqp.Message) error // Close closes the Sender and AMQP link. Close(ctx context.Context) error }
Sender is an interface for the subset of go-amqp *Sender functions that we actually use. Using this interface in our messaging abstraction, instead of using the go-amqp type directly, allows for the possibility of utilizing mock implementations for testing purposes. Adding only the subset of functions that we actually use limits the effort involved in creating such mocks.
type Session ¶
type Session interface { // NewSender opens a new sender link on the session. NewSender(opts ...amqp.LinkOption) (Sender, error) // NewReceiver opens a new receiver link on the session. NewReceiver(opts ...amqp.LinkOption) (Receiver, error) // Close gracefully closes the session. Close(ctx context.Context) error }
Session is an interface for the subset of go-amqp *Session functions that we actually use, adapted slightly to also interact with our own custom Sender interface. Using these interfaces in our messaging abstraction, instead of using the go-amqp types directly, allows for the possibility of utilizing mock implementations for testing purposes. Adding only the subset of functions that we actually use limits the effort involved in creating such mocks.