session

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const CRLF = "\r\n"
View Source
const CacheDestroyerSize = 3

Variables

This section is empty.

Functions

func ExtractCommandArgs

func ExtractCommandArgs(msg *irc.Message, cmd Command, prefix string) []string

func GetUserIDFromOAuth

func GetUserIDFromOAuth(oauth string) (string, error)

func IsCommand

func IsCommand(msg *irc.Message, cmd Command, prefix string) bool

func RunWsSession

func RunWsSession(clientConn, twitchConn WsConn, ctx *app.Context)

Types

type Command

type Command interface {
	Name() string
	Run(s *wsSession, msg *irc.Message, args []string)
}

func SimpleCommand

func SimpleCommand(name string, f func(s *wsSession, msg *irc.Message, args []string)) Command

type MessageModifier added in v1.1.0

type MessageModifier func(reader io.Reader, writer io.Writer) *RWError

type RWError added in v1.1.0

type RWError struct {
	ReadError  error
	WriteError error
}

func ReadError added in v1.1.0

func ReadError(err error) *RWError

func WriteError added in v1.1.0

func WriteError(err error) *RWError

func (*RWError) Error added in v1.1.0

func (rw *RWError) Error() string

func (*RWError) Ok added in v1.1.0

func (rw *RWError) Ok() bool

type VirtualMessageUser

type VirtualMessageUser struct {
	DisplayName string
	UserName    string
	UserColor   string
	Badges      []string
}

type WsConn added in v1.1.0

type WsConn interface {
	Close() error
	ReadMessage() (int, []byte, error)
	WriteMessage(messageType int, data []byte) error
	NextReader() (int, io.Reader, error)
	NextWriter(messageType int) (io.WriteCloser, error)
}

Jump to

Keyboard shortcuts

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