uent

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxNormalNameLength = 300
	MinNameLen          = 2
	MinPhoneLen         = 9
	EmailRegex          = regexp.MustCompile(`[A-Za-z0-9\._%+\-]+@[A-Za-z0-9\.\-]+\.[A-Za-z]{2,}`)
	PhoneRegex          = regexp.MustCompile(`^\+?\d+$`)
	CreatedTableName    = "created_at"
	PasswordTableName   = "passowrd"
	PhoneTableName      = "phone"
)

Functions

func Created_at

func Created_at() ent.Field

return a field `created_at`. Configure name with CreatedTableName

func Email

func Email() ent.Field

return a field named `email`. Configure name with `EmailTableName` and Regex with `EmailRegex`

func NonNegative

func NonNegative(n string) ent.Field

return a non negative integer field

func Passowrd

func Passowrd() ent.Field

return a field `password`. Configure name with `CreatedTableName` and Regex with PassRegex

func Phone

func Phone() ent.Field

return a field named `phone`. Configure name with `PhoneTableName` and Regex with `PhoneRegex`

func String

func String(n string) ent.Field

return a string field with `n` name and `MinNameLen` minimum length

func StringOneOf

func StringOneOf(n string, l []string) ent.Field

return a string field with `n` name and `MinNameLen` minimum length, must be one of the ones in `l`

Types

This section is empty.

Jump to

Keyboard shortcuts

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