cache

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: Apache-2.0 Imports: 3 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 interface {
	Put(string, interface{}) bool
	Get(string) interface{}
	GetAndLock(string) interface{}
	Unlock(string)
	Len() int
}

func New

func New(capacity int) Cache

type LRUCache

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

func (*LRUCache) Get

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

func (*LRUCache) GetAndLock

func (c *LRUCache) GetAndLock(s string) interface{}

func (*LRUCache) Len

func (c *LRUCache) Len() int

func (*LRUCache) Put

func (c *LRUCache) Put(key string, value interface{}) bool

func (*LRUCache) Unlock

func (c *LRUCache) Unlock(s string)

type MockCache

type MockCache struct {
	mock.Mock
}

MockCache is an autogenerated mock type for the Cache type

func (*MockCache) Get

func (_m *MockCache) Get(_a0 string) interface{}

Get provides a mock function with given fields: _a0

func (*MockCache) GetAndLock

func (_m *MockCache) GetAndLock(_a0 string) interface{}

GetAndLock provides a mock function with given fields: _a0

func (*MockCache) Len

func (_m *MockCache) Len() int

Len provides a mock function with given fields:

func (*MockCache) Put

func (_m *MockCache) Put(_a0 string, _a1 interface{}) bool

Put provides a mock function with given fields: _a0, _a1

func (*MockCache) Unlock

func (_m *MockCache) Unlock(_a0 string)

Unlock provides a mock function with given fields: _a0

Jump to

Keyboard shortcuts

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