Documentation ¶
Index ¶
- Variables
- func EnableUTCChecks()
- type Config
- type DB
- func (db *DB) Bandwidth() bandwidth.DB
- func (db *DB) Close() error
- func (db *DB) Console() console.DB
- func (db *DB) CreateTables() error
- func (db *DB) Orders() orders.DB
- func (db *DB) PieceInfo() pieces.DB
- func (db *DB) Pieces() storage.Blobs
- func (db *DB) RoutingTable() (kdb, ndb, adb storage.KeyValueStore)
- func (db *DB) UsedSerials() piecestore.UsedSerials
- func (db *DB) Vouchers() vouchers.DB
- type InfoDB
- func (db *InfoDB) Bandwidth() bandwidth.DB
- func (db *InfoDB) Begin() (*sql.Tx, error)
- func (db *InfoDB) Close() error
- func (db *InfoDB) Console() console.DB
- func (db *InfoDB) CreateTables(log *zap.Logger) error
- func (db *InfoDB) Migration() *migrate.Migration
- func (db *InfoDB) Orders() orders.DB
- func (db *InfoDB) PieceInfo() pieces.DB
- func (db *InfoDB) RawDB() *sql.DB
- func (db *InfoDB) Rebind(s string) string
- func (db *InfoDB) Schema() string
- func (db *InfoDB) UsedSerials() piecestore.UsedSerials
- func (db *InfoDB) Vouchers() vouchers.DB
Constants ¶
This section is empty.
Variables ¶
var ErrInfo = errs.Class("infodb")
ErrInfo is the default error class for InfoDB
Functions ¶
func EnableUTCChecks ¶ added in v0.15.0
func EnableUTCChecks()
EnableUTCChecks turns on tracking for timestamps being passed to the database being in the UTC location. They cannot be turned off once turned on, and should be turned on before any database calls are made.
Types ¶
type Config ¶
type Config struct { // TODO: figure out better names Storage string Info string Info2 string Kademlia string Pieces string }
Config configures storage node database
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB contains access to different database tables
func NewInMemory ¶
NewInMemory creates new inmemory master database for storage node TODO: still stores data on disk
func (*DB) CreateTables ¶
CreateTables creates any necessary tables.
func (*DB) RoutingTable ¶
func (db *DB) RoutingTable() (kdb, ndb, adb storage.KeyValueStore)
RoutingTable returns kademlia routing table
func (*DB) UsedSerials ¶
func (db *DB) UsedSerials() piecestore.UsedSerials
UsedSerials returns used serials database.
type InfoDB ¶
type InfoDB struct {
// contains filtered or unexported fields
}
InfoDB implements information database for piecestore.
func NewInfoInMemory ¶
NewInfoInMemory creates a new inmemory InfoDB.
func (*InfoDB) CreateTables ¶
CreateTables creates any necessary tables.
func (*InfoDB) UsedSerials ¶
func (db *InfoDB) UsedSerials() piecestore.UsedSerials
UsedSerials returns used serials database.