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) 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() SQLDB
- func (db *InfoDB) Rebind(s string) string
- func (db *InfoDB) Schema() string
- func (db *InfoDB) UsedSerials() piecestore.UsedSerials
- func (db *InfoDB) Vouchers() vouchers.DB
- type SQLDB
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInfo = errs.Class("infodb")
ErrInfo is the default error class for InfoDB
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) 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 NewInfoTest ¶ added in v0.16.0
NewInfoTest 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.
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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.