Documentation
¶
Overview ¶
Package rocket implements a rocket.chat adapter for the joe bot library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BotAdapter ¶
type BotAdapter struct {
// contains filtered or unexported fields
}
BotAdapter implements a joe.Adapter that reads and writes messages to and from Rocket.Chat.
func NewAdapter ¶
func NewAdapter(ctx context.Context, conf Config) (*BotAdapter, error)
NewAdapter creates a new *BotAdapter that connects to Rocket.Chat. Note that you will usually configure the slack adapter as joe.Module (i.e. using the Adapter function of this package).
func (*BotAdapter) Close ¶
func (a *BotAdapter) Close() error
Close disconnects the adapter from the rocket.chat API.
func (*BotAdapter) RegisterAt ¶
func (a *BotAdapter) RegisterAt(brain *joe.Brain)
RegisterAt implements the joe.Adapter interface by emitting the slack API events to the given brain.
func (*BotAdapter) Send ¶
func (a *BotAdapter) Send(text, channelID string) error
Send implements joe.Adapter by sending all received text messages to the given rocket.chat channel ID.
type Config ¶
type Config struct { Email string Password string ServerURL *url.URL Name string Debug bool Logger *zap.Logger // contains filtered or unexported fields }
Config contains the configuration of a BotAdapter.
type IDGen ¶
IDGen represents the capacity to generate unique ID for each message, as rocket.chat requires. ksuids would be great, but that would be an external dependency.