datagateway

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: GPL-3.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 GetNodeCountByTierIndexParams

type GetNodeCountByTierIndexParams struct {
	SaleBlock   uint64
	SaleTxIndex uint32
	FromTier    uint32
	ToTier      uint32
}

type GetNodeCountByTierIndexRow

type GetNodeCountByTierIndexRow struct {
	TierIndex int32
	Count     int64
}

type GetNodeSaleParams

type GetNodeSaleParams struct {
	BlockHeight uint64
	TxIndex     uint32
}

type GetNodesByIdsParams

type GetNodesByIdsParams struct {
	SaleBlock   uint64
	SaleTxIndex uint32
	NodeIds     []uint32
}

type GetNodesByOwnerParams

type GetNodesByOwnerParams struct {
	SaleBlock      uint64
	SaleTxIndex    uint32
	OwnerPublicKey string
}

type GetNodesByPubkeyParams

type GetNodesByPubkeyParams struct {
	SaleBlock      int64
	SaleTxIndex    int32
	OwnerPublicKey string
	DelegatedTo    string
}

type NodeSaleDataGateway

type NodeSaleDataGateway interface {
	BeginNodeSaleTx(ctx context.Context) (NodeSaleDataGatewayWithTx, error)
	CreateBlock(ctx context.Context, arg entity.Block) error
	GetBlock(ctx context.Context, blockHeight int64) (*entity.Block, error)
	GetLastProcessedBlock(ctx context.Context) (*entity.Block, error)
	RemoveBlockFrom(ctx context.Context, fromBlock int64) (int64, error)
	RemoveEventsFromBlock(ctx context.Context, fromBlock int64) (int64, error)
	ClearDelegate(ctx context.Context) (int64, error)
	GetNodesByIds(ctx context.Context, arg GetNodesByIdsParams) ([]entity.Node, error)
	CreateEvent(ctx context.Context, arg entity.NodeSaleEvent) error
	SetDelegates(ctx context.Context, arg SetDelegatesParams) (int64, error)
	CreateNodeSale(ctx context.Context, arg entity.NodeSale) error
	GetNodeSale(ctx context.Context, arg GetNodeSaleParams) ([]entity.NodeSale, error)
	GetNodesByOwner(ctx context.Context, arg GetNodesByOwnerParams) ([]entity.Node, error)
	CreateNode(ctx context.Context, arg entity.Node) error
	GetNodeCountByTierIndex(ctx context.Context, arg GetNodeCountByTierIndexParams) ([]GetNodeCountByTierIndexRow, error)
	GetNodesByPubkey(ctx context.Context, arg GetNodesByPubkeyParams) ([]entity.Node, error)
	GetNodesByDeployment(ctx context.Context, saleBlock int64, saleTxIndex int32) ([]entity.Node, error)
	GetEventsByWallet(ctx context.Context, walletAddress string) ([]entity.NodeSaleEvent, error)
}

type NodeSaleDataGatewayWithTx

type NodeSaleDataGatewayWithTx interface {
	NodeSaleDataGateway
	Tx
}

type SetDelegatesParams

type SetDelegatesParams struct {
	SaleBlock      uint64
	SaleTxIndex    int32
	Delegatee      string
	DelegateTxHash string
	NodeIds        []uint32
}

type Tx

type Tx interface {
	// Commit commits the DB transaction. All changes made after Begin() will be persisted. Calling Commit() will close the current transaction.
	// If Commit() is called without a prior Begin(), it must be a no-op.
	Commit(ctx context.Context) error
	// Rollback rolls back the DB transaction. All changes made after Begin() will be discarded.
	// Rollback() must be safe to call even if no transaction is active. Hence, a defer Rollback() is safe, even if Commit() was called prior with non-error conditions.
	Rollback(ctx context.Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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