Documentation ¶
Index ¶
- type BasicMetrics
- type FrameFilter
- func (f *FrameFilter) AddAfter(after time.Time)
- func (f *FrameFilter) AddBefore(before time.Time)
- func (f *FrameFilter) AddEpoch(epoch uint64)
- func (f *FrameFilter) AddID(id string)
- func (f *FrameFilter) AddLabels(labels []string)
- func (f *FrameFilter) AddNode(node string)
- func (f *FrameFilter) AddSlot(slot uint64)
- func (f *FrameFilter) ApplyToQuery(query *gorm.DB) (*gorm.DB, error)
- func (f *FrameFilter) Validate() error
- type FrameMetadata
- type FrameMetadataLabel
- type FrameMetadataLabels
- type FrameMetadatas
- type Indexer
- func (i *Indexer) CountEpochsWithFrames(ctx context.Context, filter *FrameFilter) (int64, error)
- func (i *Indexer) CountFrameMetadata(ctx context.Context, filter *FrameFilter) (int64, error)
- func (i *Indexer) CountLabelsWithFrames(ctx context.Context, filter *FrameFilter) (int64, error)
- func (i *Indexer) CountNodesWithFrames(ctx context.Context, filter *FrameFilter) (int64, error)
- func (i *Indexer) CountSlotsWithFrames(ctx context.Context, filter *FrameFilter) (int64, error)
- func (i *Indexer) DeleteFrameMetadata(ctx context.Context, id string) error
- func (i *Indexer) InsertFrameMetadata(ctx context.Context, metadata *types.FrameMetadata) error
- func (i *Indexer) ListEpochsWithFrames(ctx context.Context, filter *FrameFilter, page *PaginationCursor) ([]phase0.Epoch, error)
- func (i *Indexer) ListFrameMetadata(ctx context.Context, filter *FrameFilter, page *PaginationCursor) ([]*FrameMetadata, error)
- func (i *Indexer) ListLabelsWithFrames(ctx context.Context, filter *FrameFilter, page *PaginationCursor) (FrameMetadataLabels, error)
- func (i *Indexer) ListNodesWithFrames(ctx context.Context, filter *FrameFilter, page *PaginationCursor) ([]string, error)
- func (i *Indexer) ListSlotsWithFrames(ctx context.Context, filter *FrameFilter, page *PaginationCursor) ([]phase0.Slot, error)
- func (i *Indexer) RemoveFrameMetadata(ctx context.Context, id string) error
- type IndexerConfig
- type Operation
- type Options
- type PaginationCursor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicMetrics ¶
type BasicMetrics struct {
// contains filtered or unexported fields
}
func NewBasicMetrics ¶
func NewBasicMetrics(namespace, driverName string, enabled bool) *BasicMetrics
func (*BasicMetrics) ObserveOperation ¶
func (m *BasicMetrics) ObserveOperation(operation Operation)
func (*BasicMetrics) ObserveOperationError ¶
func (m *BasicMetrics) ObserveOperationError(operation Operation)
type FrameFilter ¶
type FrameFilter struct { ID *string Node *string Before *time.Time After *time.Time Slot *uint64 Epoch *uint64 Labels *[]string }
func (*FrameFilter) AddAfter ¶
func (f *FrameFilter) AddAfter(after time.Time)
func (*FrameFilter) AddBefore ¶
func (f *FrameFilter) AddBefore(before time.Time)
func (*FrameFilter) AddEpoch ¶
func (f *FrameFilter) AddEpoch(epoch uint64)
func (*FrameFilter) AddID ¶
func (f *FrameFilter) AddID(id string)
func (*FrameFilter) AddLabels ¶
func (f *FrameFilter) AddLabels(labels []string)
func (*FrameFilter) AddNode ¶
func (f *FrameFilter) AddNode(node string)
func (*FrameFilter) AddSlot ¶
func (f *FrameFilter) AddSlot(slot uint64)
func (*FrameFilter) ApplyToQuery ¶
func (*FrameFilter) Validate ¶
func (f *FrameFilter) Validate() error
type FrameMetadata ¶
type FrameMetadata struct { gorm.Model ID string `gorm:"primaryKey"` Node string `gorm:"index"` // We have to use int64 here as SQLite doesn't support uint64. This sucks // but slot 9223372036854775808 is probably around the heat death // of the universe so we should be OK. WallClockSlot int64 `gorm:"index:idx_wall_clock_slot,where:deleted_at IS NULL"` WallClockEpoch int64 FetchedAt time.Time `gorm:"index"` Labels []FrameMetadataLabel `gorm:"foreignkey:FrameID;"` }
func (*FrameMetadata) AsFrameMetadata ¶
func (f *FrameMetadata) AsFrameMetadata() *types.FrameMetadata
func (*FrameMetadata) FromFrameMetadata ¶
func (f *FrameMetadata) FromFrameMetadata(metadata *types.FrameMetadata) *FrameMetadata
type FrameMetadataLabel ¶
type FrameMetadataLabels ¶
type FrameMetadataLabels []FrameMetadataLabel
func (*FrameMetadataLabels) AsStrings ¶
func (f *FrameMetadataLabels) AsStrings() []string
type FrameMetadatas ¶
type FrameMetadatas []*FrameMetadata
func (*FrameMetadatas) AsFrameMetadata ¶
func (f *FrameMetadatas) AsFrameMetadata() []*types.FrameMetadata
type Indexer ¶
type Indexer struct {
// contains filtered or unexported fields
}
func NewIndexer ¶
func NewIndexer(namespace string, log logrus.FieldLogger, config IndexerConfig, opts *Options) (*Indexer, error)
func (*Indexer) CountEpochsWithFrames ¶
func (*Indexer) CountFrameMetadata ¶
func (*Indexer) CountLabelsWithFrames ¶
func (*Indexer) CountNodesWithFrames ¶
func (*Indexer) CountSlotsWithFrames ¶
func (*Indexer) DeleteFrameMetadata ¶
func (*Indexer) InsertFrameMetadata ¶
func (*Indexer) ListEpochsWithFrames ¶
func (i *Indexer) ListEpochsWithFrames(ctx context.Context, filter *FrameFilter, page *PaginationCursor) ([]phase0.Epoch, error)
func (*Indexer) ListFrameMetadata ¶
func (i *Indexer) ListFrameMetadata(ctx context.Context, filter *FrameFilter, page *PaginationCursor) ([]*FrameMetadata, error)
func (*Indexer) ListLabelsWithFrames ¶
func (i *Indexer) ListLabelsWithFrames(ctx context.Context, filter *FrameFilter, page *PaginationCursor) (FrameMetadataLabels, error)
func (*Indexer) ListNodesWithFrames ¶
func (i *Indexer) ListNodesWithFrames(ctx context.Context, filter *FrameFilter, page *PaginationCursor) ([]string, error)
func (*Indexer) ListSlotsWithFrames ¶
func (i *Indexer) ListSlotsWithFrames(ctx context.Context, filter *FrameFilter, page *PaginationCursor) ([]phase0.Slot, error)
type IndexerConfig ¶
type Operation ¶
type Operation string
const ( OperationInsertFrameMetadata Operation = "insert_frame_metadata" OperationDeleteFrameMetadata Operation = "delete_frame_metadata" OperationCountFrameMetadata Operation = "count_frame_metadata" OperationListFrameMetadata Operation = "list_frame_metadata" OperationCountNodesWithFrames Operation = "count_nodes_with_frames" OperationsListNodesWithFrames Operation = "list_nodes_with_frames" OperationCountSlotsWithFrames Operation = "count_slots_with_frames" OperationListSlotsWithFrames Operation = "list_slots_with_frames" OperationCountEpochsWithFrames Operation = "count_epochs_with_frames" OperationListEpochsWithFrames Operation = "list_epochs_with_frames" OperationCountLabelsWithFrames Operation = "count_labels_with_frames" OperationListLabelsWithFrames Operation = "list_labels_with_frames" )
type Options ¶
type Options struct {
MetricsEnabled bool
}
func DefaultOptions ¶
func DefaultOptions() *Options
func (*Options) SetMetricsEnabled ¶
func (*Options) WithMetricsDisabled ¶
func (*Options) WithMetricsEnabled ¶
type PaginationCursor ¶
type PaginationCursor struct { // The cursor to start from. Offset int `json:"offset"` // The number of items to return. Limit int `json:"limit"` // OrderBy is the column to order by. OrderBy string `json:"order_by"` }
func (*PaginationCursor) ApplyOffsetLimit ¶ added in v0.0.14
func (p *PaginationCursor) ApplyOffsetLimit(query *gorm.DB) *gorm.DB
func (*PaginationCursor) ApplyOrderBy ¶ added in v0.0.14
func (p *PaginationCursor) ApplyOrderBy(query *gorm.DB) *gorm.DB
Click to show internal directories.
Click to hide internal directories.