database

package
v0.0.0-...-22e0fe9 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*gorm.DB
	*time.Ticker
	// contains filtered or unexported fields
}

func Open

func Open(filename string, wal bool, autoMaintenance bool) (db *DB, err error)

func (*DB) CleanupUnusedBinaryBlobs

func (db *DB) CleanupUnusedBinaryBlobs() (affected uint, err error)

func (*DB) CleanupUnusedDeduplicationBlobs

func (db *DB) CleanupUnusedDeduplicationBlobs() (affected uint, err error)

func (*DB) Close

func (db *DB) Close()

func (*DB) GetBlob

func (db *DB) GetBlob(id uint) (data []byte, err error)

func (*DB) IsValid

func (db *DB) IsValid() bool

func (*DB) Maintenance

func (db *DB) Maintenance(mayBlockReads bool) (err error)

func (*DB) MigrateModels

func (db *DB) MigrateModels() (err error)

MigrateModels

This will migrate models to the current version

func (*DB) RefreshModels

func (db *DB) RefreshModels() (err error)

RefreshModels

This can be used to refresh data, that is only generated on save (such as sizes for files)

func (*DB) SaveBlob

func (db *DB) SaveBlob(data []byte) (id uint, err error)

func (*DB) WithContext

func (db *DB) WithContext(ctx context.Context) *DB

Jump to

Keyboard shortcuts

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