boltdb

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package bolt use the go.etcd.io/bbolt(github.com/etcd-io/bbolt) as cache driver

Index

Constants

View Source
const Name = "boltDB"

Name driver name

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltDB

type BoltDB struct {
	cache.BaseDriver

	// Bucket name
	Bucket string
	// contains filtered or unexported fields
}

BoltDB definition

func New

func New(file string) *BoltDB

New a BuntDB instance

func (*BoltDB) Clear

func (c *BoltDB) Clear() error

Clear all data

func (*BoltDB) Close

func (c *BoltDB) Close() error

Close db

func (*BoltDB) Del

func (c *BoltDB) Del(key string) error

Del value by key

func (*BoltDB) DelMulti

func (c *BoltDB) DelMulti(keys []string) error

DelMulti values by multi key

func (*BoltDB) Get

func (c *BoltDB) Get(key string) interface{}

Get value by key

func (*BoltDB) GetMulti

func (c *BoltDB) GetMulti(keys []string) map[string]interface{}

GetMulti values by multi key

func (*BoltDB) Has

func (c *BoltDB) Has(key string) bool

Has value check by key

func (*BoltDB) Set

func (c *BoltDB) Set(key string, val interface{}, _ time.Duration) (err error)

Set value by key

func (*BoltDB) SetMulti

func (c *BoltDB) SetMulti(values map[string]interface{}, ttl time.Duration) (err error)

SetMulti values by multi key

Jump to

Keyboard shortcuts

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