database

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadOptions = errors.New("bad mock filer options")
View Source
var ErrKeyNotFound = errors.New("key not found")

Functions

This section is empty.

Types

type MockFiler

type MockFiler struct {
	Opts []MockOpt
	// contains filtered or unexported fields
}

func (*MockFiler) Backend

func (m *MockFiler) Backend() any

func (*MockFiler) Close

func (m *MockFiler) Close() error

func (*MockFiler) Delete

func (m *MockFiler) Delete(key []byte) error

func (*MockFiler) Get

func (m *MockFiler) Get(key []byte) ([]byte, error)

func (*MockFiler) Has

func (m *MockFiler) Has(key []byte) bool

func (*MockFiler) Keys

func (m *MockFiler) Keys() [][]byte

func (*MockFiler) Len

func (m *MockFiler) Len() int

func (*MockFiler) Put

func (m *MockFiler) Put(key []byte, value []byte) error

func (*MockFiler) Sync

func (m *MockFiler) Sync() error

type MockKeeper

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

func NewMockKeeper

func NewMockKeeper(name string, defopts ...any) *MockKeeper

func (*MockKeeper) AllStores

func (m *MockKeeper) AllStores() map[string]database.Filer

func (*MockKeeper) BackupAll

func (m *MockKeeper) BackupAll(archivePath string) (models.Backup, error)

func (*MockKeeper) Close

func (m *MockKeeper) Close(name string) error

func (*MockKeeper) CloseAll

func (m *MockKeeper) CloseAll() error

func (*MockKeeper) Destroy

func (m *MockKeeper) Destroy(name string) error

func (*MockKeeper) Discover

func (m *MockKeeper) Discover() ([]string, error)

func (*MockKeeper) Init

func (m *MockKeeper) Init(name string, options ...any) error

func (*MockKeeper) Meta

func (m *MockKeeper) Meta() models.Metadata

func (*MockKeeper) Path

func (m *MockKeeper) Path() string

func (*MockKeeper) RestoreAll

func (m *MockKeeper) RestoreAll(archivePath string) error

func (*MockKeeper) SyncAll

func (m *MockKeeper) SyncAll() error

func (*MockKeeper) SyncAndCloseAll

func (m *MockKeeper) SyncAndCloseAll() error

func (*MockKeeper) With

func (m *MockKeeper) With(name string) database.Filer

func (*MockKeeper) WithNew

func (m *MockKeeper) WithNew(name string, options ...any) database.Filer

func (*MockKeeper) WriteMeta

func (m *MockKeeper) WriteMeta(path string) error

type MockOpt added in v0.5.3

type MockOpt string

Jump to

Keyboard shortcuts

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