entry

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package entry provides functions and SQL framents for working with the "entry" table, which stores factom.Entry with a valid flag.

Index

Constants

View Source
const CreateTable = `` /* 441-byte string literal not displayed */

CreateTable is a SQL string that creates the "entry" table.

The "entry" table has a foreign key reference to the "eblock" table, which must exist first.

View Source
const SelectWhere = `SELECT "hash", "data", "timestamp" FROM "entry" WHERE `

SelectWhere is a SQL fragment for retrieving rows from the "entry" table with Select().

Variables

This section is empty.

Functions

func CheckUniquelyValid

func CheckUniquelyValid(conn *sqlite.Conn,
	id int64, hash *factom.Bytes32) (bool, error)

CheckUniquelyValid returns true if there are no valid entry earlier than id that have the same hash. If id is 0, then all entry are checked.

func Insert

func Insert(conn *sqlite.Conn, e factom.Entry, ebSeq uint32) (int64, error)

Insert e into the "entry" table with the EBlock reference ebSeq. If successful, the new row id of e is returned.

func Select

func Select(stmt *sqlite.Stmt) (factom.Entry, error)

Select the next factom.Entry from the given prepared Stmt.

The Stmt must be created with a SQL string starting with SelectWhere.

func SelectByAddress

func SelectByAddress(conn *sqlite.Conn, startHash *factom.Bytes32,
	adrs []factom.FAAddress, nfTkns fat1.NFTokens,
	toFrom, order string,
	page, limit uint) ([]factom.Entry, error)

SelectByAddress returns all the factom.Entry where adrs and nfTkns were involved in the valid transaction, for the given pagination range.

Pages start at 1.

TODO: This should probably be moved out of the entry package and into a db package that is more specific to FAT0 and FAT1.

func SelectByHash

func SelectByHash(conn *sqlite.Conn, hash *factom.Bytes32) (factom.Entry, error)

SelectByHash returns the first factom.Entry with hash.

func SelectByID

func SelectByID(conn *sqlite.Conn, id int64) (factom.Entry, error)

SelectByID returns the factom.Entry at row id.

func SelectCount

func SelectCount(conn *sqlite.Conn, validOnly bool) (int64, error)

SelectCount returns the total number of rows in the "entry" table. If validOnly is true, only the rows where "valid" = true are counted.

func SelectLatestValid

func SelectLatestValid(conn *sqlite.Conn) (factom.Entry, error)

SelectLatestValid returns the most recent valid factom.Entry.

func SelectValidByHash

func SelectValidByHash(conn *sqlite.Conn, hash *factom.Bytes32) (factom.Entry, error)

SelectValidByHash returns the first valid factom.Entry with hash.

func SetValid

func SetValid(conn *sqlite.Conn, id int64) error

SetValid marks the entry valid at the id'th row of the "entry" table.

Types

This section is empty.

Jump to

Keyboard shortcuts

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