smart_txn_client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VoidOnRetry

func VoidOnRetry(err error)

Types

type SmartClient

type SmartClient struct {
	types.TxnManager
	// contains filtered or unexported fields
}

func NewSmartClient

func NewSmartClient(tm types.TxnManager, maxRetry int) *SmartClient

func (*SmartClient) Close

func (c *SmartClient) Close() error

func (*SmartClient) DoTransaction

func (c *SmartClient) DoTransaction(ctx context.Context, f func(ctx context.Context, txn types.Txn) error) error

func (*SmartClient) DoTransactionEx

func (c *SmartClient) DoTransactionEx(ctx context.Context, f func(ctx context.Context, txn types.Txn) error) (types.Txn, error)

func (*SmartClient) DoTransactionOfOption

func (c *SmartClient) DoTransactionOfOption(ctx context.Context, opt types.TxnOption, f func(ctx context.Context, txn types.Txn) error) (
	txn types.Txn, retryTimes int, retryDetails types.RetryDetails, err error)

func (*SmartClient) DoTransactionOfType

func (c *SmartClient) DoTransactionOfType(ctx context.Context, typ types.TxnType, f func(ctx context.Context, txn types.Txn) error) error

func (*SmartClient) DoTransactionOfTypeEx

func (c *SmartClient) DoTransactionOfTypeEx(ctx context.Context, typ types.TxnType, f func(ctx context.Context, txn types.Txn) error) (_ types.Txn, retryTimes int, _ error)

func (*SmartClient) DoTransactionRaw

func (c *SmartClient) DoTransactionRaw(ctx context.Context, opt types.TxnOption, f func(ctx context.Context, txn types.Txn) (err error, retry bool),
	beforeCommit, beforeRollback func() error, onRetry func(err error)) (_ types.Txn, retryTimes int, _ error)

func (*SmartClient) Get

func (c *SmartClient) Get(ctx context.Context, key string) (val types.TValue, _ error)

func (*SmartClient) GetInt

func (c *SmartClient) GetInt(ctx context.Context, key string) (int, error)

func (*SmartClient) MGet

func (c *SmartClient) MGet(ctx context.Context, keys []string, txnType types.TxnType) (values []types.TValue, _ error)

func (*SmartClient) MGetInts

func (c *SmartClient) MGetInts(ctx context.Context, keys []string, txnType types.TxnType) ([]int, error)

func (*SmartClient) MSet

func (c *SmartClient) MSet(ctx context.Context, keys []string, values [][]byte, txnType types.TxnType) error

func (*SmartClient) MSetInts

func (c *SmartClient) MSetInts(ctx context.Context, keys []string, values []int) error

func (*SmartClient) Set

func (c *SmartClient) Set(ctx context.Context, key string, val []byte) error

func (*SmartClient) SetInt

func (c *SmartClient) SetInt(ctx context.Context, key string, intVal int) error

Jump to

Keyboard shortcuts

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