Documentation ¶
Index ¶
- func ETFPayloadToMessage(ctx context.Context, ep ETFPayload) (wsapi.WSMessage, error)
- type DispatchHandlerFunc
- type Dispatcher
- func (c *Dispatcher) AddHandler(event string, handler DispatchHandlerFunc)
- func (c *Dispatcher) ConnectToBot(b *bot.DiscordBot)
- func (c *Dispatcher) GenerateHeartbeat(reqCtx context.Context, seqNum int) (wsapi.WSMessage, error)
- func (c *Dispatcher) HandleRequest(req wsapi.WSMessage, resp chan<- wsapi.WSMessage) snowflake.Snowflake
- func (c *Dispatcher) SetDebug(val bool)
- type ETFPayload
- type Logger
- type Payload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ETFPayloadToMessage ¶
ETFPayloadToMessage converts a specialized etf payload to a websocket message
Types ¶
type DispatchHandlerFunc ¶
type DispatchHandlerFunc = func(Payload, wsapi.WSMessage, chan<- wsapi.WSMessage) snowflake.Snowflake
DispatcherFunc is the api that a bot expects a handler function to have
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶
func NewDispatcher(deps dependencies) *Dispatcher
NewDispatcher creates a new Dispatcher object with default state and session management handlers installed
func (*Dispatcher) AddHandler ¶
func (c *Dispatcher) AddHandler(event string, handler DispatchHandlerFunc)
func (*Dispatcher) ConnectToBot ¶
func (c *Dispatcher) ConnectToBot(b *bot.DiscordBot)
func (*Dispatcher) GenerateHeartbeat ¶
func (*Dispatcher) HandleRequest ¶
func (*Dispatcher) SetDebug ¶
func (c *Dispatcher) SetDebug(val bool)
type ETFPayload ¶
ETFPayload is the interface that a specialized etf api payload conforms to
Click to show internal directories.
Click to hide internal directories.