buntdb

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 buntdb use the github.com/tidwall/buntdb as cache driver

Index

Constants

View Source
const Memory = ":memory:"

Memory open a file that does not persist to disk.

View Source
const Name = "buntDB"

Name driver name

Variables

This section is empty.

Functions

This section is empty.

Types

type BuntDB

type BuntDB struct {
	cache.BaseDriver
	// contains filtered or unexported fields
}

BuntDB definition.

func New

func New(file string) *BuntDB

New a BuntDB instance

func NewMemory

func NewMemory() *BuntDB

NewMemory new a memory db

func (*BuntDB) Clear

func (c *BuntDB) Clear() error

Clear all cache data

func (*BuntDB) Close

func (c *BuntDB) Close() error

Close cache db

func (*BuntDB) Db

func (c *BuntDB) Db() *buntdb.DB

Db get

func (*BuntDB) Del

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

Del value by key

func (*BuntDB) DelMulti

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

DelMulti values by multi key

func (*BuntDB) Get

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

Get value by key

func (*BuntDB) GetMulti

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

GetMulti values by multi key

func (*BuntDB) Has

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

Has key

func (*BuntDB) Set

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

Set value by key

func (*BuntDB) SetMulti

func (c *BuntDB) 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