postgres

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTxAlreadyExists = errors.New("Transaction already exists. Call Commit() or Rollback() first.")

Functions

This section is empty.

Types

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

func NewRepository

func NewRepository(db postgres.DB) *Repository

func (*Repository) BeginRunesTx

func (*Repository) Commit

func (r *Repository) Commit(ctx context.Context) error

func (*Repository) CountRuneEntries

func (r *Repository) CountRuneEntries(ctx context.Context) (uint64, error)

func (*Repository) CreateIndexedBlock

func (r *Repository) CreateIndexedBlock(ctx context.Context, block *entity.IndexedBlock) error

func (*Repository) CreateOutPointBalances

func (r *Repository) CreateOutPointBalances(ctx context.Context, outPointBalances []*entity.OutPointBalance) error

func (*Repository) CreateRuneBalances

func (r *Repository) CreateRuneBalances(ctx context.Context, params []datagateway.CreateRuneBalancesParams) error

func (*Repository) CreateRuneEntries added in v0.5.5

func (r *Repository) CreateRuneEntries(ctx context.Context, entries []*runes.RuneEntry, blockHeight uint64) error

func (*Repository) CreateRuneEntryStates added in v0.5.5

func (r *Repository) CreateRuneEntryStates(ctx context.Context, entries []*runes.RuneEntry, blockHeight uint64) error

func (*Repository) CreateRuneTransactions added in v0.5.5

func (r *Repository) CreateRuneTransactions(ctx context.Context, txs []*entity.RuneTransaction) error

func (*Repository) DeleteIndexedBlockSinceHeight

func (r *Repository) DeleteIndexedBlockSinceHeight(ctx context.Context, height uint64) error

func (*Repository) DeleteOutPointBalancesSinceHeight

func (r *Repository) DeleteOutPointBalancesSinceHeight(ctx context.Context, height uint64) error

func (*Repository) DeleteRuneBalancesSinceHeight

func (r *Repository) DeleteRuneBalancesSinceHeight(ctx context.Context, height uint64) error

func (*Repository) DeleteRuneEntriesSinceHeight

func (r *Repository) DeleteRuneEntriesSinceHeight(ctx context.Context, height uint64) error

func (*Repository) DeleteRuneEntryStatesSinceHeight

func (r *Repository) DeleteRuneEntryStatesSinceHeight(ctx context.Context, height uint64) error

func (*Repository) DeleteRuneTransactionsSinceHeight

func (r *Repository) DeleteRuneTransactionsSinceHeight(ctx context.Context, height uint64) error

func (*Repository) DeleteRunestonesSinceHeight

func (r *Repository) DeleteRunestonesSinceHeight(ctx context.Context, height uint64) error

func (*Repository) GetBalanceByPkScriptAndRuneId

func (r *Repository) GetBalanceByPkScriptAndRuneId(ctx context.Context, pkScript []byte, runeId runes.RuneId, blockHeight uint64) (*entity.Balance, error)

func (*Repository) GetBalancesByPkScript

func (r *Repository) GetBalancesByPkScript(ctx context.Context, pkScript []byte, blockHeight uint64, limit int32, offset int32) ([]*entity.Balance, error)

func (*Repository) GetBalancesByRuneId

func (r *Repository) GetBalancesByRuneId(ctx context.Context, runeId runes.RuneId, blockHeight uint64, limit int32, offset int32) ([]*entity.Balance, error)

func (*Repository) GetIndexedBlockByHeight

func (r *Repository) GetIndexedBlockByHeight(ctx context.Context, height int64) (*entity.IndexedBlock, error)

func (*Repository) GetLatestBlock

func (r *Repository) GetLatestBlock(ctx context.Context) (types.BlockHeader, error)

warning: GetLatestBlock currently returns a types.BlockHeader with only Height, Hash, and PrevBlock fields populated. This is because it is known that all usage of this function only requires these fields. In the future, we may want to populate all fields for type safety.

func (*Repository) GetLatestIndexerState

func (r *Repository) GetLatestIndexerState(ctx context.Context) (entity.IndexerState, error)

