messages

package
Version: v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BroadcastMsg = "broadcast"
	RandsendMsg  = "randsend"
)

Internal msg keys

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseMsg

type BaseMsg struct {
	Type string
	Msg  interface{}
}

BaseMsg base message

func (*BaseMsg) GetMsg

func (m *BaseMsg) GetMsg() interface{}

GetMsg get message

func (*BaseMsg) GetType

func (m *BaseMsg) GetType() string

GetType get message type

func (*BaseMsg) String

func (m *BaseMsg) String() string

type BlockData

type BlockData struct {
	Chain uint64
	Key   []byte
	Data  []byte
}

BlockData response block data

type BlockInfo

type BlockInfo struct {
	Chain     uint64
	Index     uint64
	HashPower uint64
	Key       []byte
	User      []byte
	PreKey    []byte
}

BlockInfo response block info

type ChainEvent

type ChainEvent struct {
	BaseMsg
	Chain uint64
	Who   string
	Event string
	Param string
}

ChainEvent ChainEvent

type Mine

type Mine struct {
	BaseMsg
	Chain uint64
	Index uint64
}

Mine Mine

type NewNode

type NewNode struct {
	BaseMsg
	Peer string
}

NewNode new node

type NewTransaction

type NewTransaction struct {
	BaseMsg
	Chain uint64
	Key   []byte
	Data  []byte
}

NewTransaction internal message

type RawData added in v0.3.9

type RawData struct {
	BaseMsg
	Chain     uint64
	Key       []byte
	Broadcast bool
	IsTrans   bool
	LockNum   uint64
	Data      []byte
}

RawData raw data

type ReqBlock

type ReqBlock struct {
	Chain uint64
	Index uint64
	Key   []byte
}

ReqBlock request block data

type ReqBlockInfo

type ReqBlockInfo struct {
	Chain uint64
	Index uint64
}

ReqBlockInfo request block info

type ReqTransaction

type ReqTransaction struct {
	Chain uint64
	Key   []byte
}

ReqTransaction request transaction data

type Rollback

type Rollback struct {
	BaseMsg
	Chain uint64
	Index uint64
	Key   []byte
}

Rollback Rollback

type TransactionData

type TransactionData struct {
	Chain uint64
	Key   []byte
	Data  []byte
}

TransactionData response transaction data

type TransactionInfo

type TransactionInfo struct {
	Chain uint64
	Time  uint64
	Key   []byte
	User  []byte
}

TransactionInfo transaction info

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL