Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrContextParameter = errors.New("context transaction manager need context") ErrNeverNotSupported = errors.New("never transaction definition not supported transaction") ErrUnSupportTransactionDefinition = errors.New("unsupported transaction") ErrMandatoryInTransaction = errors.New("mandatory needs to be in the transaction") )
View Source
var (
MapError = errors.New("error loaded session in the map")
)
Functions ¶
This section is empty.
Types ¶
type ContextSessionKey ¶
type ContextSessionKey struct{}
type DynamicSession ¶
return session of the transaction manager
type TransactionDefinition ¶ added in v0.1.0
type TransactionDefinition uint
const ( PROPAGATION_REQUIRED TransactionDefinition PROPAGATION_SUPPORTS PROPAGATION_MANDATORY PROPAGATION_REQUIRES_NEW PROPAGATION_NOT_SUPPORTED PROPAGATION_NEVER PROPAGATION_NESTED )
type TransactionFunc ¶
transaction function
type TransactionManager ¶
type TransactionManager interface { //DynamicSessionFunc return a function DynamicSessionFunc() DynamicSession //IsInTransaction returns a value to determine whether it is currently in a transaction IsInTransaction(ctx context.Context) bool Do(context.Context, TransactionFunc, ...TransactionDefinition) error Required(context.Context, TransactionFunc) error Supports(context.Context, TransactionFunc) error Mandatory(context.Context, TransactionFunc) error RequiresNew(context.Context, TransactionFunc) error NotSupported(context.Context, TransactionFunc) error Never(context.Context, TransactionFunc) error Nested(context.Context, TransactionFunc) error }
transaction manager interface
func NewContextTransactionManager ¶
func NewContextTransactionManager(engine EngineInterface) TransactionManager
func NewRoutineTransactionManager ¶
func NewRoutineTransactionManager(engine EngineInterface) TransactionManager
NewRoutineTransactionManager
Click to show internal directories.
Click to hide internal directories.