json

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMsgType      = errors.New("message type error")
	ErrMaxMsgLength = errors.New("message length exceed the limit")
	ErrMsgLength    = errors.New("message length error")
	ErrMsgFormat    = errors.New("message format error")
)

Functions

This section is empty.

Types

type Message

type Message interface{}

Message wraps socket packages for communicating between frpc and frps.

type MsgCtl

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

func NewMsgCtl

func NewMsgCtl() *MsgCtl

func (*MsgCtl) Pack

func (msgCtl *MsgCtl) Pack(msg Message) ([]byte, error)

func (*MsgCtl) ReadMsg

func (msgCtl *MsgCtl) ReadMsg(c io.Reader) (msg Message, err error)

func (*MsgCtl) ReadMsgInto

func (msgCtl *MsgCtl) ReadMsgInto(c io.Reader, msg Message) (err error)

func (*MsgCtl) RegisterMsg

func (msgCtl *MsgCtl) RegisterMsg(typeByte byte, msg interface{})

func (*MsgCtl) SetMaxMsgLength

func (msgCtl *MsgCtl) SetMaxMsgLength(length int64)

func (*MsgCtl) UnPack

func (msgCtl *MsgCtl) UnPack(typeByte byte, buffer []byte) (msg Message, err error)

func (*MsgCtl) UnPackInto

func (msgCtl *MsgCtl) UnPackInto(buffer []byte, msg Message) (err error)

func (*MsgCtl) WriteMsg

func (msgCtl *MsgCtl) WriteMsg(c io.Writer, msg interface{}) (err error)

Jump to

Keyboard shortcuts

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