data

package
Version: v0.0.0-...-193f7af Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Overview

Package data is an interface for key-value storage.

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Data

type Data interface {
	// 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
}

Data is a data storage interface

type Option

type Option func(o *Options)

func Nodes

func Nodes(a ...string) Option

func Prefix

func Prefix(p string) Option

Prefix sets a prefix to any lock ids used

type Options

type Options struct {
	Nodes  []string
	Prefix string
}

type Record

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

Record represents a data record

Source Files

Directories

Path Synopsis
Package consul is a consul implementation of kv
Package consul is a consul implementation of kv
Package etcd is an etcd v3 implementation of kv
Package etcd is an etcd v3 implementation of kv

Jump to

Keyboard shortcuts

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