server

package
v0.0.0-...-b62c219 Latest Latest
Warning

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

Go to latest
Published: May 12, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package server provides the stateless container for Lavalink.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PlayerAction

type PlayerAction struct {
	Action string `json:"action"`
	Track  string `json:"track,omitempty"`
	Paused bool   `json:"paused,omitempty"`
}

PlayerAction represents an action to be taken when modifying the playing state of a player

type Server

type Server struct {
	Conn  *lavalink.Connection
	HTTP  *lavalink.HTTP
	Cache store.Lavalink
	Queue queue.Queue
}

Server represents a server to front a single Lavalink node. Multiple servers must be launched to handle multiple nodes.

func (*Server) GetNode

func (s *Server) GetNode(ctx *fasthttp.RequestCtx)

GetNode gets the given node

func (*Server) GetPlayer

func (s *Server) GetPlayer(ctx *fasthttp.RequestCtx)

GetPlayer gets the player for the given guild

func (*Server) GetSong

func (s *Server) GetSong(ctx *fasthttp.RequestCtx)

GetSong gets the given song from the given queue

func (*Server) GetSongs

func (s *Server) GetSongs(ctx *fasthttp.RequestCtx)

GetSongs gets songs for the given guild

func (*Server) PatchSongs

func (s *Server) PatchSongs(ctx *fasthttp.RequestCtx)

PatchSongs adds songs to the given queue

func (*Server) PutPlayer

func (s *Server) PutPlayer(ctx *fasthttp.RequestCtx)

PutPlayer modifies the playing state of the player

func (*Server) PutSongs

func (s *Server) PutSongs(ctx *fasthttp.RequestCtx)

PutSongs sets the songs for a given queue

func (*Server) Serve

func (s *Server) Serve(addr string)

Serve data from this server

Jump to

Keyboard shortcuts

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