types

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteMessage

func WriteMessage(sink *comm.ZeroCopySink, msg Message) error

Types

type Addr

type Addr struct {
	NodeAddrs []comm.PeerAddr
}

func (*Addr) CmdType

func (this *Addr) CmdType() string

func (*Addr) Deserialization

func (this *Addr) Deserialization(source *common.ZeroCopySource) error

func (Addr) Serialization

func (this Addr) Serialization(sink *common.ZeroCopySink) error

Serialize message payload

type AddrReq

type AddrReq struct{}

func (*AddrReq) CmdType

func (this *AddrReq) CmdType() string

func (*AddrReq) Deserialization

func (this *AddrReq) Deserialization(source *common.ZeroCopySource) error

Deserialize message payload

func (AddrReq) Serialization

func (this AddrReq) Serialization(sink *common.ZeroCopySink) error

Serialize message payload

type DataReq

type DataReq struct {
	DataType common.InventoryType
	Hash     common.Uint256
}

func (*DataReq) CmdType

func (this *DataReq) CmdType() string

func (*DataReq) Deserialization

func (this *DataReq) Deserialization(source *common.ZeroCopySource) error

Deserialize message payload

func (DataReq) Serialization

func (this DataReq) Serialization(sink *common.ZeroCopySink) error

Serialize message payload

type Disconnected

type Disconnected struct{}

func (Disconnected) CmdType

func (this Disconnected) CmdType() string

func (*Disconnected) Deserialization

func (this *Disconnected) Deserialization(source *comm.ZeroCopySource) error

Deserialize message payload

func (Disconnected) Serialization

func (this Disconnected) Serialization(sink *comm.ZeroCopySink) error

Serialize message payload

type Message

type Message interface {
	Serialization(sink *comm.ZeroCopySink) error
	Deserialization(source *comm.ZeroCopySource) error
	CmdType() string
}

func MakeEmptyMessage

func MakeEmptyMessage(cmdType string) (Message, error)

func ReadMessage

func ReadMessage(reader io.Reader) (Message, uint32, error)

type MsgPayload

type MsgPayload struct {
	Id          uint64  //peer ID
	Addr        string  //link address
	PayloadSize uint32  //payload size
	Payload     Message //msg payload
}

MsgPayload in link channel

type NotFound

type NotFound struct {
	Hash common.Uint256
}

func (NotFound) CmdType

func (this NotFound) CmdType() string

func (*NotFound) Deserialization

func (this *NotFound) Deserialization(source *common.ZeroCopySource) error

Deserialize message payload

func (NotFound) Serialization

func (this NotFound) Serialization(sink *common.ZeroCopySink) error

Serialize message payload

type Ping

type Ping struct {
	Height uint64
}

func (*Ping) CmdType

func (this *Ping) CmdType() string

func (*Ping) Deserialization

func (this *Ping) Deserialization(source *comm.ZeroCopySource) error

Deserialize message payload

func (Ping) Serialization

func (this Ping) Serialization(sink *comm.ZeroCopySink) error

Serialize message payload

type Pong

type Pong struct {
	Height uint64
}

func (Pong) CmdType

func (this Pong) CmdType() string

func (*Pong) Deserialization

func (this *Pong) Deserialization(source *comm.ZeroCopySource) error

Deserialize message payload

func (Pong) Serialization

func (this Pong) Serialization(sink *comm.ZeroCopySink) error

Serialize message payload

type VerACK

type VerACK struct {
	IsConsensus bool
}

func (*VerACK) CmdType

func (this *VerACK) CmdType() string

func (*VerACK) Deserialization

func (this *VerACK) Deserialization(source *comm.ZeroCopySource) error

Deserialize message payload

func (*VerACK) Serialization

func (this *VerACK) Serialization(sink *comm.ZeroCopySink) error

Serialize message payload

type Version

type Version struct {
	P VersionPayload
}

func (*Version) CmdType

func (this *Version) CmdType() string

func (*Version) Deserialization

func (this *Version) Deserialization(source *comm.ZeroCopySource) error

Deserialize message payload

func (*Version) Serialization

func (this *Version) Serialization(sink *comm.ZeroCopySink) error

Serialize message payload

type VersionPayload

type VersionPayload struct {
	Version     uint32
	Services    uint64
	TimeStamp   int64
	SyncPort    uint16
	ConsPort    uint16
	Cap         [32]byte
	Nonce       uint64
	StartHeight uint64
	Relay       uint8
	IsConsensus bool
}

Jump to

Keyboard shortcuts

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