enum

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckColor

func CheckColor(field string, value string) (errs []error)

CheckColor returns an error if the value is not a valid hex color

func CheckCurrency

func CheckCurrency(field string, value string) (errs []error)

CheckCurrency returns an error if the value is not a known currency

func CheckEmail

func CheckEmail(field string, value string) (errs []error)

CheckEmail returns an error if the value is not a reasonably valid email address

func CheckInArray added in v0.10.0

func CheckInArray(field string, value string, values ...string) []error

CheckInArray returns an error if the value is not in the set of provided values.

func CheckInArrayInt added in v0.10.0

func CheckInArrayInt(field string, value int, values ...int) []error

CheckInArrayInt returns an error if the value is not in the set of provided values.

func CheckInsideRange

func CheckInsideRange(field string, value float64, min float64, max float64) (errs []error)

CheckInsideRange returns an error if the value is outside of the specified range

func CheckInsideRangeInt

func CheckInsideRangeInt(field string, value int, min int, max int) (errs []error)

CheckInsideRangeInt returns an error if the value is outside of the specified range

func CheckLanguage

func CheckLanguage(field string, value string) (errs []error)

CheckLanguage returns an error if the value is not a known language

func CheckPositive

func CheckPositive(field string, value float64) (errs []error)

CheckPositive returns an error if the value is non-negative

func CheckPositiveInt

func CheckPositiveInt(field string, value int) (errs []error)

CheckPositiveInt returns an error if the value is non-negative

func CheckPresent

func CheckPresent(field string, value string) (errs []error)

CheckPresent returns an error if a string is empty

func CheckTimezone

func CheckTimezone(field string, value string) (errs []error)

CheckTimezone returns an error if the value is not a known timezone

func CheckURL

func CheckURL(field string, value string) (errs []error)

CheckURL returns an error if the value is not a reasonably valid url

func IsValidColor

func IsValidColor(color string) bool

IsValidColor check is valid color

func IsValidCurrency

func IsValidCurrency(value string) bool

IsValidCurrency check is valid currency

func IsValidEmail

func IsValidEmail(email string) bool

IsValidEmail check if valid email

func IsValidLang

func IsValidLang(value string) bool

IsValidLang check is valid language

func IsValidTimezone

func IsValidTimezone(value string) (string, bool)

IsValidTimezone check is valid timezone

func IsValidURL

func IsValidURL(url string) bool

IsValidURL check is valid url

Types

type RouteType

type RouteType struct {
	Code     int
	Name     string
	Category string
	Parent   int
}

RouteType contains details on each possible route_type

func GetBasicRouteType

func GetBasicRouteType(code int) (RouteType, bool)

GetBasicRouteType returns the closest approximate basic route_type for an extended route_type.

func GetRouteType

func GetRouteType(code int) (RouteType, bool)

GetRouteType returns the details for a given route_type value.

Jump to

Keyboard shortcuts

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