Documentation ¶
Index ¶
- Constants
- Variables
- func New(log *zap.Logger, databaseURL string) (satellite.DB, error)
- func NewInMemory(log *zap.Logger) (satellite.DB, error)
- type ConsoleDB
- func (db *ConsoleDB) APIKeys() console.APIKeys
- func (db *ConsoleDB) BeginTx(ctx context.Context) (console.DBTx, error)
- func (db *ConsoleDB) BucketUsage() accounting.BucketUsage
- func (db *ConsoleDB) ProjectMembers() console.ProjectMembers
- func (db *ConsoleDB) Projects() console.Projects
- func (db *ConsoleDB) RegistrationTokens() console.RegistrationTokens
- func (db *ConsoleDB) Users() console.Users
- type DB
- func (db *DB) Accounting() accounting.DB
- func (db *DB) BandwidthAgreement() bwagreement.DB
- func (db *DB) CertDB() certdb.DB
- func (db *DB) Close() error
- func (db *DB) Console() console.DB
- func (db *DB) CreateSchema(schema string) error
- func (db *DB) CreateTables() error
- func (db *DB) DropSchema(schema string) error
- func (db *DB) Irreparable() irreparable.DB
- func (db *DB) Orders() orders.DB
- func (db *DB) OverlayCache() overlay.DB
- func (db *DB) PostgresMigration() *migrate.Migration
- func (db *DB) RepairQueue() queue.RepairQueue
- func (db *DB) TestDBAccess() *dbx.DB
- type DBTx
Constants ¶
const ( // OverlayCacheWindow defines the time which the Node selection uses for recent seen nodes OverlayCacheWindow = 1 * time.Hour )
Variables ¶
var ErrMigrate = errs.Class("migrate")
ErrMigrate is for tracking migration errors
var ( // Error is the default satellitedb errs class Error = errs.Class("satellitedb") )
Functions ¶
Types ¶
type ConsoleDB ¶
type ConsoleDB struct {
// contains filtered or unexported fields
}
ConsoleDB contains access to different satellite databases
func (*ConsoleDB) BucketUsage ¶
func (db *ConsoleDB) BucketUsage() accounting.BucketUsage
BucketUsage is a getter for accounting.BucketUsage repository
func (*ConsoleDB) ProjectMembers ¶
func (db *ConsoleDB) ProjectMembers() console.ProjectMembers
ProjectMembers is a getter for ProjectMembers repository
func (*ConsoleDB) RegistrationTokens ¶
func (db *ConsoleDB) RegistrationTokens() console.RegistrationTokens
RegistrationTokens is a getter for RegistrationTokens repository
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB contains access to different database tables
func (*DB) Accounting ¶
func (db *DB) Accounting() accounting.DB
Accounting returns database for tracking bandwidth agreements over time
func (*DB) BandwidthAgreement ¶
func (db *DB) BandwidthAgreement() bwagreement.DB
BandwidthAgreement is a getter for bandwidth agreement repository
func (*DB) CreateSchema ¶
CreateSchema creates a schema if it doesn't exist.
func (*DB) CreateTables ¶
CreateTables is a method for creating all tables for database
func (*DB) DropSchema ¶
DropSchema drops the named schema
func (*DB) Irreparable ¶
func (db *DB) Irreparable() irreparable.DB
Irreparable returns database for storing segments that failed repair
func (*DB) OverlayCache ¶
OverlayCache is a getter for overlay cache repository
func (*DB) PostgresMigration ¶
PostgresMigration returns steps needed for migrating postgres database.
func (*DB) RepairQueue ¶
func (db *DB) RepairQueue() queue.RepairQueue
RepairQueue is a getter for RepairQueue repository
func (*DB) TestDBAccess ¶
TestDBAccess for raw database access, should not be used outside of migration tests.