transaction

package
v0.10.12 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store interface {
	// Get gets a transaction
	Get(ctx context.Context, id configapi.TransactionID) (*configapi.Transaction, error)

	// GetByIndex gets a transaction by index
	GetByIndex(ctx context.Context, index configapi.Index) (*configapi.Transaction, error)

	// GetPrev gets the previous network change by index
	GetPrev(ctx context.Context, index configapi.Index) (*configapi.Transaction, error)

	// GetNext gets the next transaction by index
	GetNext(ctx context.Context, index configapi.Index) (*configapi.Transaction, error)

	// Create creates a new transaction
	Create(ctx context.Context, transaction *configapi.Transaction) error

	// Update updates an existing transaction
	Update(ctx context.Context, transaction *configapi.Transaction) error

	// Delete deletes a transaction
	Delete(ctx context.Context, transaction *configapi.Transaction) error

	// List lists transactions
	List(ctx context.Context) ([]*configapi.Transaction, error)

	// Watch watches the transaction store  for changes
	Watch(ctx context.Context, ch chan<- configapi.TransactionEvent, opts ...WatchOption) error

	// Close closes the transaction store
	Close(ctx context.Context) error
}

Store transaction store interface

func NewAtomixStore

func NewAtomixStore(client atomix.Client) (Store, error)

NewAtomixStore returns a new persistent Store

type WatchOption

type WatchOption interface {
	// contains filtered or unexported methods
}

WatchOption is a configuration option for Watch calls

func WithReplay

func WithReplay() WatchOption

WithReplay returns a WatchOption that replays past changes

func WithTransactionID

func WithTransactionID(id configapi.TransactionID) WatchOption

WithTransactionID returns a Watch option that watches for transactions based on a given transaction ID

Jump to

Keyboard shortcuts

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