validation

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ValidationError

type ValidationError struct {
	Field   string // The field that failed validation
	Message string // User-friendly error message
}

ValidationError represents a validation failure with detailed context.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

type Validator

type Validator interface {
	// Validate checks if the NFSProvisioner resource is valid.
	//
	// Parameters:
	//   - nfs: The NFSProvisioner resource to validate
	//
	// Returns:
	//   - error: Non-nil if validation fails, with a descriptive message
	Validate(nfs *cachev1alpha1.NFSProvisioner) error
}

Validator validates NFSProvisioner resources according to business rules. Validation failures should result in user-friendly error messages that guide users to fix the issue.

func NewValidator

func NewValidator() Validator

NewValidator creates a new Validator instance.

Jump to

Keyboard shortcuts

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