sqlite

package
v0.0.0-...-7030cd1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSQLiteDB

func NewSQLiteDB(path string) (db.DB, error)

NewSQLiteDB opens a new SQLite database. This method should only be called once. It returns an DB instance with which the database can be queried, or an error, if opening the database has failed.

Types

type SQLiteDB

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

SQLiteDB is a db.DB making use of sqlite3 database.

func (*SQLiteDB) Close

func (l *SQLiteDB) Close() error

func (*SQLiteDB) GetAssignedBlocksAfterNow

func (l *SQLiteDB) GetAssignedBlocksAfterNow(ctx context.Context) ([]db.AssignedBlock, error)

func (*SQLiteDB) GetAssignedBlocksBeforeNow

func (l *SQLiteDB) GetAssignedBlocksBeforeNow(ctx context.Context,
	epoch uint) ([]db.AssignedBlock, error)

func (*SQLiteDB) GetAssignedBlocksWithStatusBeforeNow

func (l *SQLiteDB) GetAssignedBlocksWithStatusBeforeNow(ctx context.Context,
	status db.BlockStatus, offset, limit uint) ([]db.AssignedBlock, error)

func (*SQLiteDB) GetLeaderLog

func (l *SQLiteDB) GetLeaderLog(ctx context.Context,
	epoch uint) (*db.LeaderLog, error)

func (*SQLiteDB) GetRegisteredEpochs

func (l *SQLiteDB) GetRegisteredEpochs(ctx context.Context,
	ordering db.Ordering, limit uint) ([]uint, error)

func (*SQLiteDB) Observer

func (l *SQLiteDB) Observer() *db.Observer

func (*SQLiteDB) UpdateStatusForAssignment

func (l *SQLiteDB) UpdateStatusForAssignment(ctx context.Context, epoch,
	no uint, status db.BlockStatus, mintedBlockID *uint) error

func (*SQLiteDB) WriteLeaderLog

func (l *SQLiteDB) WriteLeaderLog(ctx context.Context,
	leaderLog *db.LeaderLog) error

func (*SQLiteDB) WriteMintedBlock

func (l *SQLiteDB) WriteMintedBlock(ctx context.Context,
	block *db.MintedBlock) (*uint, error)

Jump to

Keyboard shortcuts

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