model

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregate

type Aggregate struct {
	StartedAtHeight int64      `json:"started_at_height"`
	StartedAt       types.Time `json:"started_at"`
	RecentAtHeight  int64      `json:"recent_at_height"`
	RecentAt        types.Time `json:"recent_at"`
}

Aggregate is used for aggregate tables

func (*Aggregate) Equal

func (a *Aggregate) Equal(m Aggregate) bool

func (*Aggregate) Valid

func (a *Aggregate) Valid() bool

type BlockSeq

type BlockSeq struct {
	ID types.ID `json:"id"`

	*Sequence

	// Indexed data
	ExtrinsicsCount         int64 `json:"extrinsics_count"`
	UnsignedExtrinsicsCount int64 `json:"unsigned_extrinsics_count"`
	SignedExtrinsicsCount   int64 `json:"signed_extrinsics_count"`
}

func (*BlockSeq) Equal

func (b *BlockSeq) Equal(m BlockSeq) bool

func (BlockSeq) TableName

func (BlockSeq) TableName() string

func (*BlockSeq) Update

func (b *BlockSeq) Update(m BlockSeq)

func (*BlockSeq) Valid

func (b *BlockSeq) Valid() bool

type BlockSummary

type BlockSummary struct {
	*Model
	*Summary

	Count        int64   `json:"count"`
	BlockTimeAvg float64 `json:"block_time_avg"`
}

func (BlockSummary) TableName

func (BlockSummary) TableName() string

type Model

type Model struct {
	ID        types.ID   `json:"id"`
	CreatedAt types.Time `json:"created_at"`
	UpdatedAt types.Time `json:"updated_at"`
}

Model is used for general table

func (*Model) Equal

func (e *Model) Equal(m Model) bool

func (*Model) Valid

func (e *Model) Valid() bool

type Report

type Report struct {
	*Model

	Kind         ReportKind
	IndexVersion int64
	StartHeight  int64
	EndHeight    int64
	SuccessCount *int64
	ErrorCount   *int64
	ErrorMsg     *string
	Duration     time.Duration
	CompletedAt  *types.Time
}

func (*Report) Complete

func (r *Report) Complete(successCount int64, errorCount int64, err error)

func (*Report) Equal

func (r *Report) Equal(m Report) bool

func (Report) TableName

func (Report) TableName() string

func (*Report) Valid

func (r *Report) Valid() bool

type ReportKind

type ReportKind int
const (
	ReportKindIndex ReportKind = iota + 1
	ReportKindParallelReindex
	ReportKindSequentialReindex
)

func (ReportKind) String

func (k ReportKind) String() string

type Sequence

type Sequence struct {
	Height int64      `json:"height"`
	Time   types.Time `json:"time"`
}

Sequence is used for sequence tables

func (*Sequence) Equal

func (s *Sequence) Equal(m Sequence) bool

func (*Sequence) Valid

func (s *Sequence) Valid() bool

type Summary

type Summary struct {
	IndexVersion int64                 `json:"index_version"`
	TimeInterval types.SummaryInterval `json:"time_interval"`
	TimeBucket   types.Time            `json:"time_bucket"`
}

Summary is used for summary tables

func (*Summary) Equal

func (a *Summary) Equal(m Summary) bool

func (*Summary) Valid

func (a *Summary) Valid() bool

type Syncable

type Syncable struct {
	*Model

	Height        int64      `json:"height"`
	Time          types.Time `json:"time"`
	SpecVersion   string     `json:"spec_version"`
	ChainUID      string     `json:"chain_uid"`
	Session       int64      `json:"session"`
	Era           int64      `json:"era"`
	LastInSession bool       `json:"last_in_session"`
	LastInEra     bool       `json:"last_in_era"`

	IndexVersion int64          `json:"index_version"`
	Status       SyncableStatus `json:"status"`
	ReportID     types.ID       `json:"report_id"`
	StartedAt    types.Time     `json:"started_at"`
	ProcessedAt  *types.Time    `json:"processed_at"`
	Duration     time.Duration  `json:"duration"`
}

func (*Syncable) Equal

func (s *Syncable) Equal(m Syncable) bool

func (*Syncable) MarkProcessed

func (s *Syncable) MarkProcessed(indexVersion int64)

func (*Syncable) SetStatus

func (s *Syncable) SetStatus(newStatus SyncableStatus)

func (Syncable) TableName

func (Syncable) TableName() string

- Methods

func (*Syncable) Valid

func (s *Syncable) Valid() bool

type SyncableStatus

type SyncableStatus int
const (
	SyncableStatusRunning SyncableStatus = iota + 1
	SyncableStatusCompleted
)

Jump to

Keyboard shortcuts

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