model

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 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 AccountAgg

type AccountAgg struct {
	*Model
	*Aggregate

	PublicKey                        string         `json:"public_key"`
	RecentGeneralBalance             types.Quantity `json:"recent_general_balance"`
	RecentGeneralNonce               uint64         `json:"recent_general_nonce"`
	RecentEscrowActiveBalance        types.Quantity `json:"recent_escrow_active_balance"`
	RecentEscrowActiveTotalShares    types.Quantity `json:"recent_escrow_active_total_shares"`
	RecentEscrowDebondingBalance     types.Quantity `json:"recent_escrow_debonding_balance"`
	RecentEscrowDebondingTotalShares types.Quantity `json:"recent_escrow_debonding_total_shares"`
}

func (*AccountAgg) Equal

func (aa *AccountAgg) Equal(m AccountAgg) bool

func (AccountAgg) TableName

func (AccountAgg) TableName() string

func (*AccountAgg) Update added in v0.4.2

func (aa *AccountAgg) Update(u *AccountAgg)

func (*AccountAgg) Valid

func (aa *AccountAgg) 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 BalanceEvent added in v0.6.0

type BalanceEvent struct {
	*Model

	Height        int64            `json:"height"`
	Address       string           `json:"address"`
	EscrowAddress string           `json:"escrow_addr"`
	Amount        types.Quantity   `json:"amount"`
	Kind          BalanceEventKind `json:"kind"`
}

func (BalanceEvent) TableName added in v0.6.0

func (BalanceEvent) TableName() string

func (*BalanceEvent) Update added in v0.6.0

func (b *BalanceEvent) Update(m BalanceEvent)

type BalanceEventKind added in v0.6.0

type BalanceEventKind string
const (
	Commission     BalanceEventKind = "commission"
	SlashActive    BalanceEventKind = "slash_active"
	SlashDebonding BalanceEventKind = "slash_debonding"
	Reward         BalanceEventKind = "reward"
)

func (BalanceEventKind) String added in v0.6.0

func (b BalanceEventKind) String() string

type BalanceSummary added in v0.6.0

type BalanceSummary struct {
	*Model
	*Summary

	StartHeight     int64          `json:"start_height"`
	Address         string         `json:"address"`
	EscrowAddress   string         `json:"escrow_address"`
	TotalRewards    types.Quantity `json:"total_rewards"`
	TotalCommission types.Quantity `json:"total_commission"`
	TotalSlashed    types.Quantity `json:"total_slashed"`
}

func (BalanceSummary) TableName added in v0.6.0

func (BalanceSummary) TableName() string

func (*BalanceSummary) Update added in v0.6.0

func (s *BalanceSummary) Update(m BalanceSummary)

type BlockSeq

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

	*Sequence

	// Indexed data
	TransactionsCount int64 `json:"transactions_count"`
}

func (*BlockSeq) Equal

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

func (BlockSeq) TableName

func (BlockSeq) TableName() string

func (*BlockSeq) Update added in v0.4.2

func (b *BlockSeq) Update(m BlockSeq)

func (*BlockSeq) Valid

func (b *BlockSeq) Valid() bool

type BlockSummary added in v0.4.0

