rule

package
v3.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GlobalRules

func GlobalRules(db *gorm.DB)

Types

type Cron

type Cron struct {
	// contains filtered or unexported fields
}

Cron 校验规则

func NewCron

func NewCron() *Cron

func (*Cron) Passes

func (s *Cron) Passes(val any, options ...any) bool

type Exists

type Exists struct {
	// contains filtered or unexported fields
}

Exists 验证一个值在某个表中的字段中存在,支持同时判断多个字段 Exists verify a value exists in a table field, support judging multiple fields at the same time 用法:exists:表名称,字段名称,字段名称,字段名称 Usage: exists:table_name,field_name,field_name,field_name 例子:exists:users,phone,email Example: exists:users,phone,email

func NewExists

func NewExists(db *gorm.DB) *Exists

func (*Exists) Passes

func (r *Exists) Passes(val any, options ...any) bool

type IPCIDR

type IPCIDR struct{}

IPCIDR 验证一个值是否是一个有效的 IP 或 CIDR 格式

func NewIPCIDR

func NewIPCIDR() *IPCIDR

func (*IPCIDR) Passes

func (r *IPCIDR) Passes(val any, options ...any) bool

type NotExists

type NotExists struct {
	// contains filtered or unexported fields
}

NotExists 验证一个值在某个表中的字段中不存在,支持同时判断多个字段 NotExists verify a value does not exist in a table field, support judging multiple fields at the same time 用法:notExists:表名称,字段名称,字段名称,字段名称 Usage: notExists:table_name,field_name,field_name,field_name 例子:notExists:users,phone,email Example: notExists:users,phone,email

func NewNotExists

func NewNotExists(db *gorm.DB) *NotExists

func (*NotExists) Passes

func (r *NotExists) Passes(val any, options ...any) bool

type Password

type Password struct{}

Password 密码复杂度校验

func NewPassword

func NewPassword() *Password

func (*Password) Passes

func (r *Password) Passes(val any, options ...any) bool

Jump to

Keyboard shortcuts

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