lru

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2019 License: MIT 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 struct {
	*lru.ARCCache
	Prefix string
}

Cache implements the dataloader.Cache interface

func NewEngine

func NewEngine(prefix string) *Cache

NewEngine for lru engine

func (*Cache) Clear

func (c *Cache) Clear()

Clear cleasrs the cache

func (*Cache) Delete

func (c *Cache) Delete(_ context.Context, key dataloader.Key) bool

Delete deletes an item in the cache

func (*Cache) Get

func (c *Cache) Get(_ context.Context, key dataloader.Key) (dataloader.Thunk, bool)

Get gets an item from the cache

func (*Cache) Set

func (c *Cache) Set(_ context.Context, key dataloader.Key, value dataloader.Thunk)

Set sets an item in the cache

Jump to

Keyboard shortcuts

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