message

package
v0.0.0-...-a53bfeb Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OgMessage

type OgMessage interface {
	GetType() OgMessageType
	GetTypeValue() int
	ToBytes() []byte
	FromBytes(bts []byte) error
	String() string
}

type OgMessageHeaderRequest

type OgMessageHeaderRequest struct {
	//Origin    HashOrNumber // Block from which to retrieve headers
	Amount    uint64 // Maximum number of headers to retrieve
	Skip      uint64 // Blocks to skip between consecutive headers
	Reverse   bool   // Query direction (false = rising towards latest, true = falling towards genesis)
	RequestId uint32 //avoid message drop
}

msgp OgMessageHeaderRequest

func (*OgMessageHeaderRequest) DecodeMsg

func (z *OgMessageHeaderRequest) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*OgMessageHeaderRequest) EncodeMsg

func (z *OgMessageHeaderRequest) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*OgMessageHeaderRequest) FromBytes

func (z *OgMessageHeaderRequest) FromBytes(bts []byte) error

func (*OgMessageHeaderRequest) GetTypeValue

func (m *OgMessageHeaderRequest) GetTypeValue() int

func (*OgMessageHeaderRequest) Marshal

func (z *OgMessageHeaderRequest) Marshal() []byte

func (*OgMessageHeaderRequest) MarshalMsg

func (z *OgMessageHeaderRequest) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*OgMessageHeaderRequest) Msgsize

func (z *OgMessageHeaderRequest) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*OgMessageHeaderRequest) String

func (m *OgMessageHeaderRequest) String() string

func (*OgMessageHeaderRequest) ToBytes

func (m *OgMessageHeaderRequest) ToBytes() []byte

func (*OgMessageHeaderRequest) UnmarshalMsg

func (z *OgMessageHeaderRequest) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type OgMessageHeightRequest

type OgMessageHeightRequest struct {
}

msgp OgMessageHeightRequest

func (*OgMessageHeightRequest) DecodeMsg

func (z *OgMessageHeightRequest) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (OgMessageHeightRequest) EncodeMsg

func (z OgMessageHeightRequest) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*OgMessageHeightRequest) FromBytes

func (z *OgMessageHeightRequest) FromBytes(bts []byte) error

func (*OgMessageHeightRequest) GetType

func (*OgMessageHeightRequest) GetTypeValue

func (z *OgMessageHeightRequest) GetTypeValue() int

func (OgMessageHeightRequest) MarshalMsg

func (z OgMessageHeightRequest) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (OgMessageHeightRequest) Msgsize

func (z OgMessageHeightRequest) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*OgMessageHeightRequest) String

func (z *OgMessageHeightRequest) String() string

func (*OgMessageHeightRequest) ToBytes

func (z *OgMessageHeightRequest) ToBytes() []byte

func (*OgMessageHeightRequest) UnmarshalMsg

func (z *OgMessageHeightRequest) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type OgMessageHeightResponse

type OgMessageHeightResponse struct {
	Height int64
}

msgp OgMessageHeightResponse

func (*OgMessageHeightResponse) DecodeMsg

func (z *OgMessageHeightResponse) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (OgMessageHeightResponse) EncodeMsg

func (z OgMessageHeightResponse) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*OgMessageHeightResponse) FromBytes

func (z *OgMessageHeightResponse) FromBytes(bts []byte) error

func (*OgMessageHeightResponse) GetType

func (*OgMessageHeightResponse) GetTypeValue

func (z *OgMessageHeightResponse) GetTypeValue() int

func (OgMessageHeightResponse) MarshalMsg

func (z OgMessageHeightResponse) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (OgMessageHeightResponse) Msgsize

func (z OgMessageHeightResponse) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*OgMessageHeightResponse) String

func (z *OgMessageHeightResponse) String() string

func (*OgMessageHeightResponse) ToBytes

func (z *OgMessageHeightResponse) ToBytes() []byte

func (*OgMessageHeightResponse) UnmarshalMsg

func (z *OgMessageHeightResponse) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type OgMessagePing

type OgMessagePing struct {
	Protocol  string
	NetworkId string
}

msgp OgMessagePing

func (*OgMessagePing) DecodeMsg

func (z *OgMessagePing) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (OgMessagePing) EncodeMsg

func (z OgMessagePing) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*OgMessagePing) FromBytes

func (z *OgMessagePing) FromBytes(bts []byte) error

func (*OgMessagePing) GetType

func (z *OgMessagePing) GetType() OgMessageType

func (*OgMessagePing) GetTypeValue

func (z *OgMessagePing) GetTypeValue() int

func (OgMessagePing) MarshalMsg

func (z OgMessagePing) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (OgMessagePing) Msgsize

func (z OgMessagePing) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*OgMessagePing) String

func (z *OgMessagePing) String() string

func (*OgMessagePing) ToBytes

func (z *OgMessagePing) ToBytes() []byte

func (*OgMessagePing) UnmarshalMsg

func (z *OgMessagePing) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type OgMessagePong

type OgMessagePong struct {
	Protocol  string
	NetworkId string
	Close     bool
}

msgp OgMessagePong

func (*OgMessagePong) DecodeMsg

