postgres

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: GPL-3.0 Imports: 11 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) BeginNodeSaleTx

func (*Repository) ClearDelegate

func (repo *Repository) ClearDelegate(ctx context.Context) (int64, error)

func (*Repository) Commit

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

func (*Repository) CreateBlock

func (repo *Repository) CreateBlock(ctx context.Context, arg entity.Block) error

func (*Repository) CreateEvent

func (repo *Repository) CreateEvent(ctx context.Context, arg entity.NodeSaleEvent) error

func (*Repository) CreateNode

func (repo *Repository) CreateNode(ctx context.Context, arg entity.Node) error

func (*Repository) CreateNodeSale

func (repo *Repository) CreateNodeSale(ctx context.Context, arg entity.NodeSale) error

func (*Repository) GetBlock

func (repo *Repository) GetBlock(ctx context.Context, blockHeight int64) (*entity.Block, error)

func (*Repository) GetEventsByWallet

func (repo *Repository) GetEventsByWallet(ctx context.Context, walletAddress string) ([]entity.NodeSaleEvent, error)

func (*Repository) GetLastProcessedBlock

func (repo *Repository) GetLastProcessedBlock(ctx context.Context) (*entity.Block, error)

func (*Repository) GetNodeSale

func (repo *Repository) GetNodeSale(ctx context.Context, arg datagateway.GetNodeSaleParams) ([]entity.NodeSale, error)

func (*Repository) GetNodesByDeployment

func (repo *Repository) GetNodesByDeployment(ctx context.Context, saleBlock int64, saleTxIndex int32) ([]entity.Node, error)

func (*Repository) GetNodesByIds

func (repo *Repository) GetNodesByIds(ctx context.Context, arg datagateway.GetNodesByIdsParams) ([]entity.Node, error)

func (*Repository) GetNodesByOwner

func (repo *Repository) GetNodesByOwner(ctx context.Context, arg datagateway.GetNodesByOwnerParams) ([]entity.Node, error)

func (*Repository) GetNodesByPubkey

func (repo *Repository) GetNodesByPubkey(ctx context.Context, arg datagateway.GetNodesByPubkeyParams) ([]entity.Node, error)

func (*Repository) RemoveBlockFrom

func (repo *Repository) RemoveBlockFrom(ctx context.Context, fromBlock int64) (int64, error)

func (*Repository) RemoveEventsFromBlock

func (repo *Repository) RemoveEventsFromBlock(ctx context.Context, fromBlock int64) (int64, error)

func (*Repository) Rollback

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

func (*Repository) SetDelegates

func (repo *Repository) SetDelegates(ctx context.Context, arg datagateway.SetDelegatesParams) (int64, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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