store

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

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 added in v0.1.0

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

Jump to

Keyboard shortcuts

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