database

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	Close() error
	Sync() error
	Update(func(*bbolt.Tx) error) error
	View(func(*bbolt.Tx) error) error
}

Database is a database used to save offsets

func OpenDatabase

func OpenDatabase(file string) (Database, error)

OpenDatabase will open and create a database

type StubDatabase

type StubDatabase struct{}

StubDatabase is an implementation of Database that succeeds on all calls without persisting anything to disk. This is used when --database is unspecified.

func NewStubDatabase

func NewStubDatabase() *StubDatabase

NewStubDatabase creates a new StubDatabase

func (*StubDatabase) Close

func (d *StubDatabase) Close() error

Close will be ignored by the stub database

func (*StubDatabase) Sync

func (d *StubDatabase) Sync() error

Sync will be ignored by the stub database

func (*StubDatabase) Update

func (d *StubDatabase) Update(func(tx *bbolt.Tx) error) error

Update will be ignored by the stub database

func (*StubDatabase) View

func (d *StubDatabase) View(func(tx *bbolt.Tx) error) error

View will be ignored by the stub database

Jump to

Keyboard shortcuts

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