cache

package
v1.2.11 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 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 Create

type Create func(string) (interface{}, error)

type LRUCache

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

func NewLRUCache

func NewLRUCache(size int, create Create) *LRUCache

func (*LRUCache) Get

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

func (*LRUCache) Len

func (c *LRUCache) Len() int

func (*LRUCache) Put

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

func (*LRUCache) Size

func (c *LRUCache) Size() int

type SimpleCache added in v0.9.7

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

func NewSimpleCache added in v0.9.7

func NewSimpleCache(cap int) *SimpleCache

func (*SimpleCache) Get added in v0.9.7

func (c *SimpleCache) Get(key []byte) interface{}

func (*SimpleCache) Put added in v0.9.7

func (c *SimpleCache) Put(key []byte, value interface{})

Jump to

Keyboard shortcuts

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