mem

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package mem contains a very simple in-memory Impl.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Proto

func Proto(o opts.Opts) (impl.Impl, error)

Proto opens a Memory with the given Opts.

Types

type Memory

type Memory map[string][]byte

Memory is a very simple in-memory Impl.

func (*Memory) Close

func (m *Memory) Close() error

Close nils the underlying map[string][]byte value.

func (*Memory) Del

func (m *Memory) Del(key string) error

Del removes the given key from the Map.

func (*Memory) Get

func (m *Memory) Get(key string) ([]byte, error)

Get returns the value in the Memory specified by the given key.

func (*Memory) Keys

func (m *Memory) Keys() ([]string, error)

Keys returns the keys of the Memory.

func (*Memory) Set

func (m *Memory) Set(key string, data []byte) error

Set assigns the given data to the given key in the Memory.

Jump to

Keyboard shortcuts

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