Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetStreamInput ¶
type GetStreamInput struct { After string `url:"after,omitempty"` Before string `url:"before,omitempty"` CommunityID string `url:"community_id,omitempty"` First int `url:"first,omitempty"` GameID string `url:"game_id,omitempty"` Language string `url:"language,omitempty"` Type string `url:"type,omitempty"` UserID string `url:"user_id,omitempty"` UserLogin string `url:"user_login,omitempty"` }
GetStreamInput adds filters to the GetStream function see GetStream for more information
type GetStreamer ¶
type GetStreamer interface {
GetStream(input GetStreamInput) (StreamList, error)
}
GetStreamer is a simple interface for the GetStream function
type GetUserInput ¶
GetUserInput adds filters to the GetUser function
type Interface ¶
type Interface interface { GetStreamer StreamExtracter }
Interface for the whole lib
type Pagination ¶
type Pagination struct {
Cursor string `json:"cursor"`
}
Pagination contains the cursor used for paginated results
type Session ¶
Session is a base struct for calling the other functions
func (Session) ExtractStreamUrl ¶
ExtractStreamUrl returns the lists of urls for each stream quality
func (Session) GetStream ¶
func (s Session) GetStream(input GetStreamInput) (StreamList, error)
GetStream returns a list of Streams reference : https://dev.twitch.tv/docs/api/reference#get-streams
func (Session) GetUser ¶
func (s Session) GetUser(input GetUserInput) (UserList, error)
GetUser returns a list of twitch user https://dev.twitch.tv/docs/api/reference#get-users
type Stream ¶
type Stream struct { ID string `json:"id"` UserID string `json:"user_id"` GameID string `json:"game_id"` CommunityIds []string `json:"community_ids"` 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"` }
Stream is a livestream on Twitch
type StreamExtracter ¶
StreamExtracter is a simple interface for ExtractStreamUrl
type StreamList ¶
type StreamList struct { Data []Stream `json:"data"` Page Pagination `json:"pagination"` }
StreamList is the list of stream outputted by GetStream
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"` }
User is a twitch User
type UserList ¶
type UserList struct { Data []Stream `json:"data"` Page Pagination `json:"pagination"` }
UserList is the list of users outputted by GetStream