Documentation
¶
Index ¶
- Constants
- func CalculateTagsLength(tags []string) int
- func InitConfig(cfg streamctl.Config)
- func ParseTimestamp(s string) (time.Time, error)
- func TruncateTags(tags []string) []string
- type BroadcastType
- type ChatClient
- type ChatListener
- type ChatListenerOBSOLETE
- type ClientCalcPoints
- func (c *ClientCalcPoints) DeleteBroadcast(ctx context.Context, broadcastID string) (_err error)
- func (c *ClientCalcPoints) DeleteChatMessage(ctx context.Context, messageID string) (_err error)
- func (c *ClientCalcPoints) GetBroadcasts(ctx context.Context, t BroadcastType, ids []string, parts []string, ...) (_ret *youtube.LiveBroadcastListResponse, _err error)
- func (c *ClientCalcPoints) GetLiveChatMessages(ctx context.Context, chatID string, pageToken string, parts []string) (_ret *youtube.LiveChatMessageListResponse, _err error)
- func (c *ClientCalcPoints) GetPlaylistItems(ctx context.Context, playlistID string, videoID string, parts []string) (_ret *youtube.PlaylistItemListResponse, _err error)
- func (c *ClientCalcPoints) GetPlaylists(ctx context.Context, playlistParts []string) (_ret *youtube.PlaylistListResponse, _err error)
- func (c *ClientCalcPoints) GetStreams(ctx context.Context, parts []string) (_ret *youtube.LiveStreamListResponse, _err error)
- func (c *ClientCalcPoints) GetVideos(ctx context.Context, broadcastIDs []string, parts []string) (_ret *youtube.VideoListResponse, _err error)
- func (c *ClientCalcPoints) InsertBroadcast(ctx context.Context, broadcast *youtube.LiveBroadcast, parts []string) (_ret *youtube.LiveBroadcast, _err error)
- func (c *ClientCalcPoints) InsertCommentThread(ctx context.Context, t *youtube.CommentThread, parts []string) (_err error)
- func (c *ClientCalcPoints) InsertCuepoint(ctx context.Context, cuepoint *youtube.Cuepoint) (_err error)
- func (c *ClientCalcPoints) InsertPlaylistItem(ctx context.Context, item *youtube.PlaylistItem, parts []string) (_err error)
- func (c *ClientCalcPoints) ListChatMessages(ctx context.Context, chatID string, parts []string) (_ret *youtube.LiveChatMessageListResponse, _err error)
- func (c *ClientCalcPoints) Ping(ctx context.Context) (_err error)
- func (c *ClientCalcPoints) Search(ctx context.Context, chanID string, eventType EventType, parts []string) (_ret *youtube.SearchListResponse, _err error)
- func (c *ClientCalcPoints) SetThumbnail(ctx context.Context, broadcastID string, thumbnail io.Reader) (_err error)
- func (c *ClientCalcPoints) UpdateBroadcast(ctx context.Context, broadcast *youtube.LiveBroadcast, parts []string) (_err error)
- func (c *ClientCalcPoints) UpdateVideo(ctx context.Context, video *youtube.Video, parts []string) (_err error)
- type Config
- type ErrChatDisabled
- type ErrChatEnded
- type ErrChatNotFound
- type EventType
- type FlagBroadcastTemplateIDs
- type LiveBroadcast
- type OAuthHandler
- type PlatformSpecificConfig
- type StreamProfile
- type StreamStatusCustomData
- type TemplateTags
- type YouTube
- func (yt *YouTube) ApplyProfile(ctx context.Context, profile StreamProfile, customArgs ...any) error
- func (yt *YouTube) BanUser(ctx context.Context, userID streamcontrol.UserID, reason string, ...) error
- func (yt *YouTube) Close() error
- func (yt *YouTube) DeleteActiveBroadcasts(ctx context.Context) error
- func (yt *YouTube) EndStream(ctx context.Context) error
- func (yt *YouTube) Flush(ctx context.Context) error
- func (yt *YouTube) GetChatMessagesChan(ctx context.Context) (<-chan streamcontrol.Event, error)
- func (yt *YouTube) GetStreamStatus(ctx context.Context) (_ret *streamcontrol.StreamStatus, _err error)
- func (yt *YouTube) InsertAdsCuePoint(ctx context.Context, ts time.Time, duration time.Duration) error
- func (yt *YouTube) IsCapable(ctx context.Context, cap streamcontrol.Capability) bool
- func (yt *YouTube) IsChannelStreaming(ctx context.Context, chanID streamcontrol.UserID) (_ret bool, _err error)
- func (yt *YouTube) IterateActiveBroadcasts(ctx context.Context, callback func(broadcast *youtube.LiveBroadcast) error, ...) error
- func (yt *YouTube) IterateUpcomingBroadcasts(ctx context.Context, callback func(broadcast *youtube.LiveBroadcast) error, ...) error
- func (yt *YouTube) ListBroadcasts(ctx context.Context, limit uint, ...) (_ret []*youtube.LiveBroadcast, _err error)
- func (yt *YouTube) ListStreams(ctx context.Context) ([]*youtube.LiveStream, error)
- func (yt *YouTube) RaidTo(ctx context.Context, chanID streamcontrol.UserID) error
- func (yt *YouTube) RemoveChatMessage(ctx context.Context, messageID streamcontrol.EventID) (_err error)
- func (yt *YouTube) SendChatMessage(ctx context.Context, message string) (_err error)
- func (yt *YouTube) SetDescription(ctx context.Context, description string) error
- func (yt *YouTube) SetTitle(ctx context.Context, title string) error
- func (yt *YouTube) Shoutout(ctx context.Context, chanID streamcontrol.UserID) error
- func (yt *YouTube) StartStream(ctx context.Context, title string, description string, profile StreamProfile, ...) (_err error)
Constants ¶
View Source
const ( BroadcastTypeAll BroadcastTypeUpcoming BroadcastTypeActive )
View Source
const ( EventTypeCompleted = EventType("completed") EventTypeLive = EventType("live") EventTypeUpcoming = EventType("upcoming") )
View Source
const ( TemplateTagsUndefined = youtube.TemplateTagsUndefined TemplateTagsIgnore = youtube.TemplateTagsIgnore TemplateTagsUseAsPrimary = youtube.TemplateTagsUseAsPrimary TemplateTagsUseAsAdditional = youtube.TemplateTagsUseAsAdditional )
View Source
const ID = youtube.ID
View Source
const (
LimitTagsLength = 500
)
Variables ¶
This section is empty.
Functions ¶
func CalculateTagsLength ¶
func InitConfig ¶
func TruncateTags ¶
Types ¶
type BroadcastType ¶
type BroadcastType int
func (BroadcastType) String ¶
func (t BroadcastType) String() string
type ChatClient ¶
type ChatListener ¶
type ChatListener struct {
// contains filtered or unexported fields
}
func NewChatListener ¶
func NewChatListener( ctx context.Context, ytClient ChatClient, videoID string, liveChatID string, ) (*ChatListener, error)
func (*ChatListener) GetVideoID ¶
func (h *ChatListener) GetVideoID() string
func (*ChatListener) MessagesChan ¶
func (h *ChatListener) MessagesChan() <-chan streamcontrol.Event
type ChatListenerOBSOLETE ¶
type ChatListenerOBSOLETE struct {
// contains filtered or unexported fields
}
TODO: delete this handler after explaining to YouTube the application and getting a quota for normal ChatListener.
func NewChatListenerOBSOLETE ¶
func (*ChatListenerOBSOLETE) Close ¶
func (h *ChatListenerOBSOLETE) Close(ctx context.Context) (_err error)
func (*ChatListenerOBSOLETE) GetVideoID ¶
func (h *ChatListenerOBSOLETE) GetVideoID() string
func (*ChatListenerOBSOLETE) MessagesChan ¶
func (h *ChatListenerOBSOLETE) MessagesChan() <-chan streamcontrol.Event
type ClientCalcPoints ¶
type ClientCalcPoints struct {
Client client
UsedPoints atomic.Uint64
CheckMutex sync.Mutex
PreviousCheckAt time.Time
}
see also: https://developers.google.com/youtube/v3/determine_quota_cost
func NewYouTubeClientCalcPoints ¶
func NewYouTubeClientCalcPoints(client client) *ClientCalcPoints
func (*ClientCalcPoints) DeleteBroadcast ¶
func (c *ClientCalcPoints) DeleteBroadcast( ctx context.Context, broadcastID string, ) (_err error)
func (*ClientCalcPoints) DeleteChatMessage ¶
func (c *ClientCalcPoints) DeleteChatMessage( ctx context.Context, messageID string, ) (_err error)
func (*ClientCalcPoints) GetBroadcasts ¶
func (c *ClientCalcPoints) GetBroadcasts( ctx context.Context, t BroadcastType, ids []string, parts []string, pageToken string, ) (_ret *youtube.LiveBroadcastListResponse, _err error)
func (*ClientCalcPoints) GetLiveChatMessages ¶
func (c *ClientCalcPoints) GetLiveChatMessages( ctx context.Context, chatID string, pageToken string, parts []string, ) (_ret *youtube.LiveChatMessageListResponse, _err error)
func (*ClientCalcPoints) GetPlaylistItems ¶
func (c *ClientCalcPoints) GetPlaylistItems( ctx context.Context, playlistID string, videoID string, parts []string, ) (_ret *youtube.PlaylistItemListResponse, _err error)
func (*ClientCalcPoints) GetPlaylists ¶
func (c *ClientCalcPoints) GetPlaylists( ctx context.Context, playlistParts []string, ) (_ret *youtube.PlaylistListResponse, _err error)
func (*ClientCalcPoints) GetStreams ¶
func (c *ClientCalcPoints) GetStreams( ctx context.Context, parts []string, ) (_ret *youtube.LiveStreamListResponse, _err error)
func (*ClientCalcPoints) GetVideos ¶
func (c *ClientCalcPoints) GetVideos( ctx context.Context, broadcastIDs []string, parts []string, ) (_ret *youtube.VideoListResponse, _err error)
func (*ClientCalcPoints) InsertBroadcast ¶
func (c *ClientCalcPoints) InsertBroadcast( ctx context.Context, broadcast *youtube.LiveBroadcast, parts []string, ) (_ret *youtube.LiveBroadcast, _err error)
func (*ClientCalcPoints) InsertCommentThread ¶
func (c *ClientCalcPoints) InsertCommentThread( ctx context.Context, t *youtube.CommentThread, parts []string, ) (_err error)
func (*ClientCalcPoints) InsertCuepoint ¶
func (*ClientCalcPoints) InsertPlaylistItem ¶
func (c *ClientCalcPoints) InsertPlaylistItem( ctx context.Context, item *youtube.PlaylistItem, parts []string, ) (_err error)
func (*ClientCalcPoints) ListChatMessages ¶
func (c *ClientCalcPoints) ListChatMessages( ctx context.Context, chatID string, parts []string, ) (_ret *youtube.LiveChatMessageListResponse, _err error)
func (*ClientCalcPoints) Search ¶
func (c *ClientCalcPoints) Search( ctx context.Context, chanID string, eventType EventType, parts []string, ) (_ret *youtube.SearchListResponse, _err error)
func (*ClientCalcPoints) SetThumbnail ¶
func (*ClientCalcPoints) UpdateBroadcast ¶
func (c *ClientCalcPoints) UpdateBroadcast( ctx context.Context, broadcast *youtube.LiveBroadcast, parts []string, ) (_err error)
func (*ClientCalcPoints) UpdateVideo ¶
type ErrChatDisabled ¶
type ErrChatDisabled struct {
ChatID string
}
func (ErrChatDisabled) Error ¶
func (e ErrChatDisabled) Error() string
type ErrChatEnded ¶
type ErrChatEnded struct {
ChatID string
}
func (ErrChatEnded) Error ¶
func (e ErrChatEnded) Error() string
type ErrChatNotFound ¶
type ErrChatNotFound struct {
ChatID string
}
func (ErrChatNotFound) Error ¶
func (e ErrChatNotFound) Error() string
type FlagBroadcastTemplateIDs ¶
type FlagBroadcastTemplateIDs []string
type LiveBroadcast ¶
type LiveBroadcast = youtube.LiveBroadcast
type OAuthHandler ¶
type OAuthHandler = youtube.OAuthHandler
type PlatformSpecificConfig ¶
type PlatformSpecificConfig = youtube.PlatformSpecificConfig
type StreamProfile ¶
type StreamProfile = youtube.StreamProfile
type StreamStatusCustomData ¶
type StreamStatusCustomData = youtube.StreamStatusCustomData
func GetStreamStatusCustomData ¶
func GetStreamStatusCustomData(in *streamcontrol.StreamStatus) StreamStatusCustomData
type TemplateTags ¶
type TemplateTags = youtube.TemplateTags
type YouTube ¶
type YouTube struct {
Config Config
YouTubeClient *ClientCalcPoints
CancelFunc context.CancelFunc
SaveConfigFunc func(Config) error
// contains filtered or unexported fields
}
func (*YouTube) ApplyProfile ¶
func (*YouTube) DeleteActiveBroadcasts ¶
func (*YouTube) GetChatMessagesChan ¶
func (*YouTube) GetStreamStatus ¶
func (yt *YouTube) GetStreamStatus( ctx context.Context, ) (_ret *streamcontrol.StreamStatus, _err error)
func (*YouTube) InsertAdsCuePoint ¶
func (*YouTube) IsCapable ¶
func (yt *YouTube) IsCapable( ctx context.Context, cap streamcontrol.Capability, ) bool
func (*YouTube) IsChannelStreaming ¶
func (*YouTube) IterateActiveBroadcasts ¶
func (*YouTube) IterateUpcomingBroadcasts ¶
func (*YouTube) ListBroadcasts ¶
func (yt *YouTube) ListBroadcasts( ctx context.Context, limit uint, continueFunc func(*youtube.LiveBroadcastListResponse) bool, ) (_ret []*youtube.LiveBroadcast, _err error)
func (*YouTube) ListStreams ¶
func (*YouTube) RemoveChatMessage ¶
func (*YouTube) SendChatMessage ¶
func (*YouTube) SetDescription ¶
func (*YouTube) StartStream ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.