datastreams

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 5 Imported by: 2 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const FeedIDBytesLen = 32

Variables

View Source
var ErrInvalidFeedID = errors.New("invalid feed ID")

Functions

This section is empty.

Types

type FeedID

type FeedID string

hex-encoded 32-byte value, prefixed with "0x", all lowercase

func FeedIDFromBytes

func FeedIDFromBytes(b [FeedIDBytesLen]byte) FeedID

func NewFeedID

func NewFeedID(s string) (FeedID, error)

func (FeedID) Bytes

func (id FeedID) Bytes() [FeedIDBytesLen]byte

Bytes() converts the FeedID string into a [32]byte value. Note: this function panics if the underlying string isn't of the right length. For production (i.e.) non-test uses, please create the FeedID via the NewFeedID constructor, which will validate the string.

func (FeedID) String

func (id FeedID) String() string

type FeedReport

type FeedReport struct {
	FeedID        string
	FullReport    []byte
	ReportContext []byte
	Signatures    [][]byte

	// Fields below are derived from FullReport
	// NOTE: BenchmarkPrice is a byte representation of big.Int. We can't use big.Int
	// directly due to Value serialization problems using mapstructure.
	BenchmarkPrice       []byte
	ObservationTimestamp int64
}

func UnwrapStreamsTriggerEventToFeedReportList

func UnwrapStreamsTriggerEventToFeedReportList(wrapped values.Value) ([]FeedReport, error)

Helpers for unwrapping a StreamsTriggerPayload into a []FeedReport - more efficient than using mapstructure/reflection

type Metadata

type Metadata struct {
	Signers               [][]byte
	MinRequiredSignatures int
}

passed alongside Streams trigger events

type ReportCodec

type ReportCodec interface {
	// unwrap StreamsTriggerEvent and convert to a list of FeedReport
	Unwrap(wrapped values.Value) ([]FeedReport, error)

	// wrap a list of FeedReport to a wrapped StreamsTriggerEvent Value
	Wrap(reports []FeedReport) (values.Value, error)

	// validate signatures on a single FeedReport
	Validate(feedReport FeedReport, allowedSigners [][]byte, minRequiredSignatures int) error
}

type StreamsTriggerEvent

type StreamsTriggerEvent struct {
	Payload   []FeedReport
	Metadata  Metadata
	Timestamp int64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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