controller

package
v0.0.0-...-f77910f Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_MIN_MS_FILTER = 30000
)

Variables

View Source
var (
	SearchMissingError, _ = json.MarshalIndent(requests.ErrorResponse{
		Error: "No search term present",
	}, "", " ")
)
View Source
var (
	SongIDMissingError, _ = json.MarshalIndent(requests.ErrorResponse{
		Error: "No song specified",
	}, "", " ")
)

Functions

func NullBoolFromPtr

func NullBoolFromPtr(ptr *bool) sql.NullBool

func NullStringFromPtr

func NullStringFromPtr(ptr *string) sql.NullString

Types

type AddMemberRequest

type AddMemberRequest struct {
	Username    string `json:"username"`
	IsModerator bool   `json:"is_moderator"`
}

type Controller

type Controller struct{}

func (*Controller) AddGuest

func (*Controller) AddGuest(w http.ResponseWriter, r *http.Request)

func (*Controller) AddMember

func (*Controller) AddMember(w http.ResponseWriter, r *http.Request)

func (*Controller) CreateRoom

func (c *Controller) CreateRoom(w http.ResponseWriter, r *http.Request)

func (*Controller) CreateUser

func (c *Controller) CreateUser(w http.ResponseWriter, r *http.Request)

func (*Controller) CurrentUser

func (c *Controller) CurrentUser(w http.ResponseWriter, r *http.Request)

func (*Controller) DeleteMember

func (*Controller) DeleteMember(w http.ResponseWriter, r *http.Request)

func (*Controller) DeleteRoom

func (*Controller) DeleteRoom(w http.ResponseWriter, r *http.Request)

func (*Controller) Devices

func (c *Controller) Devices(w http.ResponseWriter, r *http.Request)

func (*Controller) GetAlbum

func (c *Controller) GetAlbum(w http.ResponseWriter, r *http.Request)

func (*Controller) GetAllHistory

func (c *Controller) GetAllHistory(w http.ResponseWriter, r *http.Request)

func (*Controller) GetArtist

func (c *Controller) GetArtist(w http.ResponseWriter, r *http.Request)

func (*Controller) GetPlayback

func (c *Controller) GetPlayback(w http.ResponseWriter, r *http.Request)

func (*Controller) GetPlaylist

func (c *Controller) GetPlaylist(w http.ResponseWriter, r *http.Request)

func (*Controller) GetQueue

func (c *Controller) GetQueue(w http.ResponseWriter, r *http.Request)

func (*Controller) GetRoom

func (c *Controller) GetRoom(w http.ResponseWriter, r *http.Request)

func (*Controller) GetRoomGuestsAndMembers

func (*Controller) GetRoomGuestsAndMembers(w http.ResponseWriter, r *http.Request)

func (*Controller) GetRoomPermissions

func (c *Controller) GetRoomPermissions(w http.ResponseWriter, r *http.Request)

func (*Controller) GetSpotifyLoginURL

func (c *Controller) GetSpotifyLoginURL(w http.ResponseWriter, r *http.Request)

func (*Controller) GetToken

func (c *Controller) GetToken(w http.ResponseWriter, r *http.Request)

func (*Controller) GetTopAlbumsByYear

func (c *Controller) GetTopAlbumsByYear(w http.ResponseWriter, r *http.Request)

func (*Controller) GetTopArtistsByYear

func (c *Controller) GetTopArtistsByYear(w http.ResponseWriter, r *http.Request)

func (*Controller) GetTopSongsByMonth

func (c *Controller) GetTopSongsByMonth(w http.ResponseWriter, r *http.Request)

func (*Controller) GetTopTracksByYear

func (c *Controller) GetTopTracksByYear(w http.ResponseWriter, r *http.Request)

func (*Controller) GetUserHostedRooms

func (c *Controller) GetUserHostedRooms(w http.ResponseWriter, r *http.Request)

func (*Controller) GetUserJoinedRooms

func (c *Controller) GetUserJoinedRooms(w http.ResponseWriter, r *http.Request)

func (*Controller) GetVersion

func (c *Controller) GetVersion(w http.ResponseWriter, r *http.Request)

func (*Controller) Health

func (c *Controller) Health(w http.ResponseWriter, r *http.Request)

func (*Controller) JoinRoomAsMember

func (*Controller) JoinRoomAsMember(w http.ResponseWriter, r *http.Request)

