kecpfakews

package
v0.0.0-...-a9c713e Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TextMessage denotes a text data message. The text message payload is
	// interpreted as UTF-8 encoded text data.
	TextMessage = 1

	// BinaryMessage denotes a binary data message.
	BinaryMessage = 2

	// CloseMessage denotes a close control message. The optional message
	// payload contains a numeric code and text. Use the FormatCloseMessage
	// function to format a close message payload.
	CloseMessage = 8

	// PingMessage denotes a ping control message. The optional message payload
	// is UTF-8 encoded text.
	PingMessage = 9

	// PongMessage denotes a pong control message. The optional message payload
	// is UTF-8 encoded text.
	PongMessage = 10
)

Variables

View Source
var FakeError = errors.New("this is a fake error")

Functions

func MathRandGen

func MathRandGen() int

func MathRandLongTimeGen

func MathRandLongTimeGen() time.Duration

func MathRandShortTimeGen

func MathRandShortTimeGen() time.Duration

Types

type Conn

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

func NewConn

func NewConn(reliable bool, roomID string, name string, clientKey string) *Conn

func (*Conn) Close

func (conn *Conn) Close() error

func (*Conn) NextWriter

func (conn *Conn) NextWriter(messageType int) (io.WriteCloser, error)

func (*Conn) ReadMessage

func (conn *Conn) ReadMessage() (messageType int, p []byte, err error)

func (*Conn) SetPongHandler

func (conn *Conn) SetPongHandler(h func(appData string) error)

func (*Conn) SetReadDeadline

func (conn *Conn) SetReadDeadline(t time.Time) error

func (*Conn) SetReadLimit

func (conn *Conn) SetReadLimit(limit int64)

func (*Conn) SetWriteDeadline

func (conn *Conn) SetWriteDeadline(t time.Time) error

func (*Conn) WriteMessage

func (conn *Conn) WriteMessage(messageType int, data []byte) error

type FakeWriter

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

func (*FakeWriter) Close

func (fw *FakeWriter) Close() error

func (*FakeWriter) Write

func (fw *FakeWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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