Documentation
¶
Index ¶
- Constants
- Variables
- func GetTopGamesNames()
- func Request(method string, url string, body io.Reader, auth bool, context bool) (string, error)
- func SetTwitchChannel()
- func UpdateChannelGame(game string)
- type Channel
- type ChannelG
- type DBGame
- type Game
- type GameC
- type GameImages
- type SGame
- type SearchRespose
- type TopGamesResponse
- type TwitchGame
Constants ¶
View Source
const ( ClientID string = "1jcuu1fyzg8nabsmoplijb826zoyte0" RedirectURI string = "http://localhost:8000/twitch/token/" RequestTokenURL string = "" + "https://id.twitch.tv/oauth2/authorize" + "?response_type=token" + "&client_id=" + ClientID + "&redirect_uri=" + RedirectURI + "&force_verify=true" + "&scope=channel_editor+channel_read" TwitchAPIURL string = "https://api.twitch.tv/kraken" )
Variables ¶
View Source
var ( Token = "" GameList TopGamesResponse GameDB []DBGame UserChannel Channel )
Functions ¶
func GetTopGamesNames ¶
func GetTopGamesNames()
func Request ¶
Request - request for twitch api
func SetTwitchChannel ¶
func SetTwitchChannel()
Types ¶
type Channel ¶
type Channel struct {
Mature bool `json:"mature"`
Status string `json:"status"`
BroadcasterLanguage string `json:"broadcaster_language"`
DisplayName string `json:"display_name"`
Game string `json:"game"`
Language string `json:"language"`
ID string `json:"_id"`
Name string `json:"name"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Partner bool `json:"partner"`
Logo string `json:"logo"`
VideoBanner string `json:"video_banner"`
ProfileBanner string `json:"profile_banner"`
ProfileBannerBackgroundColor string `json:"profile_banner_background_color"`
URL string `json:"url"`
Views int64 `json:"views"`
Followers int64 `json:"followers"`
BroadcasterType string `json:"broadcaster_type"`
StreamKey string `json:"stream_key"`
Email string `json:"email"`
}
type DBGame ¶
type Game ¶
type Game struct {
ID int64 `json:"_id"`
Box GameImages `json:"box"`
GiantbombID int64 `json:"giantbomb_id"`
Logo GameImages `json:"logo"`
Name string `json:"name"`
Popularity int64 `json:"popularity"`
}
type GameImages ¶
type SGame ¶
type SGame struct {
Name string `json:"name"`
Popularity int64 `json:"popularity"`
ID int64 `json:"_id"`
GiantbombID int64 `json:"giantbomb_id"`
Box GameImages `json:"box"`
Logo GameImages `json:"logo"`
LocalizedName string `json:"localized_name"`
Locale string `json:"locale"`
}
SGame - Search Game
type SearchRespose ¶
type SearchRespose struct {
Games []SGame `json:"games"`
}
SearchRespose - Search Response
type TopGamesResponse ¶
type TopGamesResponse struct {
Total int64 `json:"_total"`
Top []TwitchGame `json:"top"`
}
func GetTopGames ¶
func GetTopGames(limit int, offset int) TopGamesResponse
Source Files
¶
- config.go
- twitchChannel.go
- twitchClient.go
- twitchSearch.go
- twitchTopGame.go
Click to show internal directories.
Click to hide internal directories.