Documentation
¶
Index ¶
- type Channel
- type CommonChannelFields
- type Follow
- type FollowResponse
- type HelixUser
- type HelixVideo
- type HelixVideosResponse
- type RequestOptions
- type Stream
- type StreamResponse
- type StreamsResponse
- type Subscription
- type SubscriptionResponse
- type TwitchChannel
- type TwitchClient
- func (client *TwitchClient) GetChannel(channel string) (*Channel, error)
- func (client *TwitchClient) GetChannelFollows(channel string, options *RequestOptions) FollowResponse
- func (client *TwitchClient) GetChannelForId(channelId int64) (TwitchChannel, error)
- func (client *TwitchClient) GetChannelForName(channelName string) (TwitchChannel, error)
- func (client *TwitchClient) GetChannelStream(channel string, options *RequestOptions) (StreamResponse, error)
- func (client *TwitchClient) GetChannelSubscriptions(channel string, options *RequestOptions) SubscriptionResponse
- func (client *TwitchClient) GetChannelVideos(channel string, broadcasts bool, limit int64) (VideosResponse, error)
- func (client *TwitchClient) GetChannelsStream(channels ...string) (StreamsResponse, error)
- func (client *TwitchClient) GetChannelsStreamV5(channelIDs ...string) (StreamsResponse, error)
- func (client *TwitchClient) GetFollowersForID(userID string, options *RequestOptions) (helixFollowResponse, error)
- func (client *TwitchClient) GetStreamsForIDs(options *RequestOptions, channelIDs ...string) (res helixStreamsResponse, err error)
- func (client *TwitchClient) GetSubscribersForID(userID string, options *RequestOptions) (res helixSubscriptionResponse, err error)
- func (client *TwitchClient) GetUser(username string) (*User, error)
- func (client *TwitchClient) GetUsers(id, login []string) (*[]HelixUser, error)
- func (client *TwitchClient) GetVideosForID(userID string, options *RequestOptions) (res HelixVideosResponse, err error)
- type User
- type Video
- type VideosResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct {
Mature bool `json:"mature"`
Status string `json:"status"`
BroadcasterLanguage string `json:"broadcaster_language"`
BroadcasterType string `json:"broadcaster_type"`
DisplayName string `json:"display_name"`
Game string `json:"game"`
Delay int64 `json:"delay"`
Language string `json:"language"`
Id int64 `json:"_id"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Logo string `json:"logo"`
Banner string `json:"banner"`
VideoBanner string `json:"video_banner"`
ProfileBanner string `json:"profile_banner"`
ProfileBannerBackgroundColor string `json:"profile_banner_background_color"`
Partner bool `json:"partner"`
Views int64 `json:"views"`
Followers int64 `json:"followers"`
}
type CommonChannelFields ¶
type CommonChannelFields struct {
Mature bool `json:"mature"`
Status string `json:"status"`
BroadcasterLanguage string `json:"broadcaster_language"`
BroadcasterType string `json:"broadcaster_type"`
DisplayName string `json:"display_name"`
Game string `json:"game"`
Delay int64 `json:"delay"`
Language string `json:"language"`
Id int64 `json:"_id"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Logo string `json:"logo"`
Banner string `json:"banner"`
VideoBanner string `json:"video_banner"`
ProfileBanner string `json:"profile_banner"`
ProfileBannerBackgroundColor string `json:"profile_banner_background_color"`
Partner bool `json:"partner"`
Views int64 `json:"views"`
Followers int64 `json:"followers"`
}
type FollowResponse ¶
type HelixUser ¶
type HelixUser 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"`
ProfileImageURL string `json:"profile_image_url"`
OfflineImageURL string `json:"offline_image_url"`
ViewCount int64 `json:"view_count"`
Email string `json:"email"`
}
func (*HelixUser) IsPartnered ¶
type HelixVideo ¶
type HelixVideo struct {
ID string `json:"id"`
UserID string `json:"user_id"`
UserName string `json:"user_name"`
Title string `json:"title"`
Description string `json:"description"`
CreatedAt time.Time `json:"created_at"`
PublishedAt time.Time `json:"published_at"`
URL string `json:"url"`
ThumbnailURL string `json:"thumbnail_url"`
Viewable string `json:"viewable"`
ViewCount int64 `json:"view_count"`
Language string `json:"language"`
Type string `json:"type"`
Duration string `json:"duration"`
}
type HelixVideosResponse ¶
type HelixVideosResponse struct {
Videos []HelixVideo `json:"data"`
Pagination map[string]string
}
type RequestOptions ¶
type StreamResponse ¶
type StreamsResponse ¶
type Subscription ¶
type SubscriptionResponse ¶
type SubscriptionResponse struct {
Total int64 `json:"_total"`
Subscriptions []Subscription `json:"subscriptions"`
}
type TwitchChannel ¶
type TwitchClient ¶
func NewTwitchClient ¶
func NewTwitchClient(clientID string) TwitchClient
func NewTwitchClientWithHTTPClient ¶
func NewTwitchClientWithHTTPClient(clientID string, httpClient *http.Client) TwitchClient
func (*TwitchClient) GetChannel ¶
func (client *TwitchClient) GetChannel(channel string) (*Channel, error)
GetChannel requests channel information from Twitch. It returns a Channel struct if successful and any error encountered.
func (*TwitchClient) GetChannelFollows ¶
func (client *TwitchClient) GetChannelFollows(channel string, options *RequestOptions) FollowResponse
func (*TwitchClient) GetChannelForId ¶
func (client *TwitchClient) GetChannelForId(channelId int64) (TwitchChannel, error)
GetChannelForId requests channel information for the given channel ID. It returns a Channel struct if successful and any error encountered.
func (*TwitchClient) GetChannelForName ¶
func (client *TwitchClient) GetChannelForName(channelName string) (TwitchChannel, error)
GetChannelForName requests channel information for the given channel name. It returns a v3Channel struct if successful and any error encountered.
func (*TwitchClient) GetChannelStream ¶
func (client *TwitchClient) GetChannelStream(channel string, options *RequestOptions) (StreamResponse, error)
func (*TwitchClient) GetChannelSubscriptions ¶
func (client *TwitchClient) GetChannelSubscriptions(channel string, options *RequestOptions) SubscriptionResponse
func (*TwitchClient) GetChannelVideos ¶
func (client *TwitchClient) GetChannelVideos(channel string, broadcasts bool, limit int64) (VideosResponse, error)
func (*TwitchClient) GetChannelsStream ¶
func (client *TwitchClient) GetChannelsStream(channels ...string) (StreamsResponse, error)
func (*TwitchClient) GetChannelsStreamV5 ¶
func (client *TwitchClient) GetChannelsStreamV5(channelIDs ...string) (StreamsResponse, error)
func (*TwitchClient) GetFollowersForID ¶
func (client *TwitchClient) GetFollowersForID(userID string, options *RequestOptions) (helixFollowResponse, error)
GetFollowersForID requests follower information for a user/channel ID.
https://dev.twitch.tv/docs/api/reference/#get-users-follows
Follower data is sorted by Twitch: most recent follower first.
A pagination cursor may be available in yourResponse.Pagination["cursor"]. This can be supplied in the options.Extra struct with the key "after" on subsequent calls.
func (*TwitchClient) GetStreamsForIDs ¶
func (client *TwitchClient) GetStreamsForIDs(options *RequestOptions, channelIDs ...string) (res helixStreamsResponse, err error)
GetStreamsForIDs requests stream info for one or more channels.
https://dev.twitch.tv/docs/api/reference/#get-streams
A pagination cursor may be available in yourResponse.Pagination["cursor"]. This can be supplied in the options.Extra struct with the key "after" on subsequent calls.
func (*TwitchClient) GetSubscribersForID ¶
func (client *TwitchClient) GetSubscribersForID(userID string, options *RequestOptions) (res helixSubscriptionResponse, err error)
GetSubscribersForID requests subscriber info for a user/channel ID.
https://dev.twitch.tv/docs/api/reference/#get-broadcaster-subscriptions
Note: Twitch requires an OAuth access token with the `channel:read:subscriptions` scope in order to access subscriber information for the matching user.
A pagination cursor may be available in yourResponse.Pagination["cursor"]. This can be supplied in the options.Extra struct with the key "after" on subsequent calls.
func (*TwitchClient) GetUsers ¶
func (client *TwitchClient) GetUsers(id, login []string) (*[]HelixUser, error)
func (*TwitchClient) GetVideosForID ¶
func (client *TwitchClient) GetVideosForID(userID string, options *RequestOptions) (res HelixVideosResponse, err error)
GetVideosForID requests video info for a user/channel ID.
https://dev.twitch.tv/docs/api/reference/#get-videos
A pagination cursor may be available in yourResponse.Pagination["cursor"]. This can be supplied in the options.Extra struct with the key "after" on subsequent calls.
type User ¶
type User struct {
DisplayName string `json:"display_name"`
Id int64 `json:"_id"`
Name string `json:"name"`
Type string `json:"type"`
Bio string `json:"bio"`
Logo string `json:"logo"`
Email string `json:"email"`
Partnered bool `json:"partnered"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type VideosResponse ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
twitchClient
command
twitchClient is a simple CLI app for testing twitchgo API calls.
|
twitchClient is a simple CLI app for testing twitchgo API calls. |