twitch

package
v0.0.0-...-68712e6 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context) context.Context

Types

type IConn

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

func (*IConn) Auth

func (c *IConn) Auth() error

func (*IConn) Read

func (c *IConn) Read() (*Message, error)

func (*IConn) Reconnect

func (c *IConn) Reconnect()

func (*IConn) ReconnectAfterError

func (c *IConn) ReconnectAfterError(err error)

func (*IConn) SendCloseFrame

func (c *IConn) SendCloseFrame() error

func (*IConn) Write

func (c *IConn) Write(messageType int, data []byte)

type Message

type Message struct {
	Type  string      `json:"type"`
	Error string      `json:"error,omitempty"`
	Data  MessageData `json:"data,omitempty"`
}

type MessageData

type MessageData struct {
	Topic   string `json:"topic"`
	Message string `json:"message"`
}

type SubscribePayload

type SubscribePayload struct {
	Type  string               `json:"type"`
	Nonce string               `json:"nonce,omitempty"`
	Data  SubscribePayloadData `json:"data"`
}

type SubscribePayloadData

type SubscribePayloadData struct {
	Topics    []string `json:"topics"`
	AuthToken string   `json:"auth_token,omitempty"`
}

type TokenStruct

type TokenStruct struct {
	AccessToken  string   `json:"access_token"`
	RefreshToken string   `json:"refresh_token"`
	Scope        []string `json:"scope"`
}

Jump to

Keyboard shortcuts

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