memory

package
v0.0.0-...-f714a01 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2016 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Overview

The memory package implements an in-memory storage storage. This is primarily for testing or one-off analyses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(opts storage.Options) (storage.Engine, error)

Open initializes a new Engine and returns it.

Types

type Engine

type Engine struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Engine is an in-memory store that keeps data in keyed parts.

func (*Engine) Delete

func (e *Engine) Delete(p, k string) error

func (*Engine) Get

func (e *Engine) Get(p, k string) ([]byte, error)

func (*Engine) Incr

func (e *Engine) Incr(p, k string) (uint64, error)

func (*Engine) Multi

func (e *Engine) Multi(f func(tx storage.Tx) error) error

func (*Engine) Set

func (e *Engine) Set(p, k string, v []byte) error

type Tx

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

func (*Tx) Delete

func (t *Tx) Delete(p, k string) error

func (*Tx) Get

func (t *Tx) Get(p, k string) ([]byte, error)

func (*Tx) Incr

func (t *Tx) Incr(p, k string) (uint64, error)

func (*Tx) Set

func (t *Tx) Set(p, k string, v []byte) error

Jump to

Keyboard shortcuts

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