Documentation
¶
Overview ¶
Package result provides a Result struct to represent the outcome of a tool installation operation.
Index ¶
- func StatusStrings() []string
- type Result
- func (r Result) AsError() error
- func (r Result) Error() string
- func (r Result) IsFailed() bool
- func (r Result) IsOK() bool
- func (r Result) IsSkipped() bool
- func (r Result) String() string
- func (r Result) Unwrap() error
- func (r Result) Wrap(err error) Result
- func (r Result) Wrapped(message string) Result
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StatusStrings ¶
func StatusStrings() []string
StatusStrings returns a slice of all String values of the enum
Types ¶
type Result ¶
Result represents the outcome of a tool installation operation. It combines a status code with a descriptive message and an optional error.
func WithFailed ¶
WithFailed creates a new Result with a Failed status, message, and optional errors. If multiple errors are provided, they're joined using errors.Join.
func WithSkipped ¶
WithSkipped creates a new Result with a Skipped status and the provided message.
func (Result) AsError ¶
AsError returns an error if the Result represents a failure. Returns nil for successful or skipped results.
type Status ¶
type Status int
Status represents the possible states of a tool installation operation.
func StatusString ¶
StatusString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.