twitch

package
v0.0.0-...-f30bf98 Latest Latest
Warning

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

Go to latest
Published: May 30, 2020 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package twitch provides twtitch.tv services for package telepathy Needed Config - CLIENT_ID: The client ID of twitch api

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Game

type Game struct {
	BoxArtURL string `json:"box_art_url"`
	ID        string `json:"id"`
	Name      string `json:"Name"`
}

Game object from Twitch API

type GameList

type GameList struct {
	Data []Game `json:"data"`
}

GameList for the responses of Get Games api

type Service

type Service struct {
	telepathy.Plugin
	telepathy.PluginCommandHandler
	telepathy.PluginWebhookHandler
	telepathy.PluginMsgProducer
	telepathy.PluginDatabaseUser

	// HMAC secret for validating incoming notifications
	WebsubSecret []byte

	// The client ID of twitch API
	ClientID string

	// The client secret of twitch API
	ClientSecret string
	// contains filtered or unexported fields
}

Service defines telepathy plugin

func (*Service) Command

func (s *Service) Command(done <-chan interface{}) *argo.Action

Command implements telepathy.PluginCommandHandler

func (*Service) DBRequestChannel

func (s *Service) DBRequestChannel() <-chan telepathy.DatabaseRequest

DBRequestChannel implements telepathy.PluginDatabaseUser

func (*Service) ID

func (s *Service) ID() string

ID implements telepathy.Plugin interface

func (*Service) OutMsgChannel

func (s *Service) OutMsgChannel() <-chan telepathy.OutboundMessage

OutMsgChannel implements telepathy.PluginMsgProducer

func (*Service) SetLogger

func (s *Service) SetLogger(logger *logrus.Entry)

SetLogger implements telepathy.Plugin interface

func (*Service) SetWebhookURL

func (s *Service) SetWebhookURL(urlmap map[string]*url.URL)

SetWebhookURL implements telepathy.PluginWebhookHandler

func (*Service) Start

func (s *Service) Start()

Start implements telepathy.Plugin interface

func (*Service) Stop

func (s *Service) Stop()

Stop implements telepathy.Plugin interface

func (*Service) Webhook

func (s *Service) Webhook() map[string]telepathy.HTTPHandler

Webhook implements telepathy.PluginWebhookHandler

type Stream

type Stream struct {
	CommunityID  []string  `json:"community_ids"`
	GameID       string    `json:"game_id"`
	ID           string    `json:"id"`
	Language     string    `json:"language"`
	StartedAt    time.Time `json:"started_at"`
	ThumbnailURL string    `json:"thumbnail_url"`
	Title        string    `json:"title"`
	Type         string    `json:"type"`
	UserID       string    `json:"user_id"`
	UserName     string    `json:"user_name"`
	ViewerCount  int       `json:"viewer_count"`
	// contains filtered or unexported fields
}

A Stream represents a twtich stream

type StreamList

type StreamList struct {
	Data []Stream `json:"data"`
}

A StreamList can be directly unmarshalled from twtich API respond JSON

type User

type User struct {
	ID              string `json:"id"`
	Login           string `json:"login"`
	DisplayName     string `json:"display_name"`
	Type            string `json:"type"`
	BroadcasterType string `json:"broadcaster_type"`
	Description     string `json:"description"`
	ProfileImgURL   string `json:"profile_image_url"`
	OfflineImgURL   string `json:"offline_image_url"`
	ViewCount       int    `json:"view_count"`
}

User stores twitch user data

type UserList

type UserList struct {
	Data []User `json:"data"`
}

UserList maps to json response from twitch

Jump to

Keyboard shortcuts

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