batch

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: Apache-2.0 Imports: 9 Imported by: 9

Documentation

Overview

Package batch provides batch transaction support middleware to support multiple operations in one transaction

Package batch implements batch transactions.

> Batch transaction holds a list of messages > that a given application can process. What this means > is we can wrap several "transactions" within one message. > The transaction fails if any of the messages fail to be processed. > Note that fees, sigs and other extensions that don't rely on messages > are only applied once per transaction, which means that all the "embedded" > transactions don't hit the middleware.

Index

Constants

View Source
const MaxBatchMessages = 15
View Source
const (
	PathExecuteBatchMsg = "batch/execute_batch"
)

Variables

View Source
var (
	ErrInvalidLengthCodec = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCodec   = fmt.Errorf("proto: integer overflow")
)

Functions

func Validate

func Validate(msg Msg) error

Types

type BatchTx

type BatchTx struct {
	weave.Tx
	// contains filtered or unexported fields
}

func (*BatchTx) GetMsg

func (tx *BatchTx) GetMsg() (weave.Msg, error)

type ByteArrayList

type ByteArrayList struct {
	Elements [][]byte `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"`
}

func (*ByteArrayList) Descriptor

func (*ByteArrayList) Descriptor() ([]byte, []int)

func (*ByteArrayList) GetElements

func (m *ByteArrayList) GetElements() [][]byte

func (*ByteArrayList) Marshal

func (m *ByteArrayList) Marshal() (dAtA []byte, err error)

func (*ByteArrayList) MarshalTo

func (m *ByteArrayList) MarshalTo(dAtA []byte) (int, error)

func (*ByteArrayList) ProtoMessage

func (*ByteArrayList) ProtoMessage()

func (*ByteArrayList) Reset

func (m *ByteArrayList) Reset()

func (*ByteArrayList) Size

func (m *ByteArrayList) Size() (n int)

func (*ByteArrayList) String

func (m *ByteArrayList) String() string

func (*ByteArrayList) Unmarshal

func (m *ByteArrayList) Unmarshal(dAtA []byte) error

func (*ByteArrayList) XXX_DiscardUnknown added in v0.12.0

func (m *ByteArrayList) XXX_DiscardUnknown()

func (*ByteArrayList) XXX_Marshal added in v0.12.0

func (m *ByteArrayList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ByteArrayList) XXX_Merge added in v0.12.0

func (m *ByteArrayList) XXX_Merge(src proto.Message)

func (*ByteArrayList) XXX_Size added in v0.12.0

func (m *ByteArrayList) XXX_Size() int

func (*ByteArrayList) XXX_Unmarshal added in v0.12.0

func (m *ByteArrayList) XXX_Unmarshal(b []byte) error

type Decorator

type Decorator struct {
}

Decorator iterates through batch transaction messages and passes them down the stack

func NewDecorator

func NewDecorator() Decorator

NewDecorator returns a batch transaction decorator

func (Decorator) Check

func (d Decorator) Check(ctx weave.Context, store weave.KVStore, tx weave.Tx, next weave.Checker) (*weave.CheckResult, error)

Check iterates through messages in a batch transaction and passes them down the stack

func (Decorator) Deliver

func (d Decorator) Deliver(ctx weave.Context, store weave.KVStore, tx weave.Tx, next weave.Deliverer) (*weave.DeliverResult, error)

Deliver iterates through messages in a batch transaction and passes them down the stack

type Msg

type Msg interface {
	weave.Msg
	MsgList() ([]weave.Msg, error)
}

Jump to

Keyboard shortcuts

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