memory

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package memory implements a hugot store in memory. This is mainly intended for testing. It does not persist the data in any way.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Store implements a simple memory store over a map It is safe for concurrent access

func New

func New() *Store

New creates a new memory store baked by go map

func (*Store) Get

func (s *Store) Get(path []string) (string, bool, error)

Get retries a key from the store

func (*Store) List

func (s *Store) List(path []string) ([][]string, error)

List all items under the provided prefix

func (*Store) Set

func (s *Store) Set(path []string, value string) error

Set a key in the store

func (*Store) Unset

func (s *Store) Unset(path []string) error

Unset a key in the store

Jump to

Keyboard shortcuts

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