Documentation ¶
Index ¶
- Constants
- Variables
- type BackendClient
- func (c *BackendClient) Connect(host string, port string) error
- func (c *BackendClient) GetNowPlaying() (*cmpb.Song, error)
- func (c *BackendClient) GetPlaylist() (*bepb.Playlist, error)
- func (c *BackendClient) LoginNewUser(userName string, roomName string) (*bepb.User, error)
- func (c *BackendClient) NextSong() (*bepb.Error, error)
- func (c *BackendClient) RemoveSong(song_id uint32, user_id uint32) (*bepb.Error, error)
- func (c *BackendClient) SendNewSong(link string, user_id uint32) (*bepb.Error, error)
- type FrontendServer
- func (s *FrontendServer) HandleIndex(context *gin.Context)
- func (s *FrontendServer) HandleLoginPage(context *gin.Context)
- func (s *FrontendServer) HandleLoginPost(context *gin.Context)
- func (s *FrontendServer) HandleNewSong(context *gin.Context)
- func (s *FrontendServer) HandleNextSong(context *gin.Context)
- func (s *FrontendServer) HandleNowPlaying(context *gin.Context)
- func (s *FrontendServer) HandlePlaylist(context *gin.Context)
- func (s *FrontendServer) HandleRemove(context *gin.Context)
- func (s *FrontendServer) Start()
- func (s *FrontendServer) Stop()
Constants ¶
View Source
const ( LogPrefix string = "ytb-fe" // logging prefix name AlertSuccess = "success" AlertInfo = "info" AlertWarning = "warning" AlertError = "danger" AlertEmphError = "Error" AlertEmphWarn = "Warning" AlertEmphInfo = "Info" )
Variables ¶
View Source
var ErrFailedLogin = errors.New("Failed to login user.")
View Source
var ErrFailedToProcessSong = errors.New("Could not process your submission. Please check your link.")
View Source
var ErrMissingLink = errors.New("Missing song link.")
View Source
var ErrMissingRoomName = errors.New("Missing room name.")
View Source
var ErrMissingSessionToken = errors.New("Missing session token. Please log back in.")
View Source
var ErrMissingUserName = errors.New("Missing display name.")
View Source
var ErrRemoveMissingSong = errors.New("Did not supply a song to remove.")
View Source
var ErrRoomNotFound = errors.New("Room name was not found.")
Functions ¶
This section is empty.
Types ¶
type BackendClient ¶
type BackendClient struct {
// contains filtered or unexported fields
}
func (*BackendClient) GetNowPlaying ¶
func (c *BackendClient) GetNowPlaying() (*cmpb.Song, error)
func (*BackendClient) GetPlaylist ¶
func (c *BackendClient) GetPlaylist() (*bepb.Playlist, error)
func (*BackendClient) LoginNewUser ¶
func (*BackendClient) RemoveSong ¶
func (*BackendClient) SendNewSong ¶
type FrontendServer ¶
type FrontendServer struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(addr string, hashKey []byte, blockKey []byte, isDebug bool) *FrontendServer
func (*FrontendServer) HandleIndex ¶
func (s *FrontendServer) HandleIndex(context *gin.Context)
func (*FrontendServer) HandleLoginPage ¶
func (s *FrontendServer) HandleLoginPage(context *gin.Context)
func (*FrontendServer) HandleLoginPost ¶
func (s *FrontendServer) HandleLoginPost(context *gin.Context)
func (*FrontendServer) HandleNewSong ¶
func (s *FrontendServer) HandleNewSong(context *gin.Context)
func (*FrontendServer) HandleNextSong ¶
func (s *FrontendServer) HandleNextSong(context *gin.Context)
func (*FrontendServer) HandleNowPlaying ¶
func (s *FrontendServer) HandleNowPlaying(context *gin.Context)
func (*FrontendServer) HandlePlaylist ¶
func (s *FrontendServer) HandlePlaylist(context *gin.Context)
func (*FrontendServer) HandleRemove ¶
func (s *FrontendServer) HandleRemove(context *gin.Context)
func (*FrontendServer) Start ¶
func (s *FrontendServer) Start()
func (*FrontendServer) Stop ¶
func (s *FrontendServer) Stop()
Click to show internal directories.
Click to hide internal directories.