datastore

package
v0.0.0-...-7570391 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EEMPTY = errors.New("Failed to find any snapshot location entry.")
View Source
var ErrNoLock = errors.New("Attempted unlock, but couldn't find any lock entry.")

Functions

This section is empty.

Types

type Config

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

func NewConfig

func NewConfig(projectName, rootKeyStr string, c *btncrypt.Cipher, tsrc oauth2.TokenSource) *Config

type DBTransactionLogIO

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

func NewDBTransactionLogIO

func NewDBTransactionLogIO(cfg *Config, flags int) *DBTransactionLogIO

func (*DBTransactionLogIO) AppendTransaction

func (txio *DBTransactionLogIO) AppendTransaction(tx inodedb.DBTransaction) error

func (*DBTransactionLogIO) DeleteAllTransactions

func (txio *DBTransactionLogIO) DeleteAllTransactions() error

func (*DBTransactionLogIO) DeleteTransactions

func (txio *DBTransactionLogIO) DeleteTransactions(smallerThanID inodedb.TxID) error

func (*DBTransactionLogIO) ImplName

func (*DBTransactionLogIO) ImplName() string

func (*DBTransactionLogIO) QueryTransactions

func (txio *DBTransactionLogIO) QueryTransactions(minID inodedb.TxID) (txs []inodedb.DBTransaction, err error)

func (*DBTransactionLogIO) Sync

func (txio *DBTransactionLogIO) Sync() error

type ErrLockTaken

type ErrLockTaken struct {
	CreatedAt time.Time
	HostName  string
	Info      string
}

func (*ErrLockTaken) Error

func (e *ErrLockTaken) Error() string

type GlobalLocker

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

func NewGlobalLocker

func NewGlobalLocker(cfg *Config, hostname string, info string) *GlobalLocker

func (*GlobalLocker) ForceUnlock

func (l *GlobalLocker) ForceUnlock(ctx context.Context) error

func (*GlobalLocker) Lock

func (l *GlobalLocker) Lock(ctx context.Context, readOnly bool) error

func (*GlobalLocker) Query

func (l *GlobalLocker) Query(ctx context.Context) (lockEntry, error)

func (*GlobalLocker) Unlock

func (l *GlobalLocker) Unlock(ctx context.Context) error

Unlock releases the global lock previously taken by this GlobalLocker. If the lock was taken by other GlobalLocker, Unlock will fail with ErrLockTaken. If there was no lock, Unlock will fail with ErrNoLock.

func (*GlobalLocker) UnlockIgnoreCreatedAt

func (l *GlobalLocker) UnlockIgnoreCreatedAt(ctx context.Context) error

type INodeDBSSLocator

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

func NewINodeDBSSLocator

func NewINodeDBSSLocator(cfg *Config, flags int) *INodeDBSSLocator

func (*INodeDBSSLocator) DeleteAll

func (loc *INodeDBSSLocator) DeleteAll(ctx context.Context, dryRun bool) ([]string, error)

func (*INodeDBSSLocator) DeleteOld

func (loc *INodeDBSSLocator) DeleteOld(ctx context.Context, threshold int, dryRun bool) ([]string, error)

func (*INodeDBSSLocator) GenerateBlobpath

func (*INodeDBSSLocator) GenerateBlobpath() string

func (*INodeDBSSLocator) ImplName

func (*INodeDBSSLocator) ImplName() string

func (*INodeDBSSLocator) Locate

func (loc *INodeDBSSLocator) Locate(history int) (bp string, txid int64, err error)

func (*INodeDBSSLocator) Put

func (loc *INodeDBSSLocator) Put(blobpath string, txid int64) error

Jump to

Keyboard shortcuts

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