transaction

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Operation added in v0.3.1

type Operation struct {
	CollectionID string
	Content      interface{}

	DBKey, Value         []byte
	Delete, CleanHistory bool
}

Operation defines the real writes to be done

func NewOperation added in v0.3.1

func NewOperation(colName string, content interface{}, key, val []byte, del, cleanHistory bool) *Operation

NewOperation returns a new operation pointer

type Transaction

type Transaction struct {
	Ctx context.Context

	Operations []*Operation

	ResponseChan chan error
}

Transaction defines the struct to manage sequential writes

func New added in v0.3.1

func New(ctx context.Context) *Transaction

New builds a new write transaction struct with it's chanel

func NewWithOperation added in v0.3.1

func NewWithOperation(ctx context.Context, op *Operation) *Transaction

NewWithOperation build a new transaction based on an Operation pointer

func (*Transaction) AddOperation added in v0.3.1

func (t *Transaction) AddOperation(op *Operation)

AddOperation add a new operation to the given transaction

func (*Transaction) GetWriteSize added in v0.3.1

func (t *Transaction) GetWriteSize() (ret int)

GetWriteSize returns the length of bytes this transaction wants to write

Jump to

Keyboard shortcuts

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