Documentation
¶
Index ¶
- type ChannelsMethod
- func (c *ChannelsMethod) Channel(id uint) (*twitch.Channel, error)
- func (c *ChannelsMethod) Editors(id uint) (*twitch.ChannelEditorsList, error)
- func (c *ChannelsMethod) Follows(id uint, opt *twitch.ListOptions) (*twitch.ChannelFollowsList, error)
- func (c *ChannelsMethod) Subscriptions(id uint, opt *twitch.ListOptions) (*twitch.ChannelSubscriptionsList, error)
- func (c *ChannelsMethod) Videos(id uint, opt *twitch.ListOptions) (*twitch.VideosList, error)
- type ChatMethod
- type Client
- type GamesMethod
- type IngestsMethod
- type SearchMethod
- type StreamsMethod
- func (s *StreamsMethod) Channel(id uint) (*twitch.ChannelStream, error)
- func (s *StreamsMethod) Featured(opt *twitch.ListOptions) (*twitch.FeaturedStreamsList, error)
- func (s *StreamsMethod) Followed(opt *twitch.ListOptions) (*twitch.StreamsList, error)
- func (s *StreamsMethod) List(opt *twitch.ListOptions) (*twitch.StreamsList, error)
- func (s *StreamsMethod) Summary(opt *twitch.ListOptions) (*twitch.StreamSummary, error)
- type TeamsMethod
- type TmiMethod
- type UsersMethod
- func (u *UsersMethod) Blocks(id uint, opt *twitch.ListOptions) (*twitch.UserBlocksList, error)
- func (u *UsersMethod) Follow(user uint, target uint) (*twitch.UserFollow, error)
- func (u *UsersMethod) Follows(id uint, opt *twitch.ListOptions) (*twitch.UserFollowsList, error)
- func (u *UsersMethod) Name(name string) (*twitch.UsersList, error)
- func (u *UsersMethod) User(id uint) (*twitch.User, error)
- type VideosMethod
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelsMethod ¶
type ChannelsMethod struct {
// contains filtered or unexported fields
}
ChannelsMethod wraps up channel api calls https://dev.twitch.tv/docs/v5/reference/channels/
func (*ChannelsMethod) Channel ¶
func (c *ChannelsMethod) Channel(id uint) (*twitch.Channel, error)
Channel queries the api for the Channel object for the specified channel If `id` is 0, returns the channel of authenticated user. https://dev.twitch.tv/docs/v5/reference/channels/#get-channel https://dev.twitch.tv/docs/v5/reference/channels/#get-channel-by-id
func (*ChannelsMethod) Editors ¶
func (c *ChannelsMethod) Editors(id uint) (*twitch.ChannelEditorsList, error)
Editors gets a list of users who are editors of the specified channel https://dev.twitch.tv/docs/v5/reference/channels/#get-channel-editors
func (*ChannelsMethod) Follows ¶
func (c *ChannelsMethod) Follows(id uint, opt *twitch.ListOptions) (*twitch.ChannelFollowsList, error)
Follows returns a list of users who follow the specified channel https://dev.twitch.tv/docs/v5/reference/channels/#get-channel-followers
func (*ChannelsMethod) Subscriptions ¶
func (c *ChannelsMethod) Subscriptions(id uint, opt *twitch.ListOptions) (*twitch.ChannelSubscriptionsList, error)
Subscriptions returns a list of users who subscribe to the specified channel https://dev.twitch.tv/docs/v5/reference/channels/#get-channel-subscribers
func (*ChannelsMethod) Videos ¶
func (c *ChannelsMethod) Videos(id uint, opt *twitch.ListOptions) (*twitch.VideosList, error)
Videos returns a list of videos ordered by time of creation for channel `id` https://dev.twitch.tv/docs/v5/reference/channels/#get-channel-videos
type ChatMethod ¶
type ChatMethod struct {
// contains filtered or unexported fields
}
ChatMethod wraps up chat api calls https://dev.twitch.tv/docs/v5/reference/chat/
func (*ChatMethod) Badges ¶
func (c *ChatMethod) Badges(id uint) (*twitch.ChatBadges, error)
Badges returns a list of badges that apply to the specified channel https://dev.twitch.tv/docs/v5/reference/chat/#get-chat-badges-by-channel
func (*ChatMethod) Emoticons ¶
func (c *ChatMethod) Emoticons() (*twitch.EmoticonsList, error)
Emoticons returns a list of emoticons available in chat https://dev.twitch.tv/docs/v5/reference/chat/#get-all-chat-emoticons
func (*ChatMethod) EmoticonsBySet ¶
func (c *ChatMethod) EmoticonsBySet(set uint) (*twitch.EmoticonSets, error)
EmoticonsBySet returns a list of emoticons available in the specified set https://dev.twitch.tv/docs/v5/reference/chat/#get-chat-emoticons-by-set
type Client ¶
type Client struct {
OAuthToken string
// Twitch api methods
// TODO - ChannelFeed // https://dev.twitch.tv/docs/v5/reference/channel-feed/
Channels *ChannelsMethod // https://dev.twitch.tv/docs/v5/reference/channels/
Chat *ChatMethod // https://dev.twitch.tv/docs/v5/reference/chat/
Games *GamesMethod // https://dev.twitch.tv/docs/v5/reference/games/
Ingests *IngestsMethod // https://dev.twitch.tv/docs/v5/reference/ingests/
Search *SearchMethod // https://dev.twitch.tv/docs/v5/reference/search/
Streams *StreamsMethod // https://dev.twitch.tv/docs/v5/reference/streams/
Teams *TeamsMethod // https://dev.twitch.tv/docs/v5/reference/teams/
Users *UsersMethod // https://dev.twitch.tv/docs/v5/reference/users/
Videos *VideosMethod // https://dev.twitch.tv/docs/v5/reference/videos/
Tmi *TmiMethod // Undocumented tmi api methods
// contains filtered or unexported fields
}
Client is a struct containing methods to query the twitch api
func NewClient ¶
NewClient returns a new twitch client used to communicate with the API clientID is required to be able to query the api
func (*Client) Get ¶
Get issues an API get request and returns the API response. The response body is decoded and stored in the value pointed by r.
type GamesMethod ¶
type GamesMethod struct {
// contains filtered or unexported fields
}
GamesMethod wraps up game api calls https://dev.twitch.tv/docs/v5/reference/games/
func (*GamesMethod) Top ¶
func (g *GamesMethod) Top(opt *twitch.ListOptions) (*twitch.TopGamesList, error)
Top returns a list of games objects sorted by number of current viewers, most popular first https://dev.twitch.tv/docs/v5/reference/games/#get-top-games
type IngestsMethod ¶
type IngestsMethod struct {
// contains filtered or unexported fields
}
IngestsMethod wraps up ingest api calls https://dev.twitch.tv/docs/v5/reference/ingests/
func (*IngestsMethod) List ¶
func (i *IngestsMethod) List() (*twitch.IngestsList, error)
List returns a list of available ingest servers https://dev.twitch.tv/docs/v5/reference/ingests/#get-ingest-server-list
type SearchMethod ¶
type SearchMethod struct {
// contains filtered or unexported fields
}
SearchMethod wraps up search api calls https://dev.twitch.tv/docs/v5/reference/search/
func (*SearchMethod) Channels ¶
func (s *SearchMethod) Channels(q string, opt *twitch.ListOptions) (*twitch.ChannelsSearch, error)
Channels returns a list of channels that match the search query https://dev.twitch.tv/docs/v5/reference/search/#search-channels
func (*SearchMethod) Games ¶
func (s *SearchMethod) Games(q string, opt *twitch.ListOptions) (*twitch.GamesSearch, error)
Games returns a list of games that match the search query https://dev.twitch.tv/docs/v5/reference/search/#search-games
func (*SearchMethod) Streams ¶
func (s *SearchMethod) Streams(q string, opt *twitch.ListOptions) (*twitch.StreamsList, error)
Streams returns a list of streams that match the search query https://dev.twitch.tv/docs/v5/reference/search/#search-streams
type StreamsMethod ¶
type StreamsMethod struct {
// contains filtered or unexported fields
}
StreamsMethod wraps up stream api calls https://dev.twitch.tv/docs/v5/reference/streams/
func (*StreamsMethod) Channel ¶
func (s *StreamsMethod) Channel(id uint) (*twitch.ChannelStream, error)
Channel returns a stream object of the specified channel if they are live https://dev.twitch.tv/docs/v5/reference/streams/#get-stream-by-channel
func (*StreamsMethod) Featured ¶
func (s *StreamsMethod) Featured(opt *twitch.ListOptions) (*twitch.FeaturedStreamsList, error)
Featured returns a list of featured stream objects https://dev.twitch.tv/docs/v5/reference/streams/#get-featured-streams
func (*StreamsMethod) Followed ¶
func (s *StreamsMethod) Followed(opt *twitch.ListOptions) (*twitch.StreamsList, error)
Followed returns a list of stream objects that the authenticated user is following. https://dev.twitch.tv/docs/v5/reference/streams/#get-followed-streams
func (*StreamsMethod) List ¶
func (s *StreamsMethod) List(opt *twitch.ListOptions) (*twitch.StreamsList, error)
List returns a list of stream objects according to optional parameters. https://dev.twitch.tv/docs/v5/reference/streams/#get-all-streams
func (*StreamsMethod) Summary ¶
func (s *StreamsMethod) Summary(opt *twitch.ListOptions) (*twitch.StreamSummary, error)
Summary returns a summary of all current streams https://dev.twitch.tv/docs/v5/reference/streams/#get-streams-summary
type TeamsMethod ¶
type TeamsMethod struct {
// contains filtered or unexported fields
}
TeamsMethod wraps up team api calls https://dev.twitch.tv/docs/v5/reference/teams/
func (*TeamsMethod) List ¶
func (t *TeamsMethod) List(opt *twitch.ListOptions) (*twitch.TeamsList, error)
List returns a list of all the teams https://dev.twitch.tv/docs/v5/reference/teams/#get-all-teams
func (*TeamsMethod) Team ¶
func (t *TeamsMethod) Team(name string) (*twitch.Team, error)
Team returns the specified team https://dev.twitch.tv/docs/v5/reference/teams/#get-team
type TmiMethod ¶
type TmiMethod struct {
// contains filtered or unexported fields
}
TmiMethod wraps up tmi api calls
type UsersMethod ¶
type UsersMethod struct {
// contains filtered or unexported fields
}
UsersMethod wraps up user api calls https://dev.twitch.tv/docs/v5/reference/users/
func (*UsersMethod) Blocks ¶
func (u *UsersMethod) Blocks(id uint, opt *twitch.ListOptions) (*twitch.UserBlocksList, error)
Blocks returns a list of users blocked by the specified user https://dev.twitch.tv/docs/v5/reference/users/#get-user-block-list
func (*UsersMethod) Follow ¶
func (u *UsersMethod) Follow(user uint, target uint) (*twitch.UserFollow, error)
Follow gets the status of follow relationship between user and target channel https://dev.twitch.tv/docs/v5/reference/users/#check-user-follows-by-channel
func (*UsersMethod) Follows ¶
func (u *UsersMethod) Follows(id uint, opt *twitch.ListOptions) (*twitch.UserFollowsList, error)
Follows returns a list of channels that the user is following https://dev.twitch.tv/docs/v5/reference/users/#get-user-follows
func (*UsersMethod) Name ¶
func (u *UsersMethod) Name(name string) (*twitch.UsersList, error)
Name returns a user object for a user specified by their login name
func (*UsersMethod) User ¶
func (u *UsersMethod) User(id uint) (*twitch.User, error)
User returns a user object for the specified user or the authenticated user if id is 0 https://dev.twitch.tv/docs/v5/reference/users/#get-user https://dev.twitch.tv/docs/v5/reference/users/#get-user-by-id
type VideosMethod ¶
type VideosMethod struct {
// contains filtered or unexported fields
}
VideosMethod wraps up video api calls https://dev.twitch.tv/docs/v5/reference/videos/
func (*VideosMethod) Followed ¶
func (v *VideosMethod) Followed(opt *twitch.ListOptions) (*twitch.VideosList, error)
Followed returns a list of videos from channels the authenticated user is following https://dev.twitch.tv/docs/v5/reference/videos/#get-followed-videos
func (*VideosMethod) ID ¶
func (v *VideosMethod) ID(id uint) (*twitch.Video, error)
ID returns information about the specified video https://dev.twitch.tv/docs/v5/reference/videos/#get-video
func (*VideosMethod) Top ¶
func (v *VideosMethod) Top(opt *twitch.ListOptions) (*twitch.TopVideosList, error)
Top returns a list of the top viewed videos https://dev.twitch.tv/docs/v5/reference/videos/#get-top-videos