cfgbigcache

package
v0.0.0-...-6f8fa1e Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package cfgbigcache uses the bigcache in-memory database for reading and writing configuration paths.

Bigcache delivers under high concurrent and parallel load better results than a simple key value mutex protected map.

Maybe implements synchronization with MySQL core_config_data table. Converts all values to byte slices.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	Cache *bigcache.BigCache
}

Storage wrapper around the freecache.Cache type

func New

func New(config bigcache.Config) (*Storage, error)

New creates a new cache with a minimum size set to 512KB. If the size is set relatively large, you should call `debug.SetGCPercent()`, set it to a much smaller value to limit the memory consumption and GC pause time.

func (*Storage) AllKeys

func (s *Storage) AllKeys() (cfgpath.PathSlice, error)

AllKeys returns always nil. Function not supported.

func (*Storage) Get

func (s *Storage) Get(key cfgpath.Path) (interface{}, error)

Get may return a ErrKeyNotFound error

func (*Storage) Set

func (s *Storage) Set(key cfgpath.Path, value interface{}) error

Set writes a key with its value into the storage. The value gets converted to a byte slice.

Jump to

Keyboard shortcuts

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