shardcache

package module
v0.0.0-...-f12287b Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2019 License: MIT Imports: 5 Imported by: 0

README

cache

In memory cache for json data.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewShard

func NewShard(config Config) shard

func PublicHash

func PublicHash(input interface{}) uint64

Types

type Cache

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

func NewCache

func NewCache(config Config) (Cache, error)

func (*Cache) Close

func (c *Cache) Close() error

func (*Cache) Get

func (c *Cache) Get(hashKey uint64) (data interface{}, hit bool)

func (*Cache) Set

func (c *Cache) Set(entry interface{}) error

type Config

type Config struct {
	Lifetime       uint
	MaxShardSize   uint
	NumberOfShards int
}

func DefaultConfig

func DefaultConfig() Config

Jump to

Keyboard shortcuts

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