twitchapi

package
v0.0.0-...-3e1bd26 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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

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

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

Client is a struct containing methods to query the twitch api

func NewClient

func NewClient(httpClient *http.Client, clientID string) (*Client, error)

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

func (c *Client) Get(baseURL *url.URL, path string, r interface{}) (*http.Response, error)

Get issues an API get request and returns the API response. The response body is decoded and stored in the value pointed by r.

func (*Client) GetKraken

func (c *Client) GetKraken(path string, r interface{}) (*http.Response, error)

func (*Client) GetTMI

func (c *Client) GetTMI(path string, r interface{}) (*http.Response, error)

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

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

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

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

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

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

func (*TmiMethod) Hosts

func (t *TmiMethod) Hosts(channel uint64) (*twitch.TmiHostList, error)

Hosts returns a list of the channels hosting the specified channel

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

Top returns a list of the top viewed videos https://dev.twitch.tv/docs/v5/reference/videos/#get-top-videos

Jump to

Keyboard shortcuts

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