kvstore

package module
v0.0.0-...-e35a1e5 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: MIT Imports: 6 Imported by: 0

README

kvstore

Key Value Store abstraction

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

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

Bucket a bucket

func (*Bucket) Del

func (b *Bucket) Del(ctx context.Context, key string, value interface{}) (err error)

Del deletes a value

func (*Bucket) Get

func (b *Bucket) Get(ctx context.Context, key string, value interface{}) (err error)

Get gets a value and unmarshals it

func (*Bucket) Put

func (b *Bucket) Put(ctx context.Context, key string, value interface{}) (err error)

Put marshals the value to json before storing

func (*Bucket) PutProto

func (b *Bucket) PutProto(ctx context.Context, key string, value proto.Message) (err error)

PutProto puts a protobuf message

type IndexUpdate

type IndexUpdate struct {
	B string // bucket
	K string // Key
	D bool   // Delete
}

IndexUpdate an update to an index

type Store

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

Store a store

func NewStore

func NewStore(b backend.Backend) (store *Store)

NewStore creates a new kvstore instance

func (*Store) Bucket

func (s *Store) Bucket(name string) (bucket *Bucket, err error)

Bucket creates or returns a bucket

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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