package
Version:
v0.0.0-...-a11cca7
Opens a new window with list of versions in this module.
Published: Jan 18, 2024
License: AGPL-3.0, MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package validate provides methods for validating params passed from the database row as interface{} types
func Boolean(param interface{}) bool
Boolean returns the bool value of param or false
func Float(param interface{}) float64
Float returns the float value of param or 0.0
func Int(param interface{}) int64
Int returns the int value of param or 0
Length validates a param by min and max length
func String(param interface{}) string
String returns the string value of param or ""
Time returns the time value of param or the zero value of time.Time
Within returns true if the param is an int with value between min and max inclusive
Set min or max to -1 to ignore
Source Files
¶
Click to show internal directories.
Click to hide internal directories.