cache

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBucketNotExist = errors.New("bucket not exist")

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(k []byte) (v []byte, err error)
	Put(k, v []byte) error
	Delete(k ...[]byte) error
	Close() error
	Range(f func(key []byte, value []byte) bool) error
}

func NewMockCache added in v0.3.7

func NewMockCache() Cache

type MockCache added in v0.3.7

type MockCache struct {
	OnPut func(k, v []byte)
}

func (*MockCache) Close added in v0.3.7

func (m *MockCache) Close() error

func (*MockCache) Delete added in v0.3.7

func (m *MockCache) Delete(k ...[]byte) error

func (*MockCache) Get added in v0.3.7

func (m *MockCache) Get(k []byte) (v []byte, _ error)

func (*MockCache) NewCache added in v0.3.7

func (m *MockCache) NewCache(str string) Cache

func (*MockCache) Put added in v0.3.7

func (m *MockCache) Put(k, v []byte) error

func (*MockCache) Range added in v0.3.7

func (m *MockCache) Range(f func(key []byte, value []byte) bool) error

type RecursionCache added in v0.3.8

type RecursionCache interface {
	Cache
	NewCache(str string) RecursionCache
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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