validation

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package validation provides functionality for validating various types of data, including URLs.

This package includes several validation functions to ensure that input data adheres to defined formats and constraints. Specifically, it provides the following validation functions:

  • ValidateURL: Validates that a given URL is well-formed according to HTTP or HTTPS schemes and checks that it has a valid host component.

  • Validate: A generic function that checks if a provided value exists within a list of valid options, applicable to any comparable type.

The purpose of this package is to enhance the robustness and reliability of the application by enforcing input validation rules across various components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate[T comparable](value T, validOptions []T) error

Validate checks if the provided value is in the list of valid options.

func ValidateURL

func ValidateURL(rawURL string) error

ValidateURL checks if the given URL is valid based on valid HTTP/HTTPS schemes and if it has a non-empty host.

Types

This section is empty.

Jump to

Keyboard shortcuts

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