bbolt

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache(db *bbolt.DB, bucketName string) *Cache

func (*Cache) Close

func (c *Cache) Close() error

func (*Cache) Delete

func (c *Cache) Delete(k ...[]byte) error

func (*Cache) Get

func (c *Cache) Get(k []byte) (v []byte, err error)

func (*Cache) NewCache added in v0.3.7

func (c *Cache) NewCache(str string) cache.RecursionCache

func (*Cache) Put

func (c *Cache) Put(k, v []byte) error

func (*Cache) Range

func (c *Cache) Range(f func(key []byte, value []byte) bool) error

type NoSynncEntry

type NoSynncEntry struct {
	Keys  [][]byte
	Value []byte
	Type  Type
}

type Nosync

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

func NewNosyncCache

func NewNosyncCache(db *bbolt.DB, bucketName string) *Nosync

NewNosyncCache It is not realtime cache, put is not blocking, get value maybe nil

func (*Nosync) Close

func (c *Nosync) Close() error

func (*Nosync) Delete

func (c *Nosync) Delete(k ...[]byte) error

func (*Nosync) Get

func (c *Nosync) Get(k []byte) (v []byte, err error)

func (*Nosync) NewCache added in v0.3.8

func (c *Nosync) NewCache(bucketName string) cache.Cache

NewCache you must close every new cache for no sync

func (*Nosync) Put

func (c *Nosync) Put(k, v []byte) error

func (*Nosync) Range

func (c *Nosync) Range(f func(key []byte, value []byte) bool) error

type Type

type Type byte
const (
	Delete Type = iota
	Put
)

Jump to

Keyboard shortcuts

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