Documentation ¶
Index ¶
- type Controller
- func (c *Controller) FetchPublisher(p *Publisher) error
- func (c *Controller) IndexHandler(w http.ResponseWriter, r *http.Request)
- func (c *Controller) OnPlayDoneHandler(w http.ResponseWriter, r *http.Request)
- func (c *Controller) OnPlayHandler(w http.ResponseWriter, r *http.Request)
- func (c *Controller) OnPublishDoneHandler(w http.ResponseWriter, r *http.Request)
- func (c *Controller) OnPublishHandler(w http.ResponseWriter, r *http.Request)
- func (c *Controller) PublisherAPIHandler(w http.ResponseWriter, r *http.Request)
- func (c *Controller) TwitchScheduler(ctx context.Context, pollRate time.Duration)
- type DiscordWebhook
- type GameData
- type Publisher
- type StreamData
- type TwitchGamesResponse
- type TwitchStreamsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
Controller struct to provide the database to all handlers
func (*Controller) FetchPublisher ¶ added in v0.9.4
func (c *Controller) FetchPublisher(p *Publisher) error
FetchPublisher populates the publisher struct from the database
func (*Controller) IndexHandler ¶
func (c *Controller) IndexHandler(w http.ResponseWriter, r *http.Request)
IndexHandler is the http handler for "/".
func (*Controller) OnPlayDoneHandler ¶
func (c *Controller) OnPlayDoneHandler(w http.ResponseWriter, r *http.Request)
OnPlayDoneHandler is the http handler for "/on_play_done".
func (*Controller) OnPlayHandler ¶
func (c *Controller) OnPlayHandler(w http.ResponseWriter, r *http.Request)
OnPlayHandler is the http handler for "/on_play".
func (*Controller) OnPublishDoneHandler ¶
func (c *Controller) OnPublishDoneHandler(w http.ResponseWriter, r *http.Request)
OnPublishDoneHandler is the http handler for "/on_publish_done".
func (*Controller) OnPublishHandler ¶
func (c *Controller) OnPublishHandler(w http.ResponseWriter, r *http.Request)
OnPublishHandler is the http handler for "/on_publish".
func (*Controller) PublisherAPIHandler ¶
func (c *Controller) PublisherAPIHandler(w http.ResponseWriter, r *http.Request)
PublisherAPIHandler manages publisher database records
func (*Controller) TwitchScheduler ¶
func (c *Controller) TwitchScheduler(ctx context.Context, pollRate time.Duration)
TwitchScheduler launches the twitch stream query & notification background processes
type DiscordWebhook ¶
type DiscordWebhook struct {
Content string `json:"content"`
}
DiscordWebhook is used to marshal the data sent to the discord webhook
type GameData ¶ added in v0.9.3
type GameData struct { ID string `json:"id"` Name string `json:"name"` BoxArtURL string `json:"box_art_url"` }
GameData to marshal the inner data of
type Publisher ¶
type Publisher struct { Name string `json:"name"` Key string `json:"key"` RTMPLive string `json:"rtmp_live"` TwitchStream string `json:"twitch_stream"` TwitchLive string `json:"twitch_live"` TwitchNotification string `json:"-"` StreamInfo string `json:"-"` }
Publisher struct contains rtmp stream name, stream key, twitch channel name
func (*Publisher) IsTwitchLive ¶
IsTwitchLive returns a boolean based on string value of TwitchLive field
type StreamData ¶
type StreamData struct { ID string `json:"id"` UserID string `json:"user_id"` UserName string `json:"user_name"` GameID string `json:"game_id"` Type string `json:"type"` Title string `json:"title"` ViewerCount int `json:"viewer_count"` StartedAt string `json:"started_at"` }
StreamData to marshal the inner data of the TwitchStreamsResponse
type TwitchGamesResponse ¶ added in v0.9.3
type TwitchGamesResponse struct {
Data []GameData `json:"data"`
}
TwitchGamesResponse to marshal the json response from /helix/games/
type TwitchStreamsResponse ¶
type TwitchStreamsResponse struct {
Data []StreamData `json:"data"`
}
TwitchStreamsResponse to marshal the json response from /helix/streams/