prefix

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: 1 Imported by: 0

Documentation

Overview

Package prefix implements a hugot Storer that wraps another store and ddds an additional prefix to all keys.

This can be used to force handles to write data under another key.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store wraps a Storer, and transparenttly appends and removes a suffix

func New

func New(s storage.Storer, pfx []string) Store

New creates a store than preprends your provided suffix to store keys (with a # separator)

func (Store) Get

func (p Store) Get(key []string) (string, bool, error)

Get retrieves a key from the store.

func (Store) List

func (p Store) List(key []string) ([][]string, error)

List lists all the keys with the given suffix

func (Store) Set

func (p Store) Set(key []string, value string) error

Set sets a key in the store.

func (Store) Unset

func (p Store) Unset(key []string) error

Unset removes a key from the store

Jump to

Keyboard shortcuts

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