controllers

package
v0.0.0-...-d56db48 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Config *config.Config
	DB     *bolt.DB
}

Controller struct to provide the database to all handlers

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 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:"-"`
}

Publisher struct contains rtmp stream name, stream key, twitch channel name

func (*Publisher) IsTwitchLive

func (p *Publisher) IsTwitchLive() bool

IsTwitchLive returns a boolean based on string value of TwitchLive field

func (*Publisher) IsValid

func (p *Publisher) IsValid() error

IsValid perform basic validations on a publisher record

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 TwitchStreamsResponse

type TwitchStreamsResponse struct {
	Data []StreamData `json:"data"`
}

TwitchStreamsResponse to marshal the json response from /helix/streams/

Jump to

Keyboard shortcuts

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