msgnet

package
v0.8.8 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChainTxMsg = iota + 100
	ChainConsensusMsg
	ChainMergeTxsMsg
	ChainAckMergeTxsMsg
	ChainAckedMergeTxsMsg
)

Variables

This section is empty.

Functions

func NewMsgnet

func NewMsgnet(id string, routeAddress []string, fn MsgHandler, logOutPath string) *msgnet.Peer

NewMsgnet start client msg-net service and returns a msg-net peer

Types

type Message

type Message struct {
	Cmd     uint8
	Payload []byte
}

Message represents the message transfer in msg-net

func (*Message) Deserialize

func (m *Message) Deserialize(data []byte)

Deserialize bytes to message

func (*Message) Serialize

func (m *Message) Serialize() []byte

Serialize message to bytes

type MsgHandler

type MsgHandler func(src string, dst string, payload, sig []byte) error

MsgHandler handles the message of the msg-net

type Stack

type Stack interface {
	Send(dst string, payload, signature []byte) bool
}

Stack defines send interface

Jump to

Keyboard shortcuts

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