msg

package
v0.0.0-...-88b4fc5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageContainer

type MessageContainer struct {
	Id   uint64
	Data string
}

type Msg

type Msg struct {
	MagicNum byte
	DataLen  int
	MetaLen  int
	Meta     MsgMeta
	Payload  []byte
	// contains filtered or unexported fields
}

func NewMsg

func NewMsg() *Msg

func (*Msg) Decode

func (m *Msg) Decode(r io.Reader) error

func (*Msg) Encode

func (m *Msg) Encode() ([]byte, error)

type MsgMeta

type MsgMeta struct {
	Service   string
	Method    string
	Id        int64
	Timestamp int64
	Type      MsgType
}

type MsgMetaExt

type MsgMetaExt struct {
	StatusCode int32
	Msg        string
}

type MsgType

type MsgType int
const (
	TypeRequest MsgType = iota
	TypeResponse
	TypePush
)

type Parser

type Parser interface {
	Unmarshal(io.Reader) (*MessageContainer, error)
	Marshal(io.Writer, *MessageContainer) error
}

func NewParser

func NewParser() Parser

Jump to

Keyboard shortcuts

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