Documentation ¶
Index ¶
- Constants
- Variables
- type AddTrackData
- type GetTracksData
- type HttpClient
- func (h *HttpClient) AddTrack(guildId string, data AddTrackData) ([]Track, error)
- func (h *HttpClient) EnableLoop(guildId string, enable bool) (bool, error)
- func (h *HttpClient) FetchTrack(query string) ([]TrackData, error)
- func (h *HttpClient) GetPlayingTrack(guildId string) (*Track, error)
- func (h *HttpClient) GetTrackById(guildId string, id uuid.UUID) (*Track, error)
- func (h *HttpClient) GetTracks(guildId string, offset, limit int) (*GetTracksData, error)
- func (h *HttpClient) Pause(guildId string) (bool, error)
- func (h *HttpClient) RemoveTrack(guildId string, id uuid.UUID) (*Track, error)
- func (h *HttpClient) SetVolume(guildId string, volume uint8) (bool, error)
- func (h *HttpClient) Skip(guildId string) (*Track, error)
- func (h *HttpClient) Stop(guildId string) error
- func (h *HttpClient) Unpause(guildId string) (bool, error)
- type Track
- type TrackData
- type TrackState
Constants ¶
View Source
const ( ErrAnyCode uint8 = iota ErrTooMuchTimePausedCode ErrVoiceConnectionClosedCode ErrTrackSearchFailedCode ErrTrackSearchInvalidUrlCode ErrTrackSearchUnsuportedCode ErrTrackNotFoundInQueueCode ErrNoActivePlayerCode ErrSpotifyPlaylistsNotSupportedCode )
Variables ¶
View Source
var ( ErrTooMuchTimePaused = errors.New("muito tempo de pausa") ErrVoiceConnectionClosed = errors.New("desconectado do canal de voz") ErrTrackSearchFailed = errors.New("não foi possível encontrar a música") ErrTrackSearchInvalidUrl = errors.New("a url fornecida é inválida") ErrTrackSearchUnsuported = errors.New("a url fornecida é de uma plataforma não suportada") ErrTrackNotFoundInQueue = errors.New("não foi possível achar a música na fila") ErrNoActivePlayer = errors.New("o servidor não tem um player ativo") ErrSpotifyPlaylistsNotSupported = errors.New("playlists e álbuns do spotify não são suportados") )
Functions ¶
This section is empty.
Types ¶
type AddTrackData ¶
type GetTracksData ¶ added in v0.1.0
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient(client *http.Client, baseUrl string, password string) *HttpClient
func (*HttpClient) AddTrack ¶
func (h *HttpClient) AddTrack(guildId string, data AddTrackData) ([]Track, error)
func (*HttpClient) EnableLoop ¶
func (h *HttpClient) EnableLoop(guildId string, enable bool) (bool, error)
func (*HttpClient) FetchTrack ¶
func (h *HttpClient) FetchTrack(query string) ([]TrackData, error)
func (*HttpClient) GetPlayingTrack ¶
func (h *HttpClient) GetPlayingTrack(guildId string) (*Track, error)
func (*HttpClient) GetTrackById ¶
func (*HttpClient) GetTracks ¶
func (h *HttpClient) GetTracks(guildId string, offset, limit int) (*GetTracksData, error)
func (*HttpClient) RemoveTrack ¶
func (*HttpClient) SetVolume ¶
func (h *HttpClient) SetVolume(guildId string, volume uint8) (bool, error)
func (*HttpClient) Stop ¶
func (h *HttpClient) Stop(guildId string) error
type Track ¶
type Track struct { ID uuid.UUID `json:"id" validate:"required"` RequestedAt time.Time `json:"requested_at" validate:"required"` UserId uint64 `json:"user_id" validate:"required"` ChannelId uint64 `json:"channel_id" validate:"required"` State *TrackState `json:"state"` Data *TrackData `json:"data" validate:"required"` }
Click to show internal directories.
Click to hide internal directories.