Documentation ¶
Index ¶
- Variables
- 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) Migration() *migrate.Migration
- func (db *DB) Orders() orders.DB
- func (db *DB) PieceExpirationDB() pieces.PieceExpirationDB
- func (db *DB) PieceSpaceUsedDB() pieces.PieceSpaceUsedDB
- func (db *DB) Pieces() storage.Blobs
- func (db *DB) Reputation() reputation.DB
- func (db *DB) RoutingTable() (kdb, ndb, adb storage.KeyValueStore)
- func (db *DB) StorageUsage() storageusage.DB
- func (db *DB) UsedSerials() piecestore.UsedSerials
- func (db *DB) V0PieceInfo() pieces.V0PieceInfoDB
- func (db *DB) Versions() SQLDB
- func (db *DB) VersionsMigration() migrate.DB
- type SQLDB
Constants ¶
This section is empty.
Variables ¶
var ErrBandwidth = errs.Class("bandwidthdb error")
ErrBandwidth represents errors from the bandwidthdb database.
var ( // ErrDatabase represents errors from the databases. ErrDatabase = errs.Class("storage node database error") )
var ErrOrders = errs.Class("ordersdb error")
ErrOrders represents errors from the ordersdb database.
var ErrPieceExpiration = errs.Class("piece expiration error")
ErrPieceExpiration represents errors from the piece expiration database.
var ErrPieceInfo = errs.Class("v0pieceinfodb error")
ErrPieceInfo represents errors from the piece info database.
var ErrPieceSpaceUsed = errs.Class("piece space used error")
ErrPieceSpaceUsed represents errors from the piece spaced used database.
var ErrReputation = errs.Class("reputation error")
ErrReputation represents errors from the reputation database.
var ErrUsedSerials = errs.Class("usedserialsdb error")
ErrUsedSerials represents errors from the used serials database.
Functions ¶
This section is empty.
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 (*DB) CreateTables ¶
CreateTables creates any necessary tables.
func (*DB) PieceExpirationDB ¶ added in v0.18.0
func (db *DB) PieceExpirationDB() pieces.PieceExpirationDB
PieceExpirationDB returns the instance of the PieceExpiration database.
func (*DB) PieceSpaceUsedDB ¶ added in v0.18.0
func (db *DB) PieceSpaceUsedDB() pieces.PieceSpaceUsedDB
PieceSpaceUsedDB returns the instance of the PieceSpacedUsed database.
func (*DB) Reputation ¶ added in v0.18.0
func (db *DB) Reputation() reputation.DB
Reputation returns the instance of the Reputation database.
func (*DB) RoutingTable ¶
func (db *DB) RoutingTable() (kdb, ndb, adb storage.KeyValueStore)
RoutingTable returns kademlia routing table
func (*DB) StorageUsage ¶ added in v0.18.0
func (db *DB) StorageUsage() storageusage.DB
StorageUsage returns the instance of the StorageUsage database.
func (*DB) UsedSerials ¶
func (db *DB) UsedSerials() piecestore.UsedSerials
UsedSerials returns the instance of the UsedSerials database.
func (*DB) V0PieceInfo ¶ added in v0.18.0
func (db *DB) V0PieceInfo() pieces.V0PieceInfoDB
V0PieceInfo returns the instance of the V0PieceInfoDB database.
func (*DB) VersionsMigration ¶ added in v0.19.0
VersionsMigration returns the instance of the versions database.
type SQLDB ¶ added in v0.16.0
type SQLDB interface { Begin() (*sql.Tx, error) BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error) Close() error Conn(ctx context.Context) (*sql.Conn, error) Driver() driver.Driver Exec(query string, args ...interface{}) (sql.Result, error) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) Ping() error PingContext(ctx context.Context) error Prepare(query string) (*sql.Stmt, error) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) Query(query string, args ...interface{}) (*sql.Rows, error) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) QueryRow(query string, args ...interface{}) *sql.Row QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row SetConnMaxLifetime(d time.Duration) SetMaxIdleConns(n int) SetMaxOpenConns(n int) }
SQLDB defines interface that matches *sql.DB this is such that we can use utccheck.DB for the backend
TODO: wrap the connector instead of *sql.DB