type BlockSummary struct {
	*Model
	*Summary

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

func (BlockSummary) TableName added in v0.4.0

func (BlockSummary) TableName() string

type Chain

type Chain struct {
	Id          string      `json:"id"`
	Name        string      `json:"name"`
	GenesisTime *types.Time `json:"genesis_time"`
	Height      int64       `json:"height"`
}

type DebondingDelegationSeq

type DebondingDelegationSeq struct {
	*Model
	*Sequence

	ValidatorUID string         `json:"validator_uid"`
	DelegatorUID string         `json:"delegator_uid"`
	Shares       types.Quantity `json:"shares"`
	DebondEnd    uint64         `json:"debond_end"`
}

func (*DebondingDelegationSeq) Equal

func (DebondingDelegationSeq) TableName

func (DebondingDelegationSeq) TableName() string

func (*DebondingDelegationSeq) Valid

func (d *DebondingDelegationSeq) Valid() bool

type DelegationSeq

type DelegationSeq struct {
	*Model
	*Sequence

	ValidatorUID string         `json:"validator_uid"`
	DelegatorUID string         `json:"delegator_uid"`
	Shares       types.Quantity `json:"shares"`
}

func (*DelegationSeq) Equal

func (d *DelegationSeq) Equal(m DelegationSeq) bool

func (DelegationSeq) TableName

func (DelegationSeq) TableName() string

func (*DelegationSeq) Valid

func (d *DelegationSeq) 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 added in v0.4.2

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

func (ReportKind) String added in v0.4.2

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 StakingSeq

type StakingSeq struct {
	*Model
	*Sequence

	TotalSupply         types.Quantity `json:"total_supply"`
	CommonPool          types.Quantity `json:"common_pool"`
	DebondingInterval   uint64         `json:"debonding_interval"`
	MinDelegationAmount types.Quantity `json:"min_delegation_amount"`
}

func (*StakingSeq) Equal

func (ss *StakingSeq) Equal(m StakingSeq) bool

func (StakingSeq) TableName

func (StakingSeq) TableName() string

func (*StakingSeq) Valid

func (ss *StakingSeq) Valid() bool

type Summary added in v0.4.0

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

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

func (*Summary) Valid added in v0.4.0

func (a *Summary) Valid() bool

type Syncable

type Syncable struct {
	*Model

	Height       int64          `json:"height"`
	Time         types.Time     `json:"time"`
	AppVersion   uint64         `json:"app_version"`
	BlockVersion uint64         `json:"block_version"`
	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 (s *Syncable) TableName() string

func (*Syncable) Update added in v0.5.0

func (s *Syncable) Update(m Syncable)

func (*Syncable) Valid

func (s *Syncable) Valid() bool

type SyncableStatus

type SyncableStatus int
const (
	SyncableStatusRunning SyncableStatus = iota
	SyncableStatusCompleted
)

type SystemEvent added in v0.5.0

type SystemEvent struct {
	*Model

	Height int64           `json:"height"`
	Time   types.Time      `json:"time"`
	Actor  string          `json:"actor"`
	Kind   SystemEventKind `json:"kind"`
	Data   types.Jsonb     `json:"data"`
}

func (SystemEvent) Update added in v0.5.0

func (o SystemEvent) Update(m SystemEvent)

type SystemEventKind added in v0.5.0

type SystemEventKind string
const (
	SystemEventActiveEscrowBalanceChange1 SystemEventKind = "active_escrow_balance_change_1"
	SystemEventActiveEscrowBalanceChange2 SystemEventKind = "active_escrow_balance_change_2"
	SystemEventActiveEscrowBalanceChange3 SystemEventKind = "active_escrow_balance_change_3"
	SystemEventCommissionChange1          SystemEventKind = "commission_change_1"
	SystemEventCommissionChange2          SystemEventKind = "commission_change_2"
	SystemEventCommissionChange3          SystemEventKind = "commission_change_3"
	SystemEventJoinedActiveSet            SystemEventKind = "joined_active_set"
	SystemEventLeftActiveSet              SystemEventKind = "left_active_set"
	SystemEventMissedNConsecutive         SystemEventKind = "missed_n_consecutive"
	SystemEventMissedNofM                 SystemEventKind = "missed_n_of_m"
)

func (SystemEventKind) String added in v0.5.0

func (o SystemEventKind) String() string

type TransactionSeq

type TransactionSeq struct {
	*Model
	*Sequence

	PublicKey string         `json:"public_key"`
	Hash      string         `json:"hash"`
	Nonce     uint64         `json:"nonce"`
	Fee       types.Quantity `json:"fee"`
	GasLimit  uint64         `json:"gas_limit"`
	GasPrice  types.Quantity `json:"gas_price"`
	Method    string         `json:"method"`
}

func (*TransactionSeq) Equal

func (ts *TransactionSeq) Equal(m TransactionSeq) bool

func (TransactionSeq) TableName

func (TransactionSeq) TableName() string

func (*TransactionSeq) Valid

func (ts *TransactionSeq) Valid() bool

type ValidatorAgg

type ValidatorAgg struct {
	*Model
	*Aggregate

	Address                   string         `json:"address"`
	EntityUID                 string         `json:"entity_uid"`
	RecentTendermintAddress   string         `json:"recent_tendermint_address"`
	RecentVotingPower         int64          `json:"recent_voting_power"`
	RecentTotalShares         types.Quantity `json:"recent_total_shares"`
	RecentActiveEscrowBalance types.Quantity `json:"recent_active_escrow_balance"`
	RecentCommission          types.Quantity `json:"recent_commission"`
	RecentRewards             types.Quantity `json:"recent_rewards"`
	RecentAsValidatorHeight   int64          `json:"recent_as_validator_height"`
	RecentProposedHeight      int64          `json:"recent_proposed_height"`
	AccumulatedProposedCount  int64          `json:"accumulated_proposed_count"`
	AccumulatedUptime         int64          `json:"accumulated_uptime"`
	AccumulatedUptimeCount    int64          `json:"accumulated_uptime_count"`
	LogoURL                   string         `json:"logo_url"`
	EntityName                string         `json:"entity_name"`
}

func (*ValidatorAgg) Equal

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

func (ValidatorAgg) TableName

func (ValidatorAgg) TableName() string

func (*ValidatorAgg) Update added in v0.4.2

func (aa *ValidatorAgg) Update(entity ValidatorAgg)

func (*ValidatorAgg) Valid

func (aa *ValidatorAgg) Valid() bool

type ValidatorSeq

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

	*Sequence

	EntityUID           string         `json:"entity_uid"`
	Address             string         `json:"address"`
	Proposed            bool           `json:"proposed"`
	VotingPower         int64          `json:"voting_power"`
	TotalShares         types.Quantity `json:"total_shares"`
	ActiveEscrowBalance types.Quantity `json:"active_escrow_balance"`
	Commission          types.Quantity `json:"commission"`
	Rewards             types.Quantity `json:"rewards"`
	PrecommitValidated  *bool          `json:"precommit_validated"`
}

func (*ValidatorSeq) Equal

func (vs *ValidatorSeq) Equal(m ValidatorSeq) bool

func (ValidatorSeq) TableName

func (ValidatorSeq) TableName() string

func (*ValidatorSeq) Update added in v0.4.2

func (vs *ValidatorSeq) Update(m ValidatorSeq)

func (*ValidatorSeq) Valid

func (vs *ValidatorSeq) Valid() bool

type ValidatorSummary added in v0.4.0

type ValidatorSummary struct {
	*Model
	*Summary

	Address                string         `json:"address"`
	VotingPowerAvg         float64        `json:"voting_power_avg"`
	VotingPowerMax         float64        `json:"voting_power_max"`
	VotingPowerMin         float64        `json:"voting_power_min"`
	TotalSharesAvg         types.Quantity `json:"total_shares_avg"`
	TotalSharesMax         types.Quantity `json:"total_shares_max"`
	TotalSharesMin         types.Quantity `json:"total_shares_min"`
	ActiveEscrowBalanceAvg types.Quantity `json:"active_escrow_balance_avg"`
	ActiveEscrowBalanceMax types.Quantity `json:"active_escrow_balance_max"`
	ActiveEscrowBalanceMin types.Quantity `json:"active_escrow_balance_min"`
	CommissionAvg          types.Quantity `json:"commission_avg"`
	CommissionMax          types.Quantity `json:"commission_max"`
	CommissionMin          types.Quantity `json:"commission_min"`
	ValidatedSum           int64          `json:"validated_sum"`
	NotValidatedSum        int64          `json:"not_validated_sum"`
	ProposedSum            int64          `json:"proposed_sum"`
	UptimeAvg              float64        `json:"uptime_avg"`
}

func (ValidatorSummary) TableName added in v0.4.0

func (ValidatorSummary) TableName() string

Jump to

Keyboard shortcuts

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