store

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package store is an interface for distribute data storage.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
)

Functions

func Nodes

func Nodes(a ...string) options.Option

Set the nodes used to back the store

func Prefix

func Prefix(p string) options.Option

Prefix sets a prefix to any key ids used

Types

type Record

type Record struct {
	Key    string
	Value  []byte
	Expiry time.Duration
}

Record represents a data record

type Store

type Store interface {
	// embed options
	options.Options
	// Dump the known records
	Dump() ([]*Record, error)
	// Read a record with key
	Read(key string) (*Record, error)
	// Write a record
	Write(r *Record) error
	// Delete a record with key
	Delete(key string) error
}

Store is a data storage interface

Directories

Path Synopsis
Package consul is a consul implementation of kv
Package consul is a consul implementation of kv
Package memory is a in-memory store store
Package memory is a in-memory store store

Jump to

Keyboard shortcuts

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