messages

package
v0.11.0-dev.4 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: AGPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const EventV1MessageName = "event/v1"
View Source
const PriceV0MessageName = "price/v0"
View Source
const PriceV1MessageName = "price/v1"

Variables

View Source
var (
	ErrPriceMessageTooLarge       = errors.New("price message too large")
	ErrUnknownPriceMessageVersion = errors.New("unknown message version")
	ErrInvalidPriceMessage        = errors.New("invalid price message")
)
View Source
var ErrEventMessageTooLarge = errors.New("event message too large")

Functions

This section is empty.

Types

type Event

type Event struct {
	// Type of the event.
	Type string

	// Unique ID of the event.
	ID []byte

	// Event index used to search for events.
	Index []byte

	// The date of the event.
	EventDate time.Time

	// The date when the event message was created.
	MessageDate time.Time

	// List of event data.
	Data map[string][]byte

	// List of event signatures.
	Signatures map[string]EventSignature
}

func (*Event) Copy added in v0.7.1

func (e *Event) Copy() *Event

Copy returns a copy of the event.

func (*Event) MarshallBinary

func (e *Event) MarshallBinary() ([]byte, error)

MarshallBinary implements the transport.Message interface.

func (*Event) UnmarshallBinary

func (e *Event) UnmarshallBinary(data []byte) error

UnmarshallBinary implements the transport.Message interface.

type EventSignature added in v0.4.2

type EventSignature struct {
	Signer    []byte
	Signature []byte
}

type Price

type Price struct {
	Price   *median.Price   `json:"price"`
	Trace   json.RawMessage `json:"trace"`
	Version string          `json:"version,omitempty"` // TODO: this should move to some meta field e.g. `feedVersion`
	// contains filtered or unexported fields
}

func (*Price) AsV0 added in v0.6.0

func (p *Price) AsV0() *Price

func (*Price) AsV1 added in v0.6.0

func (p *Price) AsV1() *Price

func (*Price) Marshall

func (p *Price) Marshall() ([]byte, error)

func (*Price) MarshallBinary

func (p *Price) MarshallBinary() ([]byte, error)

MarshallBinary implements the transport.Message interface.

func (*Price) Unmarshall

func (p *Price) Unmarshall(b []byte) error

func (*Price) UnmarshallBinary

func (p *Price) UnmarshallBinary(data []byte) error

UnmarshallBinary implements the transport.Message interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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