store

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package store implements a simple interface and registry for transaction stores.

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrTransactionNotFound transaction not found
	ErrTransactionNotFound = fmt.Errorf("transaction not found")
)

Functions

func Register

func Register(name string, s Supplier) (err error)

Register registers store suppliers

Types

type Store

type Store interface {

	// Close the store
	Close() (err error)

	// Has checks if a transaction config exists under the given name
	Has(name string) (exists bool, err error)

	// Get a transaction config from the store
	Get(name string) (config transaction.Config, err error)

	// Set stores the given transaction config
	Set(name string, config transaction.Config) (err error)

	// Delete the transaction config for the given name
	Delete(name string) (err error)

	// Iter iterates the transaction configs applying the callback for the name and config pairs.
	// Returning false causes the iteration to stop.
	Iter(callback func(name string, config transaction.Config) (proceed bool)) (err error)
}

Store for transaction configurations

func New

func New(uri string) (s Store, err error)

New creates a new store with the registered suppliers from the given URI. URI spec: <store>:<arguments>

type Supplier

type Supplier func(uri string) (s Store, err error)

Supplier for manager.Store

Directories

Path Synopsis
Package leveldb implements a simple leveldb transaction store.
Package leveldb implements a simple leveldb transaction store.
Package memory implements a simple in-memory transaction store.
Package memory implements a simple in-memory transaction store.
Package s3 provides implementation of the storage layer under AWS S3 service.
Package s3 provides implementation of the storage layer under AWS S3 service.
Package tests implements a test suite for store drivers.
Package tests implements a test suite for store drivers.

Jump to

Keyboard shortcuts

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