twitch

package module
v0.0.0-...-7d77d5e Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 1 Imported by: 0

README

go-twitch-client

Go Reference codecov

A simple, low level wrapper for the Twitch API. The package deliberately does not make considerations around rate-limiting, token management, or other abstracted behaviour. It aims to be a very simple, thin layer between you and the Twitch API.

For that reason, you should use this package behind any rate-limiting logic, or authorization logic you build into your apps.

Each API is split into it's own package, documentation relevant to Helix lives in the helix directory.

This package is built using Generics, and thus requires Go 1.18 or later.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pointer

func Pointer[T any](v T) *T

Pointer returns the passed value as a pointer. This is particularly useful in cases where you need to pass a pointer to a given func input, for example:

&helix.ModifyChannelInformation{
    Title: twitch.Pointer("my new title"),
}

func PointerValue

func PointerValue[T any](v *T) T

Pointer returns the passed value as a pointer. This is particularly useful in cases where you need to pass a pointer to a given func input, for example:

value := "string"
valuePointer := &value
log.Println(twitch.PointerValue(valuePointer)) // returns "string"

valuePointer = nil // set it to nil
log.Println(twitch.PointerValue(valuePointer)) // returns ""

Types

type Error

type Error struct {
	Message string
	Status  int
}

Error wraps a Twitch API error

func NewError

func NewError(message string, status int) Error

NewError creates a new instance of error

func (Error) Error

func (e Error) Error() string

Error returns a stringified error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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