Documentation ¶
Index ¶
Constants ¶
View Source
const ( MoveNormal = iota MoveHead MoveError )
Variables ¶
View Source
var ( // ErrUnsupportedFormat return when link to unsupported video format was received ErrUnsupportedFormat = errors.New("Unsupported video format. Support only .mp4, .m3u8, .webm") // ErrVideoNotFound return when video by specified ID was not found ErrVideoNotFound = errors.New("Video with this ID was not found") // ErrEmptyYoutubeVideoID return when youtube video id (v param in link) is empty ErrEmptyYoutubeVideoID = errors.New("Youtube video ID is empty") // ErrUnsupportedHost return when video link has unsupported host ErrUnsupportedHost = errors.New("Unsupported host") // ErrLinkDoesNotMath return when regexp check return false, but host is supported ErrLinkDoesNotMath = errors.New("Link does't match required format") )
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { Users Users Playlist playlist Messages Messages Room Room ID string Close chan struct{} }
Cache is storage of users and playlist for a room
func (*Cache) HandleCacheEvents ¶
func (cache *Cache) HandleCacheEvents()
HandleCacheEvents handle cache event one at time
type Messages ¶
type Messages struct { AddMessage chan Message // contains filtered or unexported fields }
func (Messages) GetAllMessages ¶
GetAllMessages return all cache maxMessageStorageSize messages
type Room ¶
type User ¶
type User struct { Name string `json:"name"` Color string `json:"color,omitempty"` Image string `json:"image,omitempty"` Guest bool `json:"guest"` Payload *jwt.Payload `json:"-"` UUID string `json:"uuid,omitempty"` ID string `json:"__id"` }
User is single user instance
type Users ¶
type Users struct { AddUser chan *jwt.Payload AddGuest chan *User UpdateRole chan NewRole DelUser chan string DelFeedback chan struct{} UpdateUsers chan struct{} // contains filtered or unexported fields }
Users is users storage and channels for adding/removing
func (Users) GetUUIDByID ¶
GetUUIDByID return user UUID by ID
func (Users) GetUserByUUID ¶
GetUserByUUID return user object by UUID
func (*Users) UpdateUser ¶
UpdateUser update user in cache, image, nickname, color etc.
func (Users) UsersCount ¶
UsersCount return count users for current room
type Video ¶
type Video struct { Title string `json:"title"` Duration int `json:"duration"` URL string `json:"url"` Direct bool `json:"direct"` Subtitles string `json:"subs,omitempty"` Iframe bool `json:"iframe"` LiveStream bool `json:"live_stream"` ID string `json:"__id"` }
Video is instance of a video in playlist
Click to show internal directories.
Click to hide internal directories.