postgres

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 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) CreateRuneEntry

func (r *Repository) CreateRuneEntry(ctx context.Context, entry *runes.RuneEntry, blockHeight uint64) error

func (*Repository) CreateRuneEntryState

func (r *Repository) CreateRuneEntryState(ctx context.Context, entry *runes.RuneEntry, blockHeight uint64) error

func (*Repository) CreateRuneTransaction

func (r *Repository) CreateRuneTransaction(ctx context.Context, tx *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) (map[runes.RuneId]*entity.Balance, error)

func (*Repository) GetBalancesByRuneId

func (r *Repository) GetBalancesByRuneId(ctx context.Context, runeId runes.RuneId, blockHeight uint64) ([]*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) 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) GetRuneTransactions

func (r *Repository) GetRuneTransactions(ctx context.Context, pkScript []byte, runeId runes.RuneId, height uint64) ([]*entity.RuneTransaction, error)

func (*Repository) GetRunesBalancesAtOutPoint

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

func (*Repository) GetUnspentOutPointBalancesByPkScript

func (r *Repository) GetUnspentOutPointBalancesByPkScript(ctx context.Context, pkScript []byte, blockHeight uint64) ([]*entity.OutPointBalance, 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) SpendOutPointBalances

func (r *Repository) SpendOutPointBalances(ctx context.Context, outPoint 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