Documentation
¶
Overview ¶
Package dizzy contains a implementation of a websocket client to discord
Index ¶
- Variables
- type Client
- type DeregisterFunction
- type EventDistributor
- func (e *EventDistributor) FireEvent(event primitives.GatewayEvent)
- func (e *EventDistributor) RegisterHandler(eventType primitives.GatewayEventType, handler EventHandler) DeregisterFunction
- func (e *EventDistributor) RegisterHandlerOnce(eventType primitives.GatewayEventType, handler EventHandler)
- func (e *EventDistributor) WaitTilDone()
- type EventHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorNoACKAfterHeartbeat = fmt.Errorf("dizzy: did not receive an ACK after sending a heartbeat")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(apikey, endpoint string, intents primitives.GatewayIntent, eDist eDist, logger logging.Logger) *Client
func (*Client) AddHandlerFunc ¶
func (c *Client) AddHandlerFunc(eventType primitives.GatewayEventType, handlerFunc func(event primitives.GatewayEvent)) error
type DeregisterFunction ¶
type DeregisterFunction func()
DeregisterFunction is a function that is called to remove an EventHandler from the EventDistributor
type EventDistributor ¶
EventDistributor for events
func NewEventDistributor ¶
func NewEventDistributor() *EventDistributor
NewEventDistributor for events
func (*EventDistributor) FireEvent ¶
func (e *EventDistributor) FireEvent(event primitives.GatewayEvent)
FireEvent to all listening EventHandler(s)
func (*EventDistributor) RegisterHandler ¶
func (e *EventDistributor) RegisterHandler(eventType primitives.GatewayEventType, handler EventHandler) DeregisterFunction
RegisterHandler to be called when an Event is fired
func (*EventDistributor) RegisterHandlerOnce ¶
func (e *EventDistributor) RegisterHandlerOnce(eventType primitives.GatewayEventType, handler EventHandler)
RegisterHandlerOnce lets an EventHandler be called and then removed after being called exactly once
func (*EventDistributor) WaitTilDone ¶
func (e *EventDistributor) WaitTilDone()
WaitTilDone with all Events
type EventHandler ¶
type EventHandler func(event primitives.GatewayEvent)
EventHandler function that is called on a event
Click to show internal directories.
Click to hide internal directories.