boltpersistence

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package boltpersistence is a BoltDB (bbolt) persistence provider.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileProvider

type FileProvider struct {

	// Path is the path to the BoltDB database to open or create.
	Path string

	// Mode is the file mode for the created file.
	// If it is zero, 0600 (owner read/write only) is used.
	Mode os.FileMode

	// Options is the BoltDB options for the database.
	// If it is nil, bbolt.DefaultOptions is used.
	Options *bbolt.Options
	// contains filtered or unexported fields
}

FileProvider is an implementation of provider.Provider for BoltDB that opens a BoltDB database file.

func (*FileProvider) Open

Open returns a data-store for a specific application.

k is the identity key of the application.

Data stores are opened for exclusive use. If another engine instance has already opened this application's data-store, ErrDataStoreLocked is returned.

type Provider

type Provider struct {

	// DB is the BoltDB database to use.
	DB *bbolt.DB
	// contains filtered or unexported fields
}

Provider is an implementation of provider.Provider for BoltDB that uses an existing open database.

func (*Provider) Open

Open returns a data-store for a specific application.

k is the identity key of the application.

Data stores are opened for exclusive use. If another engine instance has already opened this application's data-store, ErrDataStoreLocked is returned.

Directories

Path Synopsis
internal
pb

Jump to

Keyboard shortcuts

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