states

package
v0.0.0-...-e95280a Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallBackFn

type CallBackFn func(result Result)

CallBackFn represents a callback, executed when the transaction is processed

type Factory

type Factory interface {
	Create() (State, error)
}

Factory represents a state factory

type Result

type Result interface {
	IsValid() bool
	Valid() overviews.ValidTransaction
	IsInvalid() bool
	Invalid() overviews.InvalidTransaction
}

Result represents the result of a transaction

type ResultBuilder

type ResultBuilder interface {
	Create() ResultBuilder
	WithValidTransaction(validTrx overviews.ValidTransaction) ResultBuilder
	WithInvalidTransaction(invalidTrx overviews.InvalidTransaction) ResultBuilder
	Now() (Result, error)
}

ResultBuilder represents a result builder

type State

type State interface {
	Queue() []Transaction
	Single(trx transactions.Transaction, callBack CallBackFn) error
	List(trans []transactions.Transaction, callBack CallBackFn) error
	Atomic(atomicTrx transactions.Transactions, callBack CallBackFn) error
}

State represents a transaction application state

type Transaction

type Transaction interface {
	Transactions() []transactions.Transaction
	CallBack() CallBackFn
	IsAtomic() bool
}

Transaction represents a state transaction

type TransactionBuilder

type TransactionBuilder interface {
	Create() TransactionBuilder
	WithTransaction(trx transactions.Transaction) TransactionBuilder
	WithTransactions(trans []transactions.Transaction) TransactionBuilder
	WithCallBack(callBack CallBackFn) TransactionBuilder
	IsAtomic() TransactionBuilder
	Now() (Transaction, error)
}

TransactionBuilder represents a transaction builder

Jump to

Keyboard shortcuts

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