memcache

package
v0.0.0-...-303e327 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemCache

type MemCache struct {
	*lru.TwoQueueCache
}

MemCache memory cache with lru-2q

func NewMemCache

func NewMemCache(size int) (*MemCache, error)

NewMemCache new memory cache with capacity size.

func (*MemCache) Get

func (mc *MemCache) Get(key interface{}) interface{}

Get by key, return nil if key doesn't exist or value is nil.

func (*MemCache) Set

func (mc *MemCache) Set(key interface{}, value interface{})

Set key with value, delete key if value is nil.

Jump to

Keyboard shortcuts

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