Documentation
¶
Overview ¶
Package helixapi is used for twitch's helix API
Index ¶
- Constants
- func GenerateAuthorizeRequest(clientID, redirectURI, scopes string) string
- func GetRefreshTokenClientCredentials(clientID, clientSecret, scope string) (resp *tokenReponse, jsoerr *network.JSONError, err error)
- func GetRefreshTokenFromAuthCode(clientID, clientSecret, authCode, redirectURI string) (resp *tokenReponse, jsoerr *network.JSONError, err error)
- func RefreshToken(clientID, clientSecret, refreshToken string) (resp *tokenReponse, jsoerr *network.JSONError, err error)
- type Following
- type Followings
- type Stream
- type Streams
- type TwitchHelix
- func (th *TwitchHelix) GetFollowers(channelID string, count int, cursor string) (resp *Followings, jsoerr *network.JSONError, err error)
- func (th *TwitchHelix) GetStream(channelID string) (resp *Stream, jsoerr *network.JSONError, err error)
- func (th *TwitchHelix) GetStreamByLogin(login string) (resp *Stream, jsoerr *network.JSONError, err error)
- func (th *TwitchHelix) GetUserByName(name string) (resp *Users, jsoerr *network.JSONError, err error)
- func (th *TwitchHelix) GetUsersByNames(names []string) (resp *Users, jsoerr *network.JSONError, err error)
- func (th *TwitchHelix) IsUserFollowingChannel(userID, channelID string) (resp *Followings, jsoerr *network.JSONError, err error)
- func (th *TwitchHelix) ValidateAndRefreshClientCredentials() (resp *verificationResponse, jsoerr *network.JSONError, err error)
- func (th *TwitchHelix) ValidateToken() (resp *verificationResponse, jsoerr *network.JSONError, err error)
- type User
- type Users
Constants ¶
const AppName string = "goPurple/helix"
AppName is the name of the application
const BaseURL = "https://api.twitch.tv/helix"
BaseURL of the twitch helix API
const FullVersion string = AppName + VersionMajor + "." + VersionMinor + "." + VersionPatch + VersionBuild
FullVersion contains the full name and version of this package in a printable string
const VersionBuild string = "b"
VersionBuild is the type of this release. s(table), b(eta), d(evelopment), n(ightly)
const VersionMajor string = "0"
VersionMajor 0 means in development, >1 ensures compatibility with each minor version, but breakes with new major version
const VersionMinor string = "1"
VersionMinor introduces changes that require a new version number. If the major version is 0, they are likely to break compatibility
const VersionPatch string = "0"
VersionMinor introduces changes that do not break compatibility, but require a new version number.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Following ¶
type Following struct { FromID string `json:"from_id"` FromLogin string `json:"from_login"` FromName string `json:"from_name"` ToID string `json:"to_id"` ToName string `json:"to_name"` FollowedAt time.Time `json:"followed_at"` }
Following contains information about a follow relation of a user
type Followings ¶
type Stream ¶
type Stream struct { ID string `json:"id"` UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` GameID string `json:"game_id"` GameName string `json:"game_name"` Type string `json:"type"` Title string `json:"title"` ViewerCount int `json:"viewer_count"` StartedAt time.Time `json:"started_at"` Language string `json:"language"` ThumbnailURL string `json:"thumbnail_url"` TagIds []string `json:"tag_ids"` IsMature bool `json:"is_mature"` }
type TwitchHelix ¶
TwitchKraken exposes the twitch kraken API (v5)
func (*TwitchHelix) GetFollowers ¶
func (th *TwitchHelix) GetFollowers(channelID string, count int, cursor string) (resp *Followings, jsoerr *network.JSONError, err error)
func (*TwitchHelix) GetStream ¶
func (th *TwitchHelix) GetStream(channelID string) (resp *Stream, jsoerr *network.JSONError, err error)
GetStream gets information about a stream
func (*TwitchHelix) GetStreamByLogin ¶
func (th *TwitchHelix) GetStreamByLogin(login string) (resp *Stream, jsoerr *network.JSONError, err error)
GetStreamByLogin gets information about a stream
func (*TwitchHelix) GetUserByName ¶
func (th *TwitchHelix) GetUserByName(name string) (resp *Users, jsoerr *network.JSONError, err error)
GetUserByName returns a single user searched by name
func (*TwitchHelix) GetUsersByNames ¶
func (th *TwitchHelix) GetUsersByNames(names []string) (resp *Users, jsoerr *network.JSONError, err error)
GetUsersByNames returns a list of users searched by their names
func (*TwitchHelix) IsUserFollowingChannel ¶
func (th *TwitchHelix) IsUserFollowingChannel(userID, channelID string) (resp *Followings, jsoerr *network.JSONError, err error)
IsUserFollowingChannel returns a relation if a specific user is following a channel
func (*TwitchHelix) ValidateAndRefreshClientCredentials ¶
func (th *TwitchHelix) ValidateAndRefreshClientCredentials() (resp *verificationResponse, jsoerr *network.JSONError, err error)
func (*TwitchHelix) ValidateToken ¶
func (th *TwitchHelix) ValidateToken() (resp *verificationResponse, jsoerr *network.JSONError, err error)
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"` ProfileImageURL string `json:"profile_image_url"` OfflineImageURL string `json:"offline_image_url"` ViewCount int `json:"view_count"` Email string `json:"email"` CreatedAt time.Time `json:"created_at"` }
User contains information about a user