frontend

package
v0.0.0-...-23f444a Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

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) Connect

func (c *BackendClient) Connect(host string, port string) error

func (*BackendClient) GetNowPlaying

func (c *BackendClient) GetNowPlaying() (*cmpb.Song, error)

func (*BackendClient) GetPlaylist

func (c *BackendClient) GetPlaylist() (*bepb.Playlist, error)

func (*BackendClient) LoginNewUser

func (c *BackendClient) LoginNewUser(userName string, roomName string) (*bepb.User, error)

func (*BackendClient) NextSong

func (c *BackendClient) NextSong() (*bepb.Error, error)

func (*BackendClient) RemoveSong

func (c *BackendClient) RemoveSong(song_id uint32, user_id uint32) (*bepb.Error, error)

func (*BackendClient) SendNewSong

func (c *BackendClient) SendNewSong(link string, user_id uint32) (*bepb.Error, error)

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()

Jump to

Keyboard shortcuts

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