Categorygithub.com/dc0d/boltron
modulepackage
0.1.0
Repository: https://github.com/dc0d/boltron.git
Documentation: pkg.go.dev

# README

GoDoc Go Report Card

boltron

too flexible and rather low level secondary indexes for boltdb

  • the actively maintained (by CoreOS) fork of boltdb is used.
  • tests copied from boltdb - the only part that changed in tests is the import path.

Tests performed using:

$ go test -test.short 

todo

  • add more boltron specific tests
  • add examples

# Functions

NewIndex .
Open creates and opens a database at the given path.
ToSlice v must be []byte, string, Name, Byter or a fixed width struct.

# Constants

MaxKeySize is the maximum length of a key, in bytes.
MaxValueSize is the maximum length of a value, in bytes.
constants.

# Variables

ErrBucketExists is returned when creating a bucket that already exists.
ErrBucketNameRequired is returned when creating a bucket with a blank name.
ErrBucketNotFound is returned when trying to access a bucket that has not been created yet.
ErrChecksum is returned when either meta page checksum does not match.
ErrDatabaseNotOpen is returned when a DB instance is accessed before it is opened or after it is closed.
ErrDatabaseOpen is returned when opening a database that is already open.
ErrDatabaseReadOnly is returned when a mutating transaction is started on a read-only database.
ErrIncompatibleValue is returned when trying create or delete a bucket on an existing non-bucket key or when trying to create or delete a non-bucket key on an existing bucket key.
errors.
ErrInvalid is returned when both meta pages on a database are invalid.
ErrKeyRequired is returned when inserting a zero-length key.
ErrKeyTooLarge is returned when inserting a key that is larger than MaxKeySize.
errors.
ErrTimeout is returned when a database cannot obtain an exclusive lock on the data file after the timeout passed to Open().
ErrTxClosed is returned when committing or rolling back a transaction that has already been committed or rolled back.
ErrTxNotWritable is returned when performing a write operation on a read-only transaction.
ErrValueTooLarge is returned when inserting a value that is larger than MaxValueSize.
ErrVersionMismatch is returned when the data file was created with a different version of Bolt.

# Structs

Bucket .
Cursor .
DB .
Index provide either gjson pattern(s) or selector (not both).
KeyMaker .
Tx .

# Interfaces

Byter .

# Type aliases

Name uses an string and provides []byte when needed.
Options represents the options that can be set when opening a database.
Stats represents statistics about the database.