Documentation ¶
Index ¶
- type BlockS
- type BlocksS
- type ChannelLinksS
- type ChannelS
- type ChannelsMethod
- type ChatLinks
- type ChatLinksS
- type ChatMethod
- type Client
- type EditorsS
- type EmoticonS
- type EmoticonsS
- type FStreamS
- type FeaturedS
- type FollowS
- type FollowedS
- type FollowsS
- type GameS
- type GamesMethod
- type ImageS
- type ImagesS
- type IngestS
- type IngestsMethod
- type IngestsS
- type LinksS
- type ListOptions
- type PreviewS
- type SChannelS
- type SGameS
- type SGamesS
- type SearchMethod
- type StreamS
- type StreamsMethod
- type StreamsS
- type SubS
- type SubsS
- type SummaryS
- type TeamS
- type TeamsMethod
- type TeamsS
- type TopS
- type TopsS
- type UFollowS
- type UFollowsS
- type UTargetS
- type UserS
- type UsersMethod
- type VideoS
- type VideosMethod
- type VideosS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelLinksS ¶
type ChannelLinksS struct { Chat string `json:"chat,omitempty"` Commercial string `json:"commercial,omitempty"` Videos string `json:"videos,omitempty"` Teams string `json:"teams,omitempty"` Editors string `json:"editors,omitempty"` Subsciptions string `json:"subscriptions,omitempty"` Features string `json:"features,omitempty"` StreamKey string `json:"stream_key,omitempty"` Follows string `json:"follows,omitempty"` }
type ChannelS ¶
type ChannelS struct { Name string `json:"name,omitempty"` Status string `json:"status,omitempty"` Game string `json:"game,omitempty"` Delay int `json:"delay,omitempty"` Id int `json:"_id,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` PrimaryTeamName string `json:"primary_team_name,omitempty"` PrimaryTeamDisplayName string `json:"primary_team_display_name,omitempty"` Teams []TeamS `json:"teams,omitempty"` Title string `json:"title,omitempty"` Mature bool `json:"mature,omitempty"` AbuseReported bool `json:"abuse_reported,omitempty"` Banner string `json:"banner,omitempty"` VideoBanner string `json:"video_banner,omitempty"` Views int `json:"views,omitempty"` Followers int `json:"followers,omitempty"` Background string `json:"background,omitempty"` ProfileBanner string `json:"profile_banner,omitempty"` ProfileBannerBackgroundColor string `json:"profile_banner_background_color,omitempty"` Links ChannelLinksS `json:"_links,omitempty"` Logo string `json:"logo,omitempty"` Url string `json:"url,omitempty"` DisplayName string `json:"display_name,omitempty"` // authenticated StreamKey string `json:"stream_key,omitempty"` Login string `json:"login,omitempty"` Email string `json:"email,omitempty"` }
Channel object
type ChannelsMethod ¶
type ChannelsMethod struct {
// contains filtered or unexported fields
}
func (*ChannelsMethod) Channel ¶
func (c *ChannelsMethod) Channel(name string) (*ChannelS, error)
Returns a channel object. If `name` is an empty string, returns the channel object of authenticated user.
func (*ChannelsMethod) Follows ¶
func (c *ChannelsMethod) Follows(name string, opt *ListOptions) (*FollowsS, error)
Returns a list of users the channel `name` is following.
func (*ChannelsMethod) Videos ¶
func (c *ChannelsMethod) Videos(name string, opt *ListOptions) (*VideosS, error)
Returns a list of videos ordered by time of creation, starting with the most recent from channel `name`.
type ChatLinks ¶
type ChatLinks struct {
Links ChatLinksS `json:"_links,omitempty"`
}
type ChatLinksS ¶
type ChatMethod ¶
type ChatMethod struct {
// contains filtered or unexported fields
}
func (*ChatMethod) Emoticons ¶
func (c *ChatMethod) Emoticons() (*EmoticonsS, error)
type Client ¶
type Client struct { BaseURL *url.URL ClientId string // Twitch api methods Channels *ChannelsMethod Chat *ChatMethod Games *GamesMethod Ingests *IngestsMethod Search *SearchMethod Streams *StreamsMethod Teams *TeamsMethod Users *UsersMethod Videos *VideosMethod // contains filtered or unexported fields }
type EditorsS ¶
type EditorsS struct { Users []UserS `json:"users,omitempty"` Links LinksS `json:"_links,omitempty"` }
used with GET /channels/:channel/editors
type EmoticonsS ¶
type EmoticonsS struct {
Emoticons []EmoticonS `json:"emoticons,omitempty"`
}
type FeaturedS ¶
type FeaturedS struct { Featured []FStreamS `json:"featured,omitempty"` Links LinksS `json:"_links,omitempty"` }
used with GET /streams/featured
type FollowedS ¶
type FollowedS struct { Streams []StreamS `json:"streams,omitempty"` Links LinksS `json:"_links,omitempty"` }
used with GET /streams/followed
type FollowsS ¶
type FollowsS struct { Follows []FollowS `json:"follows,omitempty"` Total int `json:"_total,omitempty"` Links LinksS `json:"_links,omitempty"` }
used with GET /channels/:channel/follows
type GamesMethod ¶
type GamesMethod struct {
// contains filtered or unexported fields
}
func (*GamesMethod) Top ¶
func (g *GamesMethod) Top(opt *ListOptions) (*TopsS, error)
Returns a list of games objects sorted by number of current viewers, most popular first.
type IngestsMethod ¶
type IngestsMethod struct {
// contains filtered or unexported fields
}
func (*IngestsMethod) List ¶
func (i *IngestsMethod) List() (*IngestsS, error)
type ListOptions ¶
type ListOptions struct { Game string `url:"game,omitempty"` Channel string `url:"channel,omitempty"` Direction string `url:"direction,omitempty"` Period string `url:"period,omitempty"` Limit int `url:"limit,omitempty"` Offset int `url:"offset,omitempty"` Embeddable *bool `url:"embeddable,omitempty"` Hls *bool `url:"hls,omitempty"` Live *bool `url:"live,omitempty"` }
type SChannelS ¶
type SChannelS struct { Stream StreamS `json:"stream,omitempty"` Links LinksS `json:"_links,omitempty"` }
used with GET /streams/:channel/
type SearchMethod ¶
type SearchMethod struct {
// contains filtered or unexported fields
}
func (*SearchMethod) Games ¶
func (s *SearchMethod) Games(q string, opt *ListOptions) (*SGamesS, error)
func (*SearchMethod) Streams ¶
func (s *SearchMethod) Streams(q string, opt *ListOptions) (*StreamsS, error)
type StreamS ¶
type StreamS struct { Id int `json:"_id,omitempty"` Game string `json:"game,omitempty"` Name string `json:"name,omitempty"` CreatedAt string `json:"created_at,omitempty"` Preview string `json:"preview,omitempty"` Viewers int `json:"viewers,omitempty"` Broadcaster string `json:"broadcaster,omitempty"` Geo string `json:"geo,omitempty"` Channel ChannelS `json:"channel,omitempty"` Status string `json:"status,omitempty"` }
Stream oject
type StreamsMethod ¶
type StreamsMethod struct {
// contains filtered or unexported fields
}
func (*StreamsMethod) Channel ¶
func (s *StreamsMethod) Channel(name string) (*SChannelS, error)
Returns a stream object if live.
func (*StreamsMethod) Featured ¶
func (s *StreamsMethod) Featured(opt *ListOptions) (*FeaturedS, error)
Returns a list of featured (promoted) stream objects.
func (*StreamsMethod) List ¶
func (s *StreamsMethod) List(opt *ListOptions) (*StreamsS, error)
Returns a list of stream objects according to optional parameters.
func (*StreamsMethod) Summary ¶
func (s *StreamsMethod) Summary(opt *ListOptions) (*SummaryS, error)
Returns a summary of current streams.
type StreamsS ¶
type StreamsS struct { Total int `json:"_total,omitempty"` Streams []StreamS `json:"streams,omitempty"` Links LinksS `json:"_links,omitempty"` }
used with GET /streams
type SummaryS ¶
type SummaryS struct { Viewers int `json:"viewers,omitempty"` Channels int `json:"channels,omitempty"` }
used with GET /streams/summary
type TeamS ¶
type TeamS struct { Id int `json:"_id,omitempty"` Name string `json:"name,omitempty"` Background string `json:"background,omitempty"` Banner string `json:"banner,omitempty"` Logo string `json:"logo,omitempty"` Info string `json:"info,omitempty"` DisplayName string `json:"display_name,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` }
Team object
type TeamsMethod ¶
type TeamsMethod struct {
// contains filtered or unexported fields
}
func (*TeamsMethod) List ¶
func (t *TeamsMethod) List(opt *ListOptions) (*TeamsS, error)
type UserS ¶
type UserS struct { Name string `json:"name,omitempty"` Logo string `json:"logo,omitempty"` ID int `json:"_id,omitempty"` DisplayName string `json:"display_name,omitempty"` Staff bool `json:"staff,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` }
User object
type UsersMethod ¶
type UsersMethod struct {
// contains filtered or unexported fields
}
func (*UsersMethod) Follow ¶
func (u *UsersMethod) Follow(user, target string) (*UTargetS, error)
Get status of follow relationship between user and target channel
func (*UsersMethod) Follows ¶
func (u *UsersMethod) Follows(user string, opt *ListOptions) (*UFollowsS, error)
Get a user's list of followed channels
type VideoS ¶
type VideoS struct { Title string `json:"title,omitempty"` ID string `json:"_id,omitempty"` Embed string `json:"embed,omitempty"` Url string `json:"url,omitempty"` Views int `json:"views,omitempty"` Preview string `json:"preview,omitempty"` Length int `json:"length,omitempty"` Description string `json:"description,omitempty"` BroadcastId int `json:"broadcast_id"` RecordedAt string `json:"recorded_at,omitempty"` Game string `json:"game,omitempty"` Channel ChannelS `json:"channel,omitempty"` }
Video object
type VideosMethod ¶
type VideosMethod struct {
// contains filtered or unexported fields
}
func (*VideosMethod) Top ¶
func (v *VideosMethod) Top(opt *ListOptions) (*VideosS, error)