storagenodedb

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2019 License: AGPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 New

func New(log *zap.Logger, config Config) (*DB, error)

New creates a new master database for storage node

func NewInMemory

func NewInMemory(log *zap.Logger, storageDir string) (*DB, error)

NewInMemory creates new inmemory master database for storage node TODO: still stores data on disk

func (*DB) Bandwidth

func (db *DB) Bandwidth() bandwidth.DB

Bandwidth returns table for storing bandwidth usage.

func (*DB) Close

func (db *DB) Close() error

Close closes any resources.

func (*DB) Console added in v0.14.0

func (db *DB) Console() console.DB

Console returns console.DB

func (*DB) CreateTables

func (db *DB) CreateTables() error

CreateTables creates any necessary tables.

func (*DB) Orders

func (db *DB) Orders() orders.DB

Orders returns database for storing orders

func (*DB) PieceInfo

func (db *DB) PieceInfo() pieces.DB

PieceInfo returns database for storing piece information

func (*DB) Pieces

func (db *DB) Pieces() storage.Blobs

Pieces returns blob storage for pieces

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.

func (*DB) Vouchers added in v0.13.0

func (db *DB) Vouchers() vouchers.DB

Vouchers returns database for storing vouchers

type InfoDB

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

InfoDB implements information database for piecestore.

func NewInfoInMemory

func NewInfoInMemory() (*InfoDB, error)

NewInfoInMemory creates a new inmemory InfoDB.

func (*InfoDB) Bandwidth

func (db *InfoDB) Bandwidth() bandwidth.DB

Bandwidth returns table for storing bandwidth usage.

func (*InfoDB) Begin

func (db *InfoDB) Begin() (*sql.Tx, error)

Begin begins transaction

func (*InfoDB) Close

func (db *InfoDB) Close() error

Close closes any resources.

func (*InfoDB) Console added in v0.14.0

func (db *InfoDB) Console() console.DB

Console returns console.DB

func (*InfoDB) CreateTables

func (db *InfoDB) CreateTables(log *zap.Logger) error

CreateTables creates any necessary tables.

func (*InfoDB) Migration

func (db *InfoDB) Migration() *migrate.Migration

Migration returns table migrations.

func (*InfoDB) Orders

func (db *InfoDB) Orders() orders.DB

Orders returns database for storing orders

func (*InfoDB) PieceInfo

func (db *InfoDB) PieceInfo() pieces.DB

PieceInfo returns database for storing piece information

func (*InfoDB) RawDB

func (db *InfoDB) RawDB() *sql.DB

RawDB returns access to the raw database, only for migration tests.

func (*InfoDB) Rebind

func (db *InfoDB) Rebind(s string) string

Rebind rebind parameters

func (*InfoDB) Schema

func (db *InfoDB) Schema() string

Schema returns schema

func (*InfoDB) UsedSerials

func (db *InfoDB) UsedSerials() piecestore.UsedSerials

UsedSerials returns used serials database.

func (*InfoDB) Vouchers added in v0.13.0

func (db *InfoDB) Vouchers() vouchers.DB

Vouchers returns database for storing vouchers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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