twitch

package module
v0.0.0-...-d10b7c6 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 10 Imported by: 0

README

Twitch

Pipeline Status Coverage Report Go Report Card License MIT

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUserNotFound is returned when user is not found
	ErrUserNotFound = errors.New("twitch: user not found")
	// ErrClientUninitialized is returned when client object is nil
	// or has no valid Twitch Oauth2 token
	ErrClientUninitialized = errors.New("twitch: client uninitialized")
)

Functions

This section is empty.

Types

type Client

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

Client struct

func NewClient

func NewClient(clientID, clientSecret string) (*Client, error)

NewClient func

func (*Client) GetUserByID

func (tc *Client) GetUserByID(id string) (*User, error)

GetUserByID func

func (*Client) GetUserByName

func (tc *Client) GetUserByName(name string) (*User, error)

GetUserByName func

func (*Client) IsFollower

func (tc *Client) IsFollower(followerID, followedID string) (bool, error)

IsFollower func

type Pagination

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

Pagination struct

type User

type User struct {
	ID              string `json:"id"`
	Login           string `json:"login"`
	DisplayName     string `json:"display_name"`
	Type            string `json:"type,omitempty"`
	BroadcasterType string `json:"broadcaster_type,omitempty"`
	Description     string `json:"description,omitempty"`
	ProfileImageURL string `json:"profile_image_url,omitempty"`
	OfflineImageURL string `json:"offline_image_url,omitempty"`
	ViewCount       int32  `json:"view_count"`
	Email           string `json:"email"`
}

User struct

Jump to

Keyboard shortcuts

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