bboltdriver

package
v0.0.0-...-da21e5c Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package bbolt-driver implements a bbolt driver for jidoco

Index

Constants

View Source
const PathSeparator = "/"

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	*bbolt.Tx
	*bbolt.Bucket
}

type Cursor

type Cursor struct {
}

type Driver

type Driver struct {
}

func New

func New() Driver

func (Driver) Open

func (Driver) Open(storageName string) (*Storage, error)

type Path

type Path string

func (Path) Name

func (p Path) Name() string

func (Path) Parts

func (p Path) Parts() []string

type Storage

type Storage struct {
	*bbolt.DB
}

func (*Storage) Bucket

func (s *Storage) Bucket(name Path) Bucket

Bucket returns a bucket or sub bucket. Returns nil if the bucket doesn't exist. The path / should always exist and return a usable bucket.

func (*Storage) Close

func (s *Storage) Close() error

Close closes the storage

func (*Storage) CreateBucket

func (s *Storage) CreateBucket(name Path) (Bucket, error)

CreateBucket creates a bucket or sub bucket. It may return an error if the bucket exists.

func (*Storage) CreateBucketIfNotExists

func (s *Storage) CreateBucketIfNotExists(name Path) (*Bucket, error)

CreateBucketIfNotExists creates a bucket or sub bucket. If the bucket exists, it is returned without error.

func (*Storage) ForEachBucket

func (s *Storage) ForEachBucket(fn func(p Path, b *Bucket) error) error

ForEachBucket executes a function for each bucket in the root. If the provided function returns an error then the iteration is stopped and the error is returned to the caller.

type Tx

type Tx struct {
	*bbolt.Tx
}

Jump to

Keyboard shortcuts

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