Documentation ¶
Index ¶
- func TupleToAOS2[T1 any, T2 any](soa tuple.T2[[]T1, []T2]) (res []tuple.T2[T1, T2])
- func TupleToSOA2[T1 any, T2 any](aos []tuple.T2[T1, T2]) (res tuple.T2[[]T1, []T2])
- type BadHookPointError
- type HookExecutionError
- type HookPoint
- type Hooks
- func (hooks *Hooks[TEntity]) AddHook(point HookPoint, hook func(context.Context, *TEntity) error) error
- func (hooks *Hooks[TEntity]) ClearHooks(point HookPoint) error
- func (hooks *Hooks[TEntity]) ExecuteHooks(ctx context.Context, point HookPoint, entity *TEntity) error
- func (hooks *Hooks[TEntity]) PartiallySpecializeExecuteHooks(ctx context.Context, point HookPoint) func(entity *TEntity) error
- func (hooks *Hooks[TEntity]) PartiallySpecializeExecuteHooksForNoPointer(ctx context.Context, point HookPoint) func(entity TEntity) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TupleToAOS2 ¶
func TupleToSOA2 ¶
Types ¶
type BadHookPointError ¶
type BadHookPointError struct{}
func (BadHookPointError) As ¶ added in v0.6.0
func (err BadHookPointError) As(target any) bool
func (BadHookPointError) Error ¶ added in v0.6.0
func (err BadHookPointError) Error() string
func (BadHookPointError) Is ¶ added in v0.6.0
func (err BadHookPointError) Is(other error) bool
type HookExecutionError ¶
type HookExecutionError struct {
Inner error
}
func (HookExecutionError) Error ¶
func (err HookExecutionError) Error() string
func (HookExecutionError) Unwrap ¶
func (err HookExecutionError) Unwrap() error
type HookPoint ¶
type HookPoint int
const ( BeforeAddHook HookPoint = 1 << iota AfterAddHook BeforeSelectHook AfterSelectHook BeforeUpdateHook AfterUpdateHook BeforeDeleteHook AfterDeleteHook BeforeUpsertHook AfterUpsertHook BeforeAnyHook AfterAnyHook // TODO: Handle these hooks in managers. AfterErrorHook AfterDeadlineHook AfterTimeoutHook AfterCancelHook )
type Hooks ¶
type Hooks[TEntity any] struct { // contains filtered or unexported fields }
func (*Hooks[TEntity]) ClearHooks ¶
func (*Hooks[TEntity]) ExecuteHooks ¶
func (*Hooks[TEntity]) PartiallySpecializeExecuteHooks ¶
Click to show internal directories.
Click to hide internal directories.