commands

package
v0.60.8 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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

func EnsureContext(ctx context.Context) context.Context

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

func WrapContextError(err error) error

WrapContextError normalises context cancellation and timeout errors.

func WrapExecuteError added in v0.3.0

func WrapExecuteError(err error) error

WrapExecuteError attaches command execution metadata to returned errors.

func WrapValidationError added in v0.3.0

func WrapValidationError(err error) error

WrapValidationError ensures validation failures carry a consistent category and code.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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