Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attestation ¶
Attestation holds information about an attestation.
type AttestationsSetter ¶
type AttestationsSetter interface {
// SetAttestations sets multiple attestations.
SetAttestations(ctx context.Context, attestations []*Attestation) error
// SetAttestation sets an attestation.
SetAttestation(ctx context.Context, attestation *Attestation) error
}
AttestationsSetter defines functions to create and update attestations.
type BlockDelaysProvider ¶
type BlockDelaysProvider interface {
// BlockDelays obtains the block delays for a range of slots.
BlockDelays(ctx context.Context, filter *DelayFilter) ([]*DelayValue, error)
}
BlockDelaysProvider defines functions to obtain block delays.
type BlockDelaysSetter ¶
type BlockDelaysSetter interface {
// SetBlockDelay sets a block delay.
SetBlockDelay(ctx context.Context, delay *Delay) error
}
BlockDelaysSetter defines functions to create and update block delays.
type DelayFilter ¶
type DelayFilter struct {
// IPAddr is the IP address from which to fetch delays.
// If empty then there is no IP address filter.
IPAddr string
// Source is the beacon node source from which to fetch delays.
// If empty then there is no source filter.
Source string
// Method is the collection method from which to fetch delays.
// If empty then there is no method filter.
Method string
// From is the slot of the earliest delay to fetch.
// If nil then there is no earliest slot.
From *phase0.Slot
// To is the slot of the latest delay to fetch.
// If nil then there is no latest slot.
To *phase0.Slot
// Order is either OrderEarliest, in which case the earliest results
// that match the filter are returned, or OrderLatest, in which case the
// latest results that match the filter are returned.
// The default is OrderEarliest.
Order Order
// Selection is the selection of the delay(s).
// The default is SelectionMinimum.
Selection Selection
}
DelayFilter defines a filter for fetching delays. Filter elements are ANDed together. Results are always returned in ascending slot/method/IP address/source order.
type DelayValue ¶
DelayValue holds a single delay value.
type HeadDelaysProvider ¶
type HeadDelaysProvider interface {
// HeadDelays obtains the minimum head delays for a range of slots.
HeadDelays(ctx context.Context, filter *DelayFilter) ([]*DelayValue, error)
}
HeadDelaysProvider defines functions to obtain head delays.
type HeadDelaysSetter ¶
type HeadDelaysSetter interface {
// SetHeadDelay sets a head delay.
SetHeadDelay(ctx context.Context, delay *Delay) error
}
HeadDelaysSetter defines functions to create and update head delays.
type Order ¶
type Order uint8
Order is the order in which results should be fetched (N.B. fetched, not returned).
type Selection ¶
type Selection uint8
Selection is the selection criterion when multiple delays are present.
type Service ¶
type Service interface {
// BeginTx begins a transaction.
BeginTx(ctx context.Context) (context.Context, context.CancelFunc, error)
// CommitTx commits a transaction.
CommitTx(ctx context.Context) error
// SetMetadata sets a metadata key to a JSON value.
SetMetadata(ctx context.Context, key string, value []byte) error
// Metadata obtains the JSON value from a metadata key.
Metadata(ctx context.Context, key string) ([]byte, error)
}
Service defines a minimal probe database service.