gcache

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 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 Getter

type Getter interface {
	Get(key string) ([]byte, error)
}

type GetterFunc

type GetterFunc func(key string) ([]byte, error)

func (GetterFunc) Get

func (f GetterFunc) Get(key string) ([]byte, error)

type Group

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

func GetGroup

func GetGroup(name string) *Group

func NewGroups

func NewGroups(name string, cacheBytes int64, getter Getter) *Group

func (*Group) Get

func (g *Group) Get(key string) ([]byte, error)

type LRU

type LRU struct {
	CallBack func(key string, val []byte)
	// contains filtered or unexported fields
}

func NewLRU

func NewLRU(maxByte int64, callBack func(key string, val []byte)) *LRU

func (*LRU) Add

func (g *LRU) Add(key string, data []byte)

func (*LRU) Del

func (g *LRU) Del(key string)

func (*LRU) Get

func (g *LRU) Get(key string) (v []byte, ok bool)

func (*LRU) Len

func (g *LRU) Len() int

func (*LRU) Remove

func (g *LRU) Remove(k ...string)

type Node

type Node struct {
	Key string
	Val []byte
}

Jump to

Keyboard shortcuts

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