twitch

package
v1.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate() error

func CheckUserAccessToken added in v1.0.9

func CheckUserAccessToken(accessToken string) error

Types

type AuthTokenResponse

type AuthTokenResponse struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
	TokenType   string `json:"token_type"`
}

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"`
}

func GetUserByLogin added in v1.1.0

func GetUserByLogin(cName string) (Channel, error)

type ChannelResponse

type ChannelResponse struct {
	Data []Channel `json:"data"`
}

type Language added in v1.1.0

type Language string

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 Pagination

type Pagination struct {
	Cursor string `json:"cursor"`
}

type Service

type Service struct {
}

func NewService

func NewService() *Service

func (*Service) GetStreams

func (s *Service) GetStreams(queryParams string) (Stream, error)

func (*Service) GetVodByID

func (s *Service) GetVodByID(vID string) (Vod, error)

type Stream

type Stream struct {
	Data       []Live     `json:"data"`
	Pagination Pagination `json:"pagination"`
}

type TwitchVideoResponse added in v1.1.0

type TwitchVideoResponse struct {
	Data       []Video    `json:"data"`
	Pagination Pagination `json:"pagination"`
}

type Type added in v1.1.0

type Type string

type UserLogin added in v1.1.0

type UserLogin string

type UserName added in v1.1.0

type UserName string

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"`
}

func GetVideosByUser added in v1.1.0

func GetVideosByUser(userID string, videoType string) ([]Video, error)

type Viewable added in v1.1.0

type Viewable string

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL