Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct { *ResponseRecorder *MessagePlayer }
Adapter provides a test adapter you can preload with messages, and retrieve messages from.
type MessagePlayer ¶
MessagePlayer can be used to pass a channel of messages into a bot.
func (*MessagePlayer) Receive ¶
func (mp *MessagePlayer) Receive() <-chan *hugot.Message
Receive will return a mesasge from the player's channel.
type ResponseRecorder ¶
type ResponseRecorder struct { MessagesOut chan hugot.Message // contains filtered or unexported fields }
ResponseRecorder will send all messages a handler writes to it out of the provided channel.
func (*ResponseRecorder) Send ¶
func (rr *ResponseRecorder) Send(ctx context.Context, m *hugot.Message)
Send is called to send a message to the recorder's channel.
func (*ResponseRecorder) SetChannel ¶
func (rr *ResponseRecorder) SetChannel(c string)
SetChannel is used to decide which channel data sent use Write will be sent on.
func (*ResponseRecorder) SetTo ¶
func (rr *ResponseRecorder) SetTo(to string)
SetTo tells the record who to send data sent with Write to.
Click to show internal directories.
Click to hide internal directories.