validation

package
v4.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MinNameLength is the minimal length of a name
	MinNameLength = 2
	// MaxNameLength is the maximal length of a name
	MaxNameLength = 255
	// MaxSQLIdentifierLength is the max length of a sql name
	// that we can support
	MaxSQLIdentifierLength = 63
)

Variables

View Source
var JobCronFormat = cron.Minute |
	cron.Hour |
	cron.Dom |
	cron.Month |
	cron.Dow |
	cron.Descriptor

JobCronFormat is the default allowed CRON formatting options, allowing granularity down to the minute and the shorthand descriptions like @hourly

Functions

func CronTab

func CronTab(value string) error

CronTab returns true if the string is a cron tab expression

func Name

func Name(value string) error

Name returns an error if the name value is not valid

func NotEmpty

func NotEmpty(value string) error

NotEmpty checks if the value is not empty

func SQLIdentifier

func SQLIdentifier(value string) error

SQLIdentifier returns an error if the string value can't be used as a SQL identifier

func SQLNameOrUUID

func SQLNameOrUUID(value string) (err error)

SQLNameOrUUID returns an error if the given value can not be a name or UUID

func URL

func URL(value string) error

URL returns an error if the URL value is not valid

func UUID

func UUID(value string) error

UUID returns an error if the UUID value is not valid

func UUIDs

func UUIDs(values []string) error

UUIDs returns an error if one of the UUID values is not valid

Types

This section is empty.

Jump to

Keyboard shortcuts

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