local

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() *syncbase.Registry

Get returns global singleton instance

Types

type BytesTxn

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

BytesTxn is just an 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(map[string]datasync.ChangeValue) error) *BytesTxn

NewBytesTxn is a constructor

func (*BytesTxn) Commit

func (txn *BytesTxn) Commit() 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 BytesTxnItem

type BytesTxnItem struct {
	Data   []byte
	Delete bool
}

BytesTxnItem is used in BytesTxn

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(map[string]datasync.ChangeValue) error) *ProtoTxn

NewProtoTxn is a constructor

func (*ProtoTxn) Commit

func (txn *ProtoTxn) Commit() error

Commit executes the transaction

func (*ProtoTxn) Delete

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

Delete add delete operation into transaction

func (*ProtoTxn) Put

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

Put adds store operation into transaction

type ProtoTxnItem

type ProtoTxnItem struct {
	Data   proto.Message
	Delete bool
}

ProtoTxnItem is used in ProtoTxn

func (*ProtoTxnItem) GetValue

func (lazy *ProtoTxnItem) GetValue(out proto.Message) error

GetValue returns the value of the pair

Jump to

Keyboard shortcuts

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