helix

package
v0.0.0-...-c1fbfc1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wrapper for helix

func NewClient

func NewClient(clientID string, clientSecret string) Client

NewClient Create helix client

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 TwitchApiClient

type TwitchApiClient interface {
	GetUsersByUserIds([]string) (map[string]UserData, error)
	GetUsersByUsernames([]string) (map[string]UserData, 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