model

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountEraSeq added in v0.3.0

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

	*EraSequence

	// Origin accounts
	StashAccount      string `json:"stash_account"`
	ControllerAccount string `json:"controller_account"`
	// Destination accounts
	ValidatorStashAccount      string         `json:"validator_stash_account"`
	ValidatorControllerAccount string         `json:"validator_controller_account"`
	Stake                      types.Quantity `json:"own_stake"`
}

func (*AccountEraSeq) Equal added in v0.3.0

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

func (AccountEraSeq) TableName added in v0.3.0

func (AccountEraSeq) TableName() string

func (*AccountEraSeq) Update added in v0.3.0

func (b *AccountEraSeq) Update(m AccountEraSeq)

func (*AccountEraSeq) Valid added in v0.3.0

func (s *AccountEraSeq) Valid() bool

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 EraSequence added in v0.1.2

type EraSequence struct {
	Era         int64      `json:"era"`
	StartHeight int64      `json:"start_height"`
	EndHeight   int64      `json:"end_height"`
	Time        types.Time `json:"time"`
}

EraSequence is used for sequences recorded per era

func (*EraSequence) Equal added in v0.1.2

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

func (*EraSequence) Valid added in v0.1.2

func (s *EraSequence) Valid() bool

type EventSeq added in v0.1.2

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

	*Sequence

	// Indexed data
	Index          int64       `json:"index"`
	ExtrinsicIndex int64       `json:"extrinsic_index"`
	Data           types.Jsonb `json:"data"`
	Phase          string      `json:"phase"`
	Method         string      `json:"method"`
	Section        string      `json:"section"`
}

func (*EventSeq) Equal added in v0.1.2

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

func (EventSeq) TableName added in v0.1.2

func (EventSeq) TableName() string

func (*EventSeq) Update added in v0.1.2

func (b *EventSeq) Update(m EventSeq)

func (*EventSeq) Valid added in v0.1.2

func (b *EventSeq) Valid() bool

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 SessionSequence added in v0.1.2

type SessionSequence struct {
	Session     int64      `json:"session"`
	StartHeight int64      `json:"start_height"`
	EndHeight   int64      `json:"end_height"`
	Time        types.Time `json:"time"`
}

SessionSequence is used for sequences recorded per session

func (*SessionSequence) Equal added in v0.1.2

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

func (*SessionSequence) Valid added in v0.1.2

func (s *SessionSequence) 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
)

type ValidatorAgg added in v0.1.2

type ValidatorAgg struct {
	*Model
	*Aggregate

	StashAccount            string `json:"stash_account"`
	DisplayName             string `json:"display_name"`
	RecentAsValidatorHeight int64  `json:"recent_as_validator_height"`
	AccumulatedUptime       int64  `json:"accumulated_uptime"`
	AccumulatedUptimeCount  int64  `json:"accumulated_uptime_count"`
}

func (*ValidatorAgg) Equal added in v0.1.2

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

func (ValidatorAgg) TableName added in v0.1.2

func (ValidatorAgg) TableName() string

- Methods

func (*ValidatorAgg) Update added in v0.1.2

func (s *ValidatorAgg) Update(u *ValidatorAgg)

func (*ValidatorAgg) Valid added in v0.1.2

func (s *ValidatorAgg) Valid() bool

type ValidatorEraSeq added in v0.1.2

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

	*EraSequence

	StashAccount      string         `json:"stash_account"`
	ControllerAccount string         `json:"controller_account"`
	SessionAccounts   pq.StringArray `json:"session_accounts"`
	Index             int64          `json:"index"`
	TotalStake        types.Quantity `json:"total_stake"`
	OwnStake          types.Quantity `json:"own_stake"`
	StakersStake      types.Quantity `json:"stakers_stake"`
	RewardPoints      int64          `json:"reward_points"`
	Commission        int64          `json:"commission"`
	StakersCount      int            `json:"stakers_count"`
}

func (*ValidatorEraSeq) Equal added in v0.1.2

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

func (ValidatorEraSeq) TableName added in v0.1.2

func (ValidatorEraSeq) TableName() string

func (*ValidatorEraSeq) Update added in v0.1.2

func (b *ValidatorEraSeq) Update(m ValidatorEraSeq)

func (*ValidatorEraSeq) Valid added in v0.1.2

func (s *ValidatorEraSeq) Valid() bool

type ValidatorSessionSeq added in v0.1.2

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

	*SessionSequence

	StashAccount string `json:"stash_account"`
	Online       bool   `json:"online"`
}

func (*ValidatorSessionSeq) Equal added in v0.1.2

func (ValidatorSessionSeq) TableName added in v0.1.2

func (ValidatorSessionSeq) TableName() string

func (*ValidatorSessionSeq) Update added in v0.1.2

func (*ValidatorSessionSeq) Valid added in v0.1.2

func (s *ValidatorSessionSeq) Valid() bool

type ValidatorSummary added in v0.1.2

type ValidatorSummary struct {
	*Model
	*Summary

	StashAccount string `json:"address"`

	// Era info
	TotalStakeAvg   types.Quantity `json:"total_stake_avg"`
	TotalStakeMin   types.Quantity `json:"total_stake_min"`
	TotalStakeMax   types.Quantity `json:"total_stake_max"`
	OwnStakeAvg     types.Quantity `json:"own_stake_avg"`
	OwnStakeMin     types.Quantity `json:"own_stake_min"`
	OwnStakeMax     types.Quantity `json:"own_stake_max"`
	StakersStakeAvg types.Quantity `json:"stakers_stake_avg"`
	StakersStakeMin types.Quantity `json:"stakers_stake_min"`
	StakersStakeMax types.Quantity `json:"stakers_stake_max"`
	RewardPointsAvg float64        `json:"reward_points_avg"`
	RewardPointsMin int64          `json:"reward_points_min"`
	RewardPointsMax int64          `json:"reward_points_max"`
	CommissionAvg   float64        `json:"commission_avg"`
	CommissionMin   int64          `json:"commission_min"`
	CommissionMax   int64          `json:"commission_max"`
	StakersCountAvg float64        `json:"stakers_count_avg"`
	StakersCountMin int64          `json:"stakers_count_min"`
	StakersCountMax int64          `json:"stakers_count_max"`

	// Session info
	UptimeAvg float64 `json:"uptime_avg"`
	UptimeMax int64   `json:"uptime_max"`
	UptimeMin int64   `json:"uptime_min"`
}

func (ValidatorSummary) TableName added in v0.1.2

func (ValidatorSummary) TableName() string

Jump to

Keyboard shortcuts

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