package
3.4.0
Repository: https://github.com/diamondburned/arikawa.git
Documentation: pkg.go.dev

# Packages

Package ophandler provides an Op channel reader that redistributes the events into handlers.

# Functions

IsBrokenConnection returns true if the error is a broken connection error.
NewBroadcaster creates a new broadcaster.
NewCodec creates a new default Codec instance.
NewConn creates a new default websocket connection with a default dialer.
NewConnWithDialer creates a new default websocket connection with a custom dialer.
NewCustomWebsocket creates a new undialed Websocket.
NewDecodeBuffer creates a new preallocated DecodeBuffer.
NewDialLimiter returns a rate limiter for throttling new gateway connections.
NewGateway creates a new Gateway with a custom gateway URL and a pre-existing Identifier.
NewGlobalIdentityLimiter returns a rate limiter for throttling global gateway Identify commands.
NewIdentityLimiter returns a rate limiter for throttling gateway Identify commands.
NewOpUnmarshalers creates a nwe OpUnmarshalers instance from the given constructor functions.
NewSendLimiter returns a rate limiter for throttling gateway commands.
NewWebsocket creates a default Websocket with the given address.
ReadOp reads a single Op.
ReadOps reads maximum n Ops and accumulate them into a slice.

# Variables

DefaultGatewayOpts is the default event loop options.
EnableRawEvents, if true, will cause ws to generate a RawEvent for each regular Event.
ErrWebsocketClosed is returned if the websocket is already closed.
SendBurst determines the number of gateway commands that can be sent all at once before being throttled.
WSDebug is used for extra debug logging.
WSError is the default error handler.

# Structs

BackgroundErrorEvent describes an error that the gateway event loop might stumble upon while it's running.
Broadcaster is primarily used for debugging.
CloseEvent is an event that is given from wsutil when the websocket is closed.
Codec holds the codec states for Websocket implementations to share with the manager.
Conn is the default Websocket connection.
ConnectionError is given to the user if the gateway fails to connect to the gateway for any reason, including during an initial connection or a reconnection.
DecodeBuffer boxes a byte slice to provide a shared and thread-unsafe buffer.
Gateway describes an instance that handles the Discord gateway.
GatewayOpts describes the gateway event loop options.
Op is a gateway Operation.
OpUnmarshalers contains a map of event constructor function.
RawEvent is used if EnableRawEvents is true.
UnknownEventError is required by HandleOp if an event is encountered that is not known.
Websocket is a wrapper around a websocket Conn with thread safety and rate limiting for sending and throttling.

# Interfaces

Connection is an interface that abstracts around a generic Websocket driver.
Event describes an Event data that comes from a gateway Operation.
Handler describes a gateway handler.

# Type aliases

EventType is a type for event types, which is the "t" field in the payload.
OpCode is the type for websocket Op codes.
OpFunc is a constructor function for an Operation.