helix

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	StreamStatusUnknown = false
	StreamStatusKnown   = true
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelData added in v1.0.4

type ChannelData struct {
	BroadcasterID       string           `json:"broadcaster_id"`
	BroadcasterName     string           `json:"broadcaster_name"`
	GameName            string           `json:"game_name"`
	GameID              string           `json:"game_id"`
	BroadcasterLanguage string           `json:"broadcaster_language"`
	Title               string           `json:"title"`
	Delay               int              `json:"integer"`
	StreamStatus        StreamStatus     `json:"stream_status"`
	IsLive              bool             `json:"is_live"`
	StartedAt           helixClient.Time `json:"started_at"`
}

ChannelData exported data from twitch

type Client

type Client struct {
	HelixClient *helixClient.Client
	// contains filtered or unexported fields
}

Client wrapper for helix

func NewClient

func NewClient(clientID string, clientSecret string) Client

NewClient Create helix Client

func (*Client) GetChannelInformationByChannelIds added in v1.0.4

func (c *Client) GetChannelInformationByChannelIds(channelIds []string) (map[string]ChannelData, error)

GetChannelInformationByChannelIds receive userData for given ids

func (*Client) GetUsersByUserIds

func (c *Client) GetUsersByUserIds(userIDs []string) (map[string]UserData, error)

GetUsersByUserIds receive userData for given ids

func (*Client) GetUsersByUsernames

func (c *Client) GetUsersByUsernames(usernames []string) (map[string]UserData, error)

GetUsersByUsernames fetches userdata from helix

func (*Client) StartRefreshTokenRoutine

func (c *Client) StartRefreshTokenRoutine()

StartRefreshTokenRoutine refresh our token

type StreamStatus added in v1.0.4

type StreamStatus bool

type TwitchApiClient

type TwitchApiClient interface {
	GetUsersByUserIds([]string) (map[string]UserData, error)
	GetUsersByUsernames([]string) (map[string]UserData, error)
	GetChannelInformationByChannelIds([]string) (map[string]ChannelData, error)
}

type UserData

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

UserData exported data from twitch

Jump to

Keyboard shortcuts

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