Documentation
¶
Index ¶
- func FindSuggestions(input string, options []string, maxSuggestions int) []string
- func IsConfigError(err error) bool
- func IsDockerError(err error) bool
- func IsKind(err error, kind ErrorKind) bool
- func IsNetworkError(err error) bool
- func Wrap(err error, op, message string) error
- func WrapWithHint(err error, op, message, hint string) error
- type ErrorKind
- type OrkError
- func ConfigError(op, message, hint string, err error) *OrkError
- func DockerError(op, message, hint string, err error) *OrkError
- func ErrCircularDependency(cycle []string) *OrkError
- func ErrConfigNotFound(path string) *OrkError
- func ErrDockerNotRunning(err error) *OrkError
- func ErrImageNotFound(imageName string) *OrkError
- func ErrInvalidConfig(field, reason string) *OrkError
- func ErrPortInUse(port, service, conflictingProcess string) *OrkError
- func ErrServiceFailed(serviceName, reason string) *OrkError
- func ErrServiceNotFound(serviceName string, availableServices []string) *OrkError
- func FileError(op, message, hint string, err error) *OrkError
- func NetworkError(op, message, hint string, err error) *OrkError
- func ServiceError(op, message, hint string, err error) *OrkError
- func ValidationError(op, message string, suggestions []string) *OrkError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindSuggestions ¶
FindSuggestions returns similar strings using simple edit distance (basic implementation - can be improved with Levenshtein distance)
func IsConfigError ¶
IsConfigError checks if the error is configuration-related
func IsDockerError ¶
IsDockerError checks if error is Docker-related
func IsNetworkError ¶
IsNetworkError checks if the error is network-related
func WrapWithHint ¶
WrapWithHint adds context and a hint to an existing error
Types ¶
type ErrorKind ¶
type ErrorKind string
ErrorKind represents the category of error
const ( ErrorConfig ErrorKind = "config" // Configuration errors ErrorDocker ErrorKind = "docker" // Docker-related errors ErrorNetwork ErrorKind = "network" // Network/port errors ErrorGit ErrorKind = "git" // Git operations ErrorService ErrorKind = "service" // Service management ErrorFile ErrorKind = "file" // File system errors ErrorValidation ErrorKind = "validation" // Validation failures ErrorInternal ErrorKind = "internal" // Unexpected internal errors )
type OrkError ¶
type OrkError struct {
// Op is the operation that failed (e.g., "docker.start", "config.load")
Op string
// Kind categorizes the error
Kind ErrorKind
// Err is the underlying error
Err error
// Message is a user-friendly description of what went wrong
Message string
// Hint provides a suggestion for how to fix the error
Hint string
// Details provides additional context (optional)
Details []string
// Suggestions provide "did you mean?" style suggestions (optional)
Suggestions []string
}
OrkError is a rich error type that provides context, hints, and suggestions
func ConfigError ¶
ConfigError creates a configuration-related error
func DockerError ¶
DockerError creates a Docker-related error
func ErrCircularDependency ¶
ErrCircularDependency creates an error for circular service dependencies
func ErrConfigNotFound ¶
ErrConfigNotFound creates an error for when ork.yml is missing
func ErrDockerNotRunning ¶
ErrDockerNotRunning creates an error for when the Docker daemon is not running
func ErrImageNotFound ¶
ErrImageNotFound creates an error for missing Docker images
func ErrInvalidConfig ¶
ErrInvalidConfig creates an error for invalid configuration
func ErrPortInUse ¶
ErrPortInUse creates an error for port conflicts
func ErrServiceFailed ¶
ErrServiceFailed creates an error for when a service fails to start
func ErrServiceNotFound ¶
ErrServiceNotFound creates an error for unknown service names
func NetworkError ¶
NetworkError creates a network/port-related error
func ServiceError ¶
ServiceError creates a service management error
func ValidationError ¶
ValidationError creates a validation error with suggestions