protocol

package
v0.0.0-...-73b4bbd Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	Send(encoding.Packet) error
	MessageOutputConn
	JsonOutputConn
	SendError(string, string) error
	Read() (encoding.Packet, error)
}

func NewConn

func NewConn(with io.ReadWriteCloser) Conn

type ConnState

type ConnState int
const (
	CC_DISCONNECTED ConnState = iota
	CC_DISCONNECTING
	CC_CONNECTING
	CC_CONNECTED
)

type DisconnectionError

type DisconnectionError struct {
	Err error
}

func (*DisconnectionError) Error

func (e *DisconnectionError) Error() string

type JsonOutputConn

type JsonOutputConn interface {
	SendJson(string, interface{}) error
}

type MessageOutputConn

type MessageOutputConn interface {
	SendMessage(string, string) error
}

type PacketLoggingConn

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

func NewPacketLoggingConn

func NewPacketLoggingConn(conn Conn, logfn func(v ...interface{})) *PacketLoggingConn

func (*PacketLoggingConn) Read

func (plc *PacketLoggingConn) Read() (encoding.Packet, error)

func (*PacketLoggingConn) Send

func (plc *PacketLoggingConn) Send(p encoding.Packet) error

func (*PacketLoggingConn) SendError

func (plc *PacketLoggingConn) SendError(errMsg, errTip string) error

func (*PacketLoggingConn) SendJson

func (plc *PacketLoggingConn) SendJson(msg string, obj interface{}) error

func (*PacketLoggingConn) SendMessage

func (plc *PacketLoggingConn) SendMessage(msg, message string) error

Jump to

Keyboard shortcuts

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