func (z *OgMessagePong) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (OgMessagePong) EncodeMsg

func (z OgMessagePong) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*OgMessagePong) FromBytes

func (z *OgMessagePong) FromBytes(bts []byte) error

func (*OgMessagePong) GetType

func (z *OgMessagePong) GetType() OgMessageType

func (*OgMessagePong) GetTypeValue

func (z *OgMessagePong) GetTypeValue() int

func (OgMessagePong) MarshalMsg

func (z OgMessagePong) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (OgMessagePong) Msgsize

func (z OgMessagePong) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*OgMessagePong) String

func (z *OgMessagePong) String() string

func (*OgMessagePong) ToBytes

func (z *OgMessagePong) ToBytes() []byte

func (*OgMessagePong) UnmarshalMsg

func (z *OgMessagePong) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type OgMessageResourceRequest

type OgMessageResourceRequest struct {
	ResourceType   int
	RequestContent []byte
}

msgp OgMessageResourceRequest

func (*OgMessageResourceRequest) DecodeMsg

func (z *OgMessageResourceRequest) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*OgMessageResourceRequest) EncodeMsg

func (z *OgMessageResourceRequest) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*OgMessageResourceRequest) FromBytes

func (z *OgMessageResourceRequest) FromBytes(bts []byte) error

func (*OgMessageResourceRequest) GetType

func (*OgMessageResourceRequest) GetTypeValue

func (z *OgMessageResourceRequest) GetTypeValue() int

func (*OgMessageResourceRequest) MarshalMsg

func (z *OgMessageResourceRequest) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*OgMessageResourceRequest) Msgsize

func (z *OgMessageResourceRequest) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*OgMessageResourceRequest) String

func (z *OgMessageResourceRequest) String() string

func (*OgMessageResourceRequest) ToBytes

func (z *OgMessageResourceRequest) ToBytes() []byte

func (*OgMessageResourceRequest) UnmarshalMsg

func (z *OgMessageResourceRequest) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type OgMessageResourceResponse

type OgMessageResourceResponse struct {
	ResourceType    int
	ResponseContent []byte
}

msgp OgMessageHeightSyncResponse

func (*OgMessageResourceResponse) DecodeMsg

func (z *OgMessageResourceResponse) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*OgMessageResourceResponse) EncodeMsg

func (z *OgMessageResourceResponse) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*OgMessageResourceResponse) FromBytes

func (z *OgMessageResourceResponse) FromBytes(bts []byte) error

func (*OgMessageResourceResponse) GetType

func (*OgMessageResourceResponse) GetTypeValue

func (z *OgMessageResourceResponse) GetTypeValue() int

func (*OgMessageResourceResponse) MarshalMsg

func (z *OgMessageResourceResponse) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*OgMessageResourceResponse) Msgsize

func (z *OgMessageResourceResponse) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*OgMessageResourceResponse) String

func (z *OgMessageResourceResponse) String() string

func (*OgMessageResourceResponse) ToBytes

func (z *OgMessageResourceResponse) ToBytes() []byte

func (*OgMessageResourceResponse) UnmarshalMsg

func (z *OgMessageResourceResponse) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type OgMessageType

type OgMessageType int
const (
	OgMessageTypeStatus OgMessageType = iota + 0
	OgMessageTypePing
	OgMessageTypePong
	OgMessageTypeHeightRequest
	OgMessageTypeHeightResponse
	OgMessageTypeResourceRequest
	OgMessageTypeResourceResponse
	OgMessageTypeSyncResponse
	MessageTypeFetchByHashRequest
	MessageTypeFetchByHashResponse
	OgMessageTypeQueryStatusRequest
	OgMessageTypeQueryStatusResponse
	OgMessageTypeNewResource

	//MessageTypeNewSequencer
	//MessageTypeNewTxs
	MessageTypeSequencerHeader

	MessageTypeBodiesRequest
	MessageTypeBodiesResponse

	OgMessageTypeTxsRequest
	MessageTypeTxsResponse
	OgMessageTypeHeaderRequest
	MessageTypeHeaderResponse

	//for optimizing network
	MessageTypeGetMsg
	MessageTypeDuplicate
	MessageTypeControl

	MessageTypeArchive
	MessageTypeActionTX

	MessageTypeSecret //encrypted message

	MessageTypeOg01Length //og01 length

	GetNodeDataMsg
	NodeDataMsg
	GetReceiptsMsg
	MessageTypeOg02Length

	MessageTypeNewArchive
	MessageTypeNewActionTx
)

og protocol message codes TODO: use MessageTypeManager to manage global messages basic messages ids range from [0, 100) bft consensus: [100, 200) dkg: [200, 300) campaign: [300, 400)

func (*OgMessageType) DecodeMsg

func (z *OgMessageType) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (OgMessageType) EncodeMsg

func (z OgMessageType) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (OgMessageType) MarshalMsg

func (z OgMessageType) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (OgMessageType) Msgsize

func (z OgMessageType) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (OgMessageType) String

func (o OgMessageType) String() string

func (*OgMessageType) UnmarshalMsg

func (z *OgMessageType) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

Jump to

Keyboard shortcuts

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