transdsl

package
v0.0.0-...-9649b88 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTransEnd = errors.New("trans end")
	ErrContinue = errors.New("continue")
)

Functions

func IsErrorEqual

func IsErrorEqual(errLeft, errRight error) bool

Types

type Fragment

type Fragment interface {
	Exec(transInfo *TransInfo) error
	RollBack(transInfo *TransInfo)
}

type Optional

type Optional struct {
	Spec     Specification
	Fragment Fragment
	// contains filtered or unexported fields
}

func (*Optional) Exec

func (this *Optional) Exec(transInfo *TransInfo) error

func (*Optional) RollBack

func (this *Optional) RollBack(transInfo *TransInfo)

type Procedure

type Procedure struct {
	Fragments []Fragment
}

func (*Procedure) Exec

func (this *Procedure) Exec(transInfo *TransInfo) error

func (*Procedure) RollBack

func (this *Procedure) RollBack(transInfo *TransInfo)

type Repeat

type Repeat struct {
	Fragments []Fragment
	FuncVar   func() Fragment
}

func (*Repeat) Exec

func (this *Repeat) Exec(transInfo *TransInfo) error

func (*Repeat) RollBack

func (this *Repeat) RollBack(transInfo *TransInfo)

type Specification

type Specification interface {
	Ok(transInfo *TransInfo) bool
}

type TransInfo

type TransInfo struct {
	// DDD framework params
	Times     int
	RepeatIdx int

	// user app info
	AppInfo interface{}
}

type Transaction

type Transaction struct {
	Fragments []Fragment
	// contains filtered or unexported fields
}

func (*Transaction) Exec

func (this *Transaction) Exec(transInfo *TransInfo) error

func (*Transaction) RollBack

func (this *Transaction) RollBack(transInfo *TransInfo)

Jump to

Keyboard shortcuts

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