memory

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(_ map[string]interface{}) (cache.Cache, error)

New returns a new Cache in in-memory

Types

type MemoryCache

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

MemoryCache Cache in in-memory map.

func (*MemoryCache) ClearAll

func (p *MemoryCache) ClearAll() (err error)

ClearAll clear all cache

func (*MemoryCache) Close

func (p *MemoryCache) Close() error

func (*MemoryCache) Delete

func (p *MemoryCache) Delete(key string)

Delete delete cached value by key

func (*MemoryCache) Get

func (p *MemoryCache) Get(key string) (value []byte, ok bool)

Get get cached value by key

func (*MemoryCache) GetRange

func (p *MemoryCache) GetRange(key string, low, high int64) (value []byte, ok bool)

GetRange

func (*MemoryCache) Set

func (p *MemoryCache) Set(key string, value []byte)

func (*MemoryCache) SetTimeout

func (p *MemoryCache) SetTimeout(key string, value []byte, timeout time.Duration) (err error)

Put set cached value with key and expire time

Jump to

Keyboard shortcuts

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