Documentation ¶
Overview ¶
Package twitch provides twtitch.tv services for package telepathy Needed Config - CLIENT_ID: The client ID of twitch api
Index ¶
- type Game
- type GameList
- type Service
- func (s *Service) Command(done <-chan interface{}) *argo.Action
- func (s *Service) DBRequestChannel() <-chan telepathy.DatabaseRequest
- func (s *Service) ID() string
- func (s *Service) OutMsgChannel() <-chan telepathy.OutboundMessage
- func (s *Service) SetLogger(logger *logrus.Entry)
- func (s *Service) SetWebhookURL(urlmap map[string]*url.URL)
- func (s *Service) Start()
- func (s *Service) Stop()
- func (s *Service) Webhook() map[string]telepathy.HTTPHandler
- type Stream
- type StreamList
- type User
- type UserList
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) DBRequestChannel ¶
func (s *Service) DBRequestChannel() <-chan telepathy.DatabaseRequest
DBRequestChannel implements telepathy.PluginDatabaseUser
func (*Service) OutMsgChannel ¶
func (s *Service) OutMsgChannel() <-chan telepathy.OutboundMessage
OutMsgChannel implements telepathy.PluginMsgProducer
func (*Service) SetWebhookURL ¶
SetWebhookURL 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
Click to show internal directories.
Click to hide internal directories.