store

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemRepo

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

MemRepo holds a in-memory representation of a store backend

func NewMemRepository

func NewMemRepository(c *cache.Cache) (*MemRepo, error)

NewMemRepository returns a newly initialized in-memory repository

func (*MemRepo) Get

func (r *MemRepo) Get(key string) (string, error)

Get retrieves a value from the k/v store

func (*MemRepo) Save

func (r *MemRepo) Save(key string, value string)

Save stores a new value for a key in the k/v store

type StorageRepository

type StorageRepository interface {
	// Save stores an item in the store
	Save(string, string) error

	// Get item from store
	Get(string) (string, error)
}

StorageRepository defines the interface for a k/v backend

Jump to

Keyboard shortcuts

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