protavobolt

package
v0.0.0-...-c1dc28d Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package protavobolt provides a BoltDB based Protavo driver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenExclusive

func OpenExclusive(
	file string,
	mode os.FileMode,
	opts *bolt.Options,
) (*protavo.DB, error)

OpenExclusive returns a BoltDB-based database that is locked for exclusive use by this process.

func OpenTemp

func OpenTemp(
	mode os.FileMode,
	opts *bolt.Options,
) (*protavo.DB, error)

OpenTemp returns a BoltDB-based database that uses a temporary file. The file is deleted when the database is closed.

Types

type ExclusiveDriver

type ExclusiveDriver struct {
	DB *bolt.DB
	// contains filtered or unexported fields
}

ExclusiveDriver is an implementation of protavo.Driver backed by a BoltDB database that is held open for the life-time of the driver.

func (*ExclusiveDriver) BeginRead

func (d *ExclusiveDriver) BeginRead(
	ctx context.Context,
	ns string,
) (driver.ReadTx, error)

BeginRead starts a new read-only transaction.

func (*ExclusiveDriver) BeginWrite

func (d *ExclusiveDriver) BeginWrite(
	ctx context.Context,
	ns string,
) (driver.WriteTx, error)

BeginWrite starts a new read/write transaction.

func (*ExclusiveDriver) Close

func (d *ExclusiveDriver) Close() error

Close closes the driver, freeing any resources and preventing further operations.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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