local

package
v2.2.0+incompatible Latest Latest
Warning

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

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

Documentation

Overview

Package local implements DB Transactions for the local "in memory" transport. This implementation uses a collection of transaction items that are propagated to registered GO channels.

Index

Constants

This section is empty.

Variables

View Source
var DefaultRegistry = syncbase.NewRegistry()

DefaultRegistry is a default registry.

Functions

func Get

func Get() *syncbase.Registry

Get returns the global singleton instance.

Types

type BytesTxn

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

BytesTxn is just a concurrent map of Bytes messages. The intent is to collect the user data and propagate them when commit happens.

func NewBytesTxn

func NewBytesTxn(commit func(context.Context, map[string]datasync.ChangeValue) error) *BytesTxn

NewBytesTxn is a constructor.

func (*BytesTxn) Commit

func (txn *BytesTxn) Commit(ctx context.Context) error

Commit executes the transaction.

func (*BytesTxn) Delete

func (txn *BytesTxn) Delete(key string) keyval.BytesTxn

Delete add delete operation into transaction.

func (*BytesTxn) Put

func (txn *BytesTxn) Put(key string, data []byte) keyval.BytesTxn

Put adds store operation into transaction.

type ProtoTxn

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

ProtoTxn is a concurrent map of proto messages. The intent is to collect the user data and propagate them when commit happens.

func NewProtoTxn

func NewProtoTxn(commit func(context.Context, map[string]datasync.ChangeValue) error) *ProtoTxn

NewProtoTxn is a constructor.

func (*ProtoTxn) Commit

func (txn *ProtoTxn) Commit(ctx context.Context) error

Commit executes the transaction.

func (*ProtoTxn) Delete

func (txn *ProtoTxn) Delete(key string) keyval.ProtoTxn

Delete adds delete operation into transaction.

func (*ProtoTxn) Put

func (txn *ProtoTxn) Put(key string, data proto.Message) keyval.ProtoTxn

Put adds store operation into transaction.

Jump to

Keyboard shortcuts

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