Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidWebURL ¶
IsValidWebURL performs lightweight validation for web URLs (backward compatibility)
func ValidateURL ¶
func ValidateURL(ctx context.Context, rawURL string, opts ValidationOptions) error
ValidateURL performs comprehensive URL validation with configurable options This is the main entry point that consolidates all validation logic
func ValidateURLSimple ¶
ValidateURLSimple performs basic URL validation without network checks Useful for quick validation where SSRF protection isn't needed
Types ¶
type ValidationError ¶
ValidationError represents a URL validation error with specific type information
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
type ValidationOptions ¶
type ValidationOptions struct {
AllowPrivateNetworks bool
AllowLocalhost bool
RequireHTTPS bool
MaxHostnameLength int
Timeout time.Duration
}
ValidationOptions configures URL validation behavior
func DefaultValidationOptions ¶
func DefaultValidationOptions() ValidationOptions
DefaultValidationOptions returns secure defaults for URL validation
Click to show internal directories.
Click to hide internal directories.