Documentation ¶
Overview ¶
Package valid is a robust and extensible validation library.
This package handle data and input validation in Go applications.
Index ¶
Constants ¶
View Source
const ( // LocaleFR constant variable for fr locale LocaleFR = "fr" // DriverPostgres postgres driver for database connection DriverPostgres = "postgres" // DriverMysql mysql driver for database connection DriverMysql = "mysql" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct { Host string Port int Name string Username string Password string Driver string SSLMode string }
Database configuration
type Validator ¶
type Validator interface { // ValidateStruct performs validation on struct. // It takes struct pointer as parameter. ValidateStruct(elem any) map[string]any // RequestStruct takes struct pointer as parameter. RequestStruct(elem any) Validator // ValidateRequest performs validation on in coming request. // It is a middleware that takes http.Handler as parameter and return http.Handler. ValidateRequest(next http.Handler) http.Handler // ValidateMap performs validation on map. // It takes map pointer as parameter. ValidateMap(elem map[string]any, rule map[string]string, message ...map[string]string) map[string]any }
Click to show internal directories.
Click to hide internal directories.