kv

package
v0.0.0-...-cca27e0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

Close close

func Delete

func Delete(bucket, key string, opts ...Option) error

Delete delete

func First

func First(bucket string, v interface{}, opts ...Option) (string, error)

First first

func Get

func Get(bucket, key string, v interface{}, opts ...Option) error

Get get

func Init

func Init(path string, buckets ...string) error

Init init

func KeyList

func KeyList(bucket string, filter func(key string) (bool, error)) ([]string, error)

KeyList foreach

func Put

func Put(bucket, key string, v interface{}, opts ...Option) error

Put put

func Stats

func Stats()

Stats stats

Types

type DB

type DB struct {
	*bbolt.DB
}

DB db

func New

func New(driver, dsn string) (*DB, error)

New new

func (*DB) Close

func (my *DB) Close() error

Close close connection

func (*DB) Delete

func (my *DB) Delete(bucket string, key string, opts ...Option) error

Delete delete

func (*DB) Dump

func (my *DB) Dump() error

Dump dump

func (*DB) First

func (my *DB) First(bucket string, v interface{}) (string, error)

First first

func (*DB) ForEach

func (my *DB) ForEach(bucket string, fc func(k, v []byte) error) error

ForEach foreach

func (*DB) Get

func (my *DB) Get(bucket, key string, v interface{}, opts ...Option) error

Get get

func (*DB) KeyList

func (my *DB) KeyList(bucket string, filter func(key string) (bool, error)) ([]string, error)

KeyList return keys in bucket

func (*DB) Put

func (my *DB) Put(bucket, key string, v interface{}, opts ...Option) error

Put save

func (*DB) Stats

func (my *DB) Stats()

Stats status

type Option

type Option func(*Options)

Option option

func Bucket

func Bucket(bucket string) Option

Bucket bucket

type Options

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

Options options

Jump to

Keyboard shortcuts

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