disway

package module
v0.0.0-...-8b1a11d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWSAlreadyOpen = errors.New("web socket already opened")

ErrWSAlreadyOpen is thrown when you attempt to open a websocket that already is open.

View Source
var ErrWSNotFound = errors.New("no websocket connection exists")

ErrWSNotFound is thrown when you attempt to use a websocket that doesn't exist

View Source
var ErrWSShardBounds = errors.New("ShardID must be less than ShardCount")

ErrWSShardBounds is thrown when you try to use a shard ID that is more than the total shard count

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	// contains filtered or unexported fields
}

func NewCluster

func NewCluster(token string, logger *slog.Logger, opts ...sharding.ConfigOpt) *Cluster

func (*Cluster) AddAllEventListener

func (c *Cluster) AddAllEventListener(f func(s int, t distype.EventType, e any))

func (*Cluster) AddEventListener

func (c *Cluster) AddEventListener(t distype.EventType, f func(s int, e any))

func (*Cluster) Close

func (c *Cluster) Close(ctx context.Context)

func (*Cluster) Open

func (c *Cluster) Open(ctx context.Context)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL