bbolt

package
v0.0.0-...-4425001 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package bbolt supports randomizer storage in a local bbolt database file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FactoryFromEnv

func FactoryFromEnv() (func(string) randomizer.Store, error)

FactoryFromEnv returns a store.Factory whose stores are backed by a local Bolt database (using the CoreOS "bbolt" fork).

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is a store backed by a bbolt database.

func New

func New(db *bolt.DB, bucket string) (Store, error)

New creates a new store backed by the provided (pre-opened) bbolt database.

func (Store) Delete

func (b Store) Delete(_ context.Context, name string) (existed bool, err error)

Delete removes the named group from the store.

func (Store) Get

func (b Store) Get(_ context.Context, name string) (options []string, err error)

Get obtains the options in a single named group.

func (Store) List

func (b Store) List(_ context.Context) (groups []string, err error)

List obtains the set of stored groups.

func (Store) Put

func (b Store) Put(_ context.Context, name string, options []string) error

Put saves the provided options into a named group.

Jump to

Keyboard shortcuts

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