transactions

package
v0.0.0-...-ba1c585 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2017 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(bs BatchStore) store.Store

Wrap wraps the BatchStore with transaction functionality.

Types

type BatchStore

type BatchStore interface {
	store.StoreReader

	// WriteBatch atomically writes a list of write operations to the database.
	WriteBatch(batch ...WriteOp) error

	// Close closes the store.
	Close() error

	// NewSnapshot creates a snapshot.
	NewSnapshot() store.Snapshot
}

BatchStore is a CRUD-capable storage engine that supports atomic batch writes. BatchStore doesn't support transactions. This interface is a Go version of the C++ LevelDB interface. It serves as an intermediate interface between store.Store and the LevelDB interface.

type WriteOp

type WriteOp struct {
	T     WriteType
	Key   []byte
	Value []byte
}

type WriteType

type WriteType int
const (
	PutOp WriteType = iota
	DeleteOp
)

Jump to

Keyboard shortcuts

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