validate

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 10 Imported by: 0

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