transaction

package
v0.0.0-...-eb6d389 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2016 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transaction

type Transaction interface {
	// Adds key with the given value to the transaction.
	// Returns true if successful,
	// false if the key already existed.
	Add(key, value string) (ok bool)

	// Set key to the given value, if the key already exists.
	// Returns true if successful.
	// If the key did not exist, it is not added and false is returned.
	Set(key, value string) (ok bool)

	// Delete key from the transaction.
	// Returns true and the value that was there, if the key existed.
	// Returns false if it did not exist.
	Del(key string) (value string, ok bool)

	// Get key from the transaction.
	// Returns true and the value that was there, if the key exists.
	// Returns false if it does not exist.
	Get(key string) (value string, ok bool)
}

func NewMapTransaction

func NewMapTransaction() Transaction

func NewSyncTransaction

func NewSyncTransaction(t Transaction) Transaction

Jump to

Keyboard shortcuts

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