storagenodedb

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: AGPL-3.0 Imports: 30 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

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 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) CertDB

func (db *DB) CertDB() trust.CertDB

CertDB returns certificate database.

func (*DB) Close

func (db *DB) Close() error

Close closes any resources.

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) PSDB

func (db *DB) PSDB() *psdb.DB

PSDB returns piecestore database

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 storage.KeyValueStore)

RoutingTable returns kademlia routing table

func (*DB) UsedSerials

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

UsedSerials returns certificate database.

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) CertDB

func (db *InfoDB) CertDB() trust.CertDB

CertDB returns certificate database.

func (*InfoDB) Close

func (db *InfoDB) Close() error

Close closes any resources.

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 certificate database.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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