store

package
v0.0.0-...-3b88efa Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2016 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	StorePath            string
	MaxAccumSizeMiB      int
	MaxCacheSizeKiB      int
	MaxIndexBlockSizeKiB int
	MinSingularSizeKiB   int
	CompressionLevel     int
	MaxGoroutines        int
}

Config is a store configuration.

type ReadFunc

type ReadFunc func(st *Store, val string)

ReadFunc is a callback function to read keys or values.

type Store

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

Store data.

func New

func New(conf *Config, log *logpkg.Logger) *Store

New creates a new store.

func (*Store) AddValue

func (s *Store) AddValue(key, val string) bool

AddValue adds a new record to a store.

func (*Store) FindKeys

func (s *Store) FindKeys(cb ReadFunc) bool

FindKeys reads all keys in a store.

func (*Store) FindValues

func (s *Store) FindValues(key string, cb ReadFunc) bool

FindValues reads all values for a given key.

func (*Store) Flush

func (s *Store) Flush(wait bool) bool

Flush writes in-memory records to disk.

Jump to

Keyboard shortcuts

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