message

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountBlocks

type AccountBlocks struct {
	Blocks []*ledger.AccountBlock
}

func (*AccountBlocks) Deserialize

func (a *AccountBlocks) Deserialize(buf []byte) error

func (*AccountBlocks) Serialize

func (a *AccountBlocks) Serialize() ([]byte, error)

func (*AccountBlocks) String

func (a *AccountBlocks) String() string

type Exception

type Exception uint64
const (
	Missing             Exception = iota // I don`t have the resource you requested
	Canceled                             // the request have been canceled
	Unsolicited                          // the request must have pre-checked
	Blocked                              // you have been blocked
	RepetitiveHandshake                  // handshake should happen only once, as the first msg
	Connected                            // you have been connected with me
	DifferentNet
	UnMatchedMsgVersion
	UnIdenticalGenesis
	FileTransDone
)

func DeserializeException

func DeserializeException(buf []byte) (e Exception, err error)

func (Exception) Deserialize

func (exp Exception) Deserialize(buf []byte) error

func (Exception) Error

func (exp Exception) Error() string

func (Exception) Serialize

func (exp Exception) Serialize() ([]byte, error)

func (Exception) String

func (exp Exception) String() string

type FileList

type FileList struct {
	Files  []*ledger.CompressedFileMeta
	Chunks [][2]uint64 // because files don`t contain the latest snapshotblocks
	Nonce  uint64      // use only once
}

@section FileList

func (*FileList) Deserialize

func (f *FileList) Deserialize(buf []byte) error

func (*FileList) Serialize

func (f *FileList) Serialize() ([]byte, error)

func (*FileList) String

func (f *FileList) String() string

type GetAccountBlocks

type GetAccountBlocks struct {
	Address types.Address
	From    ledger.HashHeight
	Count   uint64
	Forward bool
}

func (*GetAccountBlocks) Deserialize

func (b *GetAccountBlocks) Deserialize(buf []byte) error

func (*GetAccountBlocks) Serialize

func (b *GetAccountBlocks) Serialize() ([]byte, error)

func (*GetAccountBlocks) String

func (b *GetAccountBlocks) String() string

type GetChunk

type GetChunk struct {
	Start, End uint64
}

func (*GetChunk) Deserialize

func (c *GetChunk) Deserialize(buf []byte) error

func (*GetChunk) Serialize

func (c *GetChunk) Serialize() ([]byte, error)

func (*GetChunk) String

func (c *GetChunk) String() string

type GetFiles

type GetFiles struct {
	Names []string
	Nonce uint64
}

func (*GetFiles) Deserialize

func (f *GetFiles) Deserialize(buf []byte) error

func (*GetFiles) Serialize

func (f *GetFiles) Serialize() ([]byte, error)

func (*GetFiles) String

func (f *GetFiles) String() string

type GetSnapshotBlocks

type GetSnapshotBlocks struct {
	From    ledger.HashHeight
	Count   uint64
	Forward bool
}

func (*GetSnapshotBlocks) Deserialize

func (b *GetSnapshotBlocks) Deserialize(buf []byte) error

func (*GetSnapshotBlocks) Serialize

func (b *GetSnapshotBlocks) Serialize() ([]byte, error)

func (*GetSnapshotBlocks) String

func (b *GetSnapshotBlocks) String() string

type GetSubLedger

type GetSubLedger = GetSnapshotBlocks

@section GetSubLedger response consist of fileList and chunk

type HandShake

type HandShake struct {
	Height  uint64
	Port    uint16
	Current types.Hash
	Genesis types.Hash
}

func (*HandShake) Deserialize

func (h *HandShake) Deserialize(data []byte) error

func (*HandShake) Serialize

func (h *HandShake) Serialize() ([]byte, error)

type SnapshotBlocks

type SnapshotBlocks struct {
	Blocks []*ledger.SnapshotBlock
}

func (*SnapshotBlocks) Deserialize

func (b *SnapshotBlocks) Deserialize(buf []byte) error

func (*SnapshotBlocks) Serialize

func (b *SnapshotBlocks) Serialize() ([]byte, error)

func (*SnapshotBlocks) String

func (b *SnapshotBlocks) String() string

type SubLedger

type SubLedger struct {
	SBlocks   []*ledger.SnapshotBlock
	ABlocks   []*ledger.AccountBlock
	AblockNum uint64
}

func (*SubLedger) Deserialize

func (s *SubLedger) Deserialize(buf []byte) error

func (*SubLedger) Serialize

func (s *SubLedger) Serialize() ([]byte, error)

func (*SubLedger) String

func (s *SubLedger) String() string

Jump to

Keyboard shortcuts

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