traffic

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CALL = iota
	REPLAY
	PUSH
	BROADCAST
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Header interface {
	GetSeq() int32
	SetSeq(seq int32)
	GetErr() string
	GetServiceMethod() string
	SetServiceMethod(sm string)
	SetErr(err string)
}

Header --- start ---

func NewEmptyHeader

func NewEmptyHeader() Header

func NewHeader

func NewHeader(serviceMethod string, seq int32) Header

type Message

type Message interface {
	GetSeq() int32
	Action() byte // 消息类型
	SetAction(action byte)
	ServiceMethod() string
	Codec() byte // 针对Body
	SetCodec(c byte)
	MarshalBody() ([]byte, error)
	UnMarshalBody(b []byte) error
	SetHeader(h Header)
	Header() Header
	SetBody(b interface{})
}

Message --- start ---

func NewMessage

func NewMessage() Message

Jump to

Keyboard shortcuts

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