Versions in this module Expand all Collapse all v2 v2.0.0 May 13, 2026 Changes in this version + var ErrEventHandlerCoercionFailed = errors.New("failed to create event handler") + var ErrInvalidState = errors.New("invalid state") + var ErrRecovered = errors.New("operation recovered from panic") + func InvokeTx[Tx Transaction, Ext any, I any, O any](ctx context.Context, hub *Hub[Tx, Ext], op TxOperation[Tx, Ext, I, O], ...) (*O, error) + func Invoke[Tx Transaction, Ext any, I any, O any](ctx context.Context, hub *Hub[Tx, Ext], op Operation[Tx, Ext, I, O], input *I) (*O, error) + type AfterFunc func(*OpContext[Tx, Ext]) + type Event interface + EventName func() string + type Hub struct + func NewHub[Tx Transaction, Ext any](transactionProvider TransactionProvider[Tx], createExt func() Ext) *Hub[Tx, Ext] + func (h *Hub[Tx, Ext]) BeginOperation(ctx context.Context) *OpContext[Tx, Ext] + func (h *Hub[Tx, Ext]) RegisterEventHandler(event Event, hnd any) + type OpContext struct + func (o *OpContext[T, E]) AfterFunc(fn AfterFunc[T, E]) error + func (o *OpContext[T, E]) Emit(evt Event) error + func (o *OpContext[T, E]) Ext() E + func (o *OpContext[T, E]) Now() time.Time + func (o *OpContext[T, E]) Tx() (T, error) + type Operation func(ctx *OpContext[Tx, Ext], input *I) (*O, error) + type Transaction interface + Commit func(context.Context) error + Rollback func(context.Context) error + type TransactionProvider func(context.Context) (Tx, error) + type TxOperation func(ctx *OpContext[Tx, Ext], tx Tx, input *I) (*O, error) Other modules containing this package github.com/jaz303/operator