memory

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: 4 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 {
	Prefix string
	// contains filtered or unexported fields
}

Cache implements the dataloader.Cache interface

func NewEngine

func NewEngine(prefix string, s int) *Cache

NewEngine for memory engine

func (*Cache) Clear

func (c *Cache) Clear()

Clear clears the cache

func (*Cache) Delete

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

Delete deletes and item in the cache

func (*Cache) Get

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

Get gets a value from the cache

func (*Cache) Set

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

Set sets a value in the cache

Jump to

Keyboard shortcuts

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