Documentation
¶
Index ¶
- func Authenticate() error
- func CheckUserAccessToken(accessToken string) error
- func SetTwitchCategories() error
- type AuthTokenResponse
- type Category
- type CategoryResponse
- type Channel
- type ChannelResponse
- type Data
- type Details
- type DetailsTypename
- type Edge
- type Extensions
- type GQLChapterData
- type GQLChapterDataVideo
- type GQLChapterResponse
- type GQLGame
- type GQLResponse
- type GQLVideo
- type GameClass
- type GameTypename
- type Language
- type Live
- type Moments
- type Node
- type NodeVideo
- type Pagination
- type ResourceRestriction
- type Service
- type Stream
- type TwitchAPI
- type TwitchCategory
- type TwitchVideoResponse
- type Type
- type UserLogin
- type UserName
- type Video
- type Viewable
- type Vod
- type VodResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticate ¶
func Authenticate() error
func CheckUserAccessToken ¶ added in v1.0.9
func SetTwitchCategories ¶ added in v1.2.4
func SetTwitchCategories() error
SetTwitchCategories sets the twitch categories in the database
Types ¶
type AuthTokenResponse ¶
type CategoryResponse ¶ added in v1.2.4
type CategoryResponse struct { Data []TwitchCategory `json:"data"` Pagination Pagination `json:"pagination"` }
type Channel ¶
type Channel 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"` CreatedAt string `json:"created_at"` }
type ChannelResponse ¶
type ChannelResponse struct {
Data []Channel `json:"data"`
}
type Details ¶ added in v1.2.4
type Details struct { Game GameClass `json:"game"` Typename DetailsTypename `json:"__typename"` }
type DetailsTypename ¶ added in v1.2.4
type DetailsTypename string
const (
GameChangeMomentDetails DetailsTypename = "GameChangeMomentDetails"
)
type Extensions ¶ added in v1.2.0
type GQLChapterData ¶ added in v1.2.4
type GQLChapterData struct {
Video GQLChapterDataVideo `json:"video"`
}
type GQLChapterDataVideo ¶ added in v1.2.4
type GQLChapterResponse ¶ added in v1.2.4
type GQLChapterResponse struct { Data GQLChapterData `json:"data"` Extensions Extensions `json:"extensions"` }
func GQLGetChapters ¶ added in v1.2.4
func GQLGetChapters(id string) (GQLChapterResponse, error)
type GQLResponse ¶ added in v1.2.0
type GQLResponse struct { Data Data `json:"data"` Extensions Extensions `json:"extensions"` }
func GQLGetVideo ¶ added in v1.2.0
func GQLGetVideo(id string) (GQLResponse, error)
type GQLVideo ¶ added in v1.2.0
type GQLVideo struct { BroadcastType string `json:"broadcastType"` ResourceRestriction ResourceRestriction `json:"resourceRestriction"` Game GQLGame `json:"game"` Title string `json:"title"` CreatedAt string `json:"createdAt"` }
type GameClass ¶ added in v1.2.4
type GameClass struct { ID string `json:"id"` DisplayName string `json:"displayName"` BoxArtURL string `json:"boxArtURL"` Typename GameTypename `json:"__typename"` }
type Live ¶
type Live 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 int64 `json:"viewer_count"` StartedAt string `json:"started_at"` Language string `json:"language"` ThumbnailURL string `json:"thumbnail_url"` TagIDS []string `json:"tag_ids"` IsMature bool `json:"is_mature"` }
type Node ¶ added in v1.2.4
type Node struct { Moments Moments `json:"moments"` ID string `json:"id"` DurationMilliseconds int64 `json:"durationMilliseconds"` PositionMilliseconds int64 `json:"positionMilliseconds"` Type Type `json:"type"` Description string `json:"description"` SubDescription string `json:"subDescription"` ThumbnailURL string `json:"thumbnailURL"` Details Details `json:"details"` Video NodeVideo `json:"video"` Typename string `json:"__typename"` }
type Pagination ¶
type Pagination struct {
Cursor string `json:"cursor"`
}
type ResourceRestriction ¶ added in v1.2.0
type Service ¶
type Service struct { }
func NewService ¶
func NewService() *Service
func (*Service) GetCategories ¶ added in v1.2.4
func (s *Service) GetCategories() ([]*ent.TwitchCategory, error)
type Stream ¶
type Stream struct { Data []Live `json:"data"` Pagination Pagination `json:"pagination"` }
type TwitchCategory ¶ added in v1.2.4
type TwitchCategory struct { ID string `json:"id"` Name string `json:"name"` BoxArtURL string `json:"box_art_url"` IgdbID string `json:"igdb_id"` }
func GetCategories ¶ added in v1.2.4
func GetCategories() ([]TwitchCategory, error)
GetCategories gets the top 100 twitch categories It then gets the next 100 categories until there are no more using the cursor Returns a different number of categories each time it is called for some reason
type TwitchVideoResponse ¶ added in v1.1.0
type TwitchVideoResponse struct { Data []Video `json:"data"` Pagination Pagination `json:"pagination"` }
type Video ¶ added in v1.1.0
type Video struct { ID string `json:"id"` StreamID string `json:"stream_id"` UserID string `json:"user_id"` UserLogin UserLogin `json:"user_login"` UserName UserName `json:"user_name"` Title string `json:"title"` Description string `json:"description"` CreatedAt string `json:"created_at"` PublishedAt string `json:"published_at"` URL string `json:"url"` ThumbnailURL string `json:"thumbnail_url"` Viewable Viewable `json:"viewable"` ViewCount int64 `json:"view_count"` Language Language `json:"language"` Type Type `json:"type"` Duration string `json:"duration"` MutedSegments interface{} `json:"muted_segments"` }
type Vod ¶
type Vod struct { ID string `json:"id"` StreamID string `json:"stream_id"` UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` Title string `json:"title"` Description string `json:"description"` CreatedAt string `json:"created_at"` PublishedAt string `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"` MutedSegments interface{} `json:"muted_segments"` }
type VodResponse ¶
type VodResponse struct { Data []Vod `json:"data"` Pagination Pagination `json:"pagination"` }
Click to show internal directories.
Click to hide internal directories.