validation

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package validation provides command structure and metadata validation utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidationError

func IsValidationError(err error) bool

IsValidationError checks if an error is a validation.Error

func ValidateDirectory

func ValidateDirectory(path string) error

ValidateDirectory validates a command directory structure

func ValidateInstalled

func ValidateInstalled(commandsDir, commandName string) error

ValidateInstalled validates an already installed command

Types

type CommandValidator

type CommandValidator struct {
	// contains filtered or unexported fields
}

CommandValidator validates command structure and content

func NewCommandValidator

func NewCommandValidator(commandPath string) *CommandValidator

NewCommandValidator creates a new validator for a command directory

func (*CommandValidator) Validate

func (v *CommandValidator) Validate() error

Validate performs full validation of the command structure

type Error

type Error struct {
	Type    string
	Details string
}

Error represents a validation error with context

func NewValidationError

func NewValidationError(errType, details string) *Error

NewValidationError creates a new validation error

func (*Error) Error

func (e *Error) Error() string

Error implements the error interface

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

Validator provides validation methods for commands

func NewValidator

func NewValidator(fileSystem fs.FileSystem) *Validator

NewValidator creates a new validator with the given file system

func (*Validator) ValidateCommandStructure

func (v *Validator) ValidateCommandStructure(commandPath string) error

ValidateCommandStructure validates a command directory structure using the file system

Jump to

Keyboard shortcuts

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