func (*Controller) Next

func (c *Controller) Next(w http.ResponseWriter, r *http.Request)

func (*Controller) Pause

func (c *Controller) Pause(w http.ResponseWriter, r *http.Request)

func (*Controller) Play

func (c *Controller) Play(w http.ResponseWriter, r *http.Request)

func (*Controller) Previous

func (c *Controller) Previous(w http.ResponseWriter, r *http.Request)

func (*Controller) PushToQueue

func (c *Controller) PushToQueue(w http.ResponseWriter, r *http.Request)

func (*Controller) Search

func (c *Controller) Search(w http.ResponseWriter, r *http.Request)

func (*Controller) SetModerator

func (*Controller) SetModerator(w http.ResponseWriter, r *http.Request)

func (*Controller) SetVolume

func (c *Controller) SetVolume(w http.ResponseWriter, r *http.Request)

func (*Controller) SpotifyAuthRedirect

func (c *Controller) SpotifyAuthRedirect(w http.ResponseWriter, r *http.Request)

func (*Controller) SuggestedTracks

func (c *Controller) SuggestedTracks(w http.ResponseWriter, r *http.Request)

func (*Controller) UnlinkSpotify

func (c *Controller) UnlinkSpotify(w http.ResponseWriter, r *http.Request)

func (*Controller) UpdatePassword

func (*Controller) UpdatePassword(w http.ResponseWriter, r *http.Request)

func (*Controller) UploadHistory

func (c *Controller) UploadHistory(w http.ResponseWriter, r *http.Request)

func (*Controller) UserHasSpotifyHistory

func (c *Controller) UserHasSpotifyHistory(w http.ResponseWriter, r *http.Request)

func (*Controller) UserPlaylists

func (c *Controller) UserPlaylists(w http.ResponseWriter, r *http.Request)

type CreateUserBody

type CreateUserBody struct {
	Username    string `json:"username"`
	DisplayName string `json:"display_name"`
	Password    string `json:"password"`
}

type CreateUserResponse

type CreateUserResponse struct {
	User      user.User `json:"user"`
	Token     string    `json:"token"`
	ExpiresAt time.Time `json:"expires_at"`
}

type GetRoomAuthLevelResponse

type GetRoomAuthLevelResponse struct {
	IsMember    bool `json:"is_member"`
	IsModerator bool `json:"is_moderator"`
	IsHost      bool `json:"is_host"`
}

type GetRoomGuestsAndMembersResponse

type GetRoomGuestsAndMembersResponse struct {
	Guests  []room.Guest  `json:"guests"`
	Members []room.Member `json:"members"`
}

type GetRoomsResponse

type GetRoomsResponse struct {
	Rooms []room.Room `json:"rooms"`
}

type GetSpotifyLoginURLResponse

type GetSpotifyLoginURLResponse struct {
	URL string `json:"url"`
}

type MonthTopSongs

type MonthTopSongs struct {
	Year  int             `json:"year"`
	Month int             `json:"month"`
	Songs SongRankingList `json:"songs"`
}

type PermissionLevel

type PermissionLevel int
const (
	IncorrectPassword PermissionLevel = iota
	NotAuthorized
	Guest
	Member
	Moderator
	Host
)

type RequestContext

type RequestContext struct {
	Room            *room.Room
	UserID          string
	GuestID         string
	PermissionLevel PermissionLevel
}

type SetModeratorRequest

type SetModeratorRequest struct {
	UserID      string `json:"user_id"`
	IsModerator bool   `json:"is_moderator"`
}

type SongRanking

type SongRanking struct {
	Track *z_spotify.FullTrack `json:"track"`
	URI   string               `json:"spotify_uri"`
	Plays int                  `json:"play_count"`
}

type SongRankingList

type SongRankingList []*SongRanking

func (SongRankingList) Len

func (p SongRankingList) Len() int

func (SongRankingList) Less

func (p SongRankingList) Less(i, j int) bool

func (SongRankingList) Swap

func (p SongRankingList) Swap(i, j int)

type TokenResponse

type TokenResponse struct {
	Token     string     `json:"token"`
	ExpiresAt time.Time  `json:"expires_at"`
	User      *user.User `json:"user"`
}

type UpdatePasswordRequest

type UpdatePasswordRequest struct {
	NewPassword string `json:"new_password"`
}

Jump to

Keyboard shortcuts

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