validate

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 10 Imported by: 4 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package validate is a light wrapper around the validator library that configures it for english translation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyVal added in v0.8.0

func KeyVal(key string, value any, rules string) (err error)

KeyVal validates the key/value pair using rules.

func RegisterValidation added in v0.8.0

func RegisterValidation(tag string, translation string, fn validator.Func)

RegisterValidation adds a custom validation function and translation message for the given tag name.

func Struct

func Struct(data any) error

Struct validates a struct using tag style validation.

func Var

func Var(value any, rules string) error

Var validates a single value using rules.

Types

This section is empty.

Jump to

Keyboard shortcuts

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