twitch

package
v0.0.0-...-d98ca20 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	Status      string `json:"status"`
	DisplayName string `json:"display_name"`
	Game        string `json:"game"`
	URL         string `json:"url"`
}

func GetChannel

func GetChannel(key, name string) (Channel, error)

type Clip

type Clip struct {
	Broadcaster ClipUser `json:"broadcaster"`
	Curator     ClipUser `json:"curator"`
	Game        string   `json:"game"`
	Title       string   `json:"title"`
	Duration    float64  `json:"duration"`
	Thumbnails  struct {
		Medium string `json:"medium"`
		Small  string `json:"small"`
		Tiny   string `json:"tiny"`
	} `json:""`
}

func GetClip

func GetClip(key, slug string) (Clip, error)

type ClipUser

type ClipUser struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	DisplayName string `json:"display_name"`
	ChannelURL  string `json:"channel_url"`
}

type Connection

type Connection struct {
	Listen chan Listen
	// contains filtered or unexported fields
}

Connection represents a connection to TPS

func MakeConnection

func MakeConnection(AuthToken string) (*Connection, error)

MakeConnection connects to TPS ready for LISTENs

func (*Connection) CancelListenPlayback

func (c *Connection) CancelListenPlayback(channel string)

CancelListenPlayback calls

func (*Connection) Len

func (c *Connection) Len() int

Len returns the number of listens on this connection

func (*Connection) ListenPlayback

func (c *Connection) ListenPlayback(channel string, cb PlaybackHandler)

ListenPlayback listens for Video playback events if will call cb with(channel, viewers, is-streaming, error). Viewers is 0 for the first is-streaming=true call

type Listen

type Listen struct {
	Topic  string
	Update func(Topic, Message string, err error)
}

Listen causes a LISTEN or UNLISTEN to be sent to TPS If Updates is nil UNLISTEN is send, otherwise LISTEN is sent

type PlaybackHandler

type PlaybackHandler interface {
	Up()
	Down()
	ViewCount(viewers int)
	Commercial()
	PropertyUpdate()
	Error(error)
}

type PlaybackHandlerClosures

type PlaybackHandlerClosures struct {
	UpHandler             func()
	DownHandler           func()
	ViewCountHandler      func(int)
	CommercialHandler     func()
	PropertyUpdateHandler func()
	ErrorHandler          func(error)
}

func (PlaybackHandlerClosures) Commercial

func (p PlaybackHandlerClosures) Commercial()

func (PlaybackHandlerClosures) Down

func (p PlaybackHandlerClosures) Down()

func (PlaybackHandlerClosures) Error

func (p PlaybackHandlerClosures) Error(err error)

func (PlaybackHandlerClosures) PropertyUpdate

func (p PlaybackHandlerClosures) PropertyUpdate()

func (PlaybackHandlerClosures) Up

func (p PlaybackHandlerClosures) Up()

func (PlaybackHandlerClosures) ViewCount

func (p PlaybackHandlerClosures) ViewCount(viewers int)

type User

type User struct {
	ID          string `json:"_id"`
	Bio         string `json:"bio"`
	DisplayName string `json:"display_name"`
	Name        string `json:"name"`
	Type        string `json:"type"`
}

func GetUsers

func GetUsers(key string, names []string) ([]User, error)

Jump to

Keyboard shortcuts

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