interpreter

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

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

Go to latest
Published: Nov 29, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

README

kv-txn-interpreter

A key-value storage transaction interpreter, which provides an etcd-like transaction interface to help you build a transaction over every KV storage.

This project is still in rapid development. Please use caution in production environments.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EtcdTxnInterpreter

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

func (*EtcdTxnInterpreter) Commit

func (eti *EtcdTxnInterpreter) Commit(txn transaction.Txn) (TxnResponse, error)

type EtcdTxnResponse

type EtcdTxnResponse clientv3.TxnResponse

func (*EtcdTxnResponse) IsSucceeded

func (etr *EtcdTxnResponse) IsSucceeded() bool

type Interpreter

type Interpreter interface {
	Commit(txn transaction.Txn) (TxnResponse, error)
}

Interpreter is used to interpret the raw Transaction and do the real work inside a KV storage.

func NewEtcdTxnInterpreter

func NewEtcdTxnInterpreter(ctx context.Context, client *clientv3.Client) Interpreter

NewEtcdTxnInterpreter create a new etcd transaction interpreter with the given etcd client.

type TxnResponse

type TxnResponse interface {
	IsSucceeded() bool
}

TODO: add more detailed response info.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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