validate

package
v0.0.0-...-598a1f7 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: AGPL-3.0, MIT Imports: 3 Imported by: 0

Documentation

Overview

Package validate provides methods for validating params passed from the database row as interface{} types

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Boolean

func Boolean(param interface{}) bool

Boolean returns the bool value of param or false

func Float

func Float(param interface{}) float64

Float returns the float value of param or 0.0

func Int

func Int(param interface{}) int64

Int returns the int value of param or 0

func Length

func Length(param string, min int, max int) error

Length validates a param by min and max length

func String

func String(param interface{}) string

String returns the string value of param or ""

func Time

func Time(param interface{}) time.Time

Time returns the time value of param or the zero value of time.Time

func Within

func Within(param string, min float64, max float64) error

Within returns true if the param is an int with value between min and max inclusive Set min or max to -1 to ignore

Types

This section is empty.

Jump to

Keyboard shortcuts

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