Documentation
¶
Index ¶
- Variables
- type Cache
- type MemoryCache
- func (m *MemoryCache) Close() error
- func (m *MemoryCache) Delete(k ...[]byte) error
- func (m *MemoryCache) Get(k []byte) (v []byte, err error)
- func (m *MemoryCache) NewCache(str string) RecursionCache
- func (m *MemoryCache) Put(k, v []byte) error
- func (m *MemoryCache) Range(f func(key []byte, value []byte) bool) error
- type MockCache
- func (m *MockCache) Close() error
- func (m *MockCache) Delete(k ...[]byte) error
- func (m *MockCache) Get(k []byte) (v []byte, _ error)
- func (m *MockCache) NewCache(str string) RecursionCache
- func (m *MockCache) Put(k, v []byte) error
- func (m *MockCache) Range(f func(key []byte, value []byte) bool) error
- type RecursionCache
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 MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
func NewMemoryCache ¶
func NewMemoryCache() *MemoryCache
func (*MemoryCache) Close ¶
func (m *MemoryCache) Close() error
func (*MemoryCache) Delete ¶
func (m *MemoryCache) Delete(k ...[]byte) error
func (*MemoryCache) NewCache ¶
func (m *MemoryCache) NewCache(str string) RecursionCache
func (*MemoryCache) Put ¶
func (m *MemoryCache) Put(k, v []byte) error
type MockCache ¶ added in v0.3.7
type MockCache struct {
OnPut func(k, v []byte)
}
func (*MockCache) NewCache ¶ added in v0.3.7
func (m *MockCache) NewCache(str string) RecursionCache
type RecursionCache ¶ added in v0.3.8
type RecursionCache interface {
Cache
NewCache(str string) RecursionCache
}
Click to show internal directories.
Click to hide internal directories.