base

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const RegistrySep = "."

RegistrySep is a name separator for building implementation hierarchy.

Variables

View Source
var ErrVolatile = fmt.Errorf("database is in-memory")

ErrVolatile is returned when trying to pass a path for opening an in-memory database.

Functions

This section is empty.

Types

type DB

type DB interface {
	// Close closes the database.
	Close() error
}

DB is a common interface implemented by all database abstractions.

type ErrRegistered

type ErrRegistered struct {
	Name string
}

ErrRegistered is thrown when trying to register a database driver with a name that is already registered.

func (ErrRegistered) Error

func (e ErrRegistered) Error() string

type Iterator

type Iterator interface {
	// Next advances an iterator.
	Next(ctx context.Context) bool
	// Err returns a last encountered error.
	Err() error
	// Close frees resources.
	Close() error
}

Iterator is a common interface implemented by all iterators.

type Registration

type Registration struct {
	Name     string // unique name
	Title    string // human-readable name
	Local    bool   // stores data on local disk or keeps it in-memory
	Volatile bool   // not persistent
}

Registration is a common information about the database driver.

type Tx

type Tx interface {
	// Commit applies all changes made in the transaction.
	Commit(ctx context.Context) error
	// Close rolls back the transaction.
	// Committed transactions will not be affected by calling Close.
	Close() error
}

Tx is a common interface implemented by all transactions.

Jump to

Keyboard shortcuts

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