cache

package
v0.0.0-...-82e36bc Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 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 Cache

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

Based on https://raw.githubusercontent.com/hashicorp/golang-lru/master/simplelru/lru.go

func New

func New(maxBytes int) *Cache

func (*Cache) Add

func (c *Cache) Add(key string, value *structs.CacheEntry)

Add adds a value to the cache. Returns true if an eviction occurred.

func (*Cache) Get

func (c *Cache) Get(key string) *structs.CacheEntry

Get looks up a key's value from the cache.

func (*Cache) Size

func (c *Cache) Size() int

Size returns the current size of the cache in bytes.

Jump to

Keyboard shortcuts

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