Documentation ¶
Index ¶
- type ConnectOptions
- type Connection
- func (c *Connection) Destroy(guildID uint64) error
- func (c *Connection) Pause(guildID uint64, pause bool) error
- func (c *Connection) Play(guildID uint64, track string, start, end int) error
- func (c *Connection) Read(p []byte) (int, error)
- func (c *Connection) ReadJSON(p interface{}) error
- func (c *Connection) Seek(guildID uint64, position int) error
- func (c *Connection) Send(d interface{}) error
- func (c *Connection) SetEqualizer(guildID uint64, bands []types.EqualizerBand) error
- func (c *Connection) SetVolume(guildID uint64, volume int) error
- func (c *Connection) Stop(guildID uint64) error
- func (c *Connection) Store(store store.Lavalink) (err error)
- func (c *Connection) VoiceUpdate(guildID uint64, sessionID string, event types.VoiceServerUpdate) error
- func (c *Connection) Write(p []byte) (int, error)
- type HTTP
- func (h *HTTP) DecodeTrack(identifier string) (track types.TrackInfo, err error)
- func (h *HTTP) DecodeTracks(identifiers []string) (tracks []types.TrackInfo, err error)
- func (h *HTTP) DoJSON(method, path string, d interface{}, genQuery func(q url.Values)) (res *http.Response, err error)
- func (h *HTTP) LoadTrack(identifier string) (track types.TrackResponse, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectOptions ¶
type ConnectOptions struct { Name string Endpoint string Password string ShardCount int UserID uint64 Dialer *websocket.Dialer }
ConnectOptions are the options used when connecting to the Lavalink server
type Connection ¶
type Connection struct { Name string // contains filtered or unexported fields }
Connection represents a WebSocket connection to a Lavalink server
func Connect ¶
func Connect(opts ConnectOptions) (*Connection, error)
Connect this node to the given node
func (*Connection) Destroy ¶
func (c *Connection) Destroy(guildID uint64) error
Destroy destroys this player
func (*Connection) Pause ¶
func (c *Connection) Pause(guildID uint64, pause bool) error
Pause this guild
func (*Connection) Play ¶
func (c *Connection) Play(guildID uint64, track string, start, end int) error
Play a track
func (*Connection) ReadJSON ¶
func (c *Connection) ReadJSON(p interface{}) error
ReadJSON into the value pointed at by p
func (*Connection) Seek ¶
func (c *Connection) Seek(guildID uint64, position int) error
Seek to a specific point in the current track
func (*Connection) Send ¶
func (c *Connection) Send(d interface{}) error
Send JSON to this connection
func (*Connection) SetEqualizer ¶
func (c *Connection) SetEqualizer(guildID uint64, bands []types.EqualizerBand) error
SetEqualizer sets the equalizer
func (*Connection) SetVolume ¶
func (c *Connection) SetVolume(guildID uint64, volume int) error
SetVolume sets the volume
func (*Connection) Store ¶
func (c *Connection) Store(store store.Lavalink) (err error)
Store consumes events from Lavalink and stores them in the given cache. Since this reads events from the WebSocket, no other goroutines should attempt to read.
func (*Connection) VoiceUpdate ¶
func (c *Connection) VoiceUpdate(guildID uint64, sessionID string, event types.VoiceServerUpdate) error
VoiceUpdate sends a voiceUpdate packet to Lavalink
type HTTP ¶
HTTP handles HTTP requests to Lavalink
func (*HTTP) DecodeTrack ¶
DecodeTrack from the given endpoint
func (*HTTP) DecodeTracks ¶
DecodeTracks from the given endpoint