func (*Repository) GetLatestIndexerStats

func (r *Repository) GetLatestIndexerStats(ctx context.Context) (string, common.Network, error)

func (*Repository) GetOngoingRuneEntries added in v0.4.6

func (r *Repository) GetOngoingRuneEntries(ctx context.Context, search string, blockHeight uint64, limit int32, offset int32) ([]*runes.RuneEntry, error)

func (*Repository) GetRuneEntries added in v0.4.6

func (r *Repository) GetRuneEntries(ctx context.Context, search string, blockHeight uint64, limit int32, offset int32) ([]*runes.RuneEntry, error)

func (*Repository) GetRuneEntryByRuneId

func (r *Repository) GetRuneEntryByRuneId(ctx context.Context, runeId runes.RuneId) (*runes.RuneEntry, error)

func (*Repository) GetRuneEntryByRuneIdAndHeight

func (r *Repository) GetRuneEntryByRuneIdAndHeight(ctx context.Context, runeId runes.RuneId, blockHeight uint64) (*runes.RuneEntry, error)

func (*Repository) GetRuneEntryByRuneIdAndHeightBatch

func (r *Repository) GetRuneEntryByRuneIdAndHeightBatch(ctx context.Context, runeIds []runes.RuneId, blockHeight uint64) (map[runes.RuneId]*runes.RuneEntry, error)

func (*Repository) GetRuneEntryByRuneIdBatch

func (r *Repository) GetRuneEntryByRuneIdBatch(ctx context.Context, runeIds []runes.RuneId) (map[runes.RuneId]*runes.RuneEntry, error)

func (*Repository) GetRuneIdFromRune

func (r *Repository) GetRuneIdFromRune(ctx context.Context, rune runes.Rune) (runes.RuneId, error)

func (*Repository) GetRuneTransaction added in v0.4.0

func (r *Repository) GetRuneTransaction(ctx context.Context, txHash chainhash.Hash) (*entity.RuneTransaction, error)

func (*Repository) GetRuneTransactions

func (r *Repository) GetRuneTransactions(ctx context.Context, pkScript []byte, runeId runes.RuneId, fromBlock, toBlock uint64, limit int32, offset int32) ([]*entity.RuneTransaction, error)

func (*Repository) GetRunesBalancesAtOutPoint

func (r *Repository) GetRunesBalancesAtOutPoint(ctx context.Context, outPoint wire.OutPoint) (map[runes.RuneId]*entity.OutPointBalance, error)

func (*Repository) GetRunesUTXOsByPkScript added in v0.3.0

func (r *Repository) GetRunesUTXOsByPkScript(ctx context.Context, pkScript []byte, blockHeight uint64, limit int32, offset int32) ([]*entity.RunesUTXO, error)

func (*Repository) GetRunesUTXOsByRuneIdAndPkScript added in v0.3.0

func (r *Repository) GetRunesUTXOsByRuneIdAndPkScript(ctx context.Context, runeId runes.RuneId, pkScript []byte, blockHeight uint64, limit int32, offset int32) ([]*entity.RunesUTXO, error)

func (*Repository) GetTotalHoldersByRuneIds added in v0.4.6

func (r *Repository) GetTotalHoldersByRuneIds(ctx context.Context, runeIds []runes.RuneId, blockHeight uint64) (map[runes.RuneId]int64, error)

func (*Repository) Rollback

func (r *Repository) Rollback(ctx context.Context) error

func (*Repository) SetIndexerState

func (r *Repository) SetIndexerState(ctx context.Context, state entity.IndexerState) error

func (*Repository) SpendOutPointBalancesBatch added in v0.5.5

func (r *Repository) SpendOutPointBalancesBatch(ctx context.Context, outPoints []wire.OutPoint, blockHeight uint64) error

func (*Repository) UnspendOutPointBalancesSinceHeight

func (r *Repository) UnspendOutPointBalancesSinceHeight(ctx context.Context, height uint64) error

func (*Repository) UpdateIndexerStats

func (r *Repository) UpdateIndexerStats(ctx context.Context, clientVersion string, network common.Network) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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