message

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

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

Go to latest
Published: May 10, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleNodeMsg

func HandleNodeMsg(node proto.Noder, buf []byte, len int) error

func LocateMsgHdr

func LocateMsgHdr(buf []byte) []byte

func MsgType

func MsgType(buf []byte) (string, error)

func NewMsg

func NewMsg(t string, n proto.Noder) ([]byte, error)

func PayloadLen

func PayloadLen(buf []byte) int

func ValidMsgHdr

func ValidMsgHdr(buf []byte) bool

Types

type Auth

type Auth struct {
}

type Messager

type Messager interface {
	Verify([]byte) error
	Serialization() ([]byte, error)
	Deserialization([]byte) error
}

func AllocMsg

func AllocMsg(t string, length int) Messager

Alloc different message structure @t the message name or type @len the message length only valid for varible length structure

Return: @messager the messager interface @error error code FixMe fix the ugly multiple return.

type PayLoad

type PayLoad struct {
	Data   []byte
	Secret string
}

type Ping

type Ping struct {
}

type Pong

type Pong struct {
}

Jump to

Keyboard shortcuts

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