Documentation
¶
Index ¶
- Constants
- func EnsureContext(ctx context.Context) context.Context
- func EnsureLogger(logger interfaces.Logger) interfaces.Logger
- func WithCommandTimeout(ctx context.Context, timeout time.Duration) (context.Context, context.CancelFunc)
- func WrapContextError(err error) error
- func WrapExecuteError(err error) error
- func WrapValidationError(err error) error
Constants ¶
View Source
const DefaultCommandTimeout = 30 * time.Second
DefaultCommandTimeout mirrors the historic handler timeout applied to commands.
Variables ¶
This section is empty.
Functions ¶
func EnsureContext ¶ added in v0.3.0
EnsureContext returns a non-nil context, falling back to context.Background when nil.
func EnsureLogger ¶ added in v0.3.0
func EnsureLogger(logger interfaces.Logger) interfaces.Logger
EnsureLogger returns a usable logger, defaulting to a no-op logger when nil.
func WithCommandTimeout ¶ added in v0.3.0
func WithCommandTimeout(ctx context.Context, timeout time.Duration) (context.Context, context.CancelFunc)
WithCommandTimeout applies the provided timeout unless it is zero or negative.
func WrapContextError ¶ added in v0.3.0
WrapContextError normalises context cancellation and timeout errors.
func WrapExecuteError ¶ added in v0.3.0
WrapExecuteError attaches command execution metadata to returned errors.
func WrapValidationError ¶ added in v0.3.0
WrapValidationError ensures validation failures carry a consistent category and code.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.