is

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package is provides format validation rules for common string patterns.

Each function returns a value satisfying edict.Rule and edict.Coder. Use with Apply():

v.Field("email").Apply(is.Email())
v.Field("site").Apply(is.URL())

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rule

type Rule interface {
	Validate(value any) error
}

Rule is the interface satisfied by all format validators in this package. It matches edict.Rule via structural typing.

func Alpha

func Alpha() Rule

Alpha returns a Rule that validates the value contains only ASCII letters.

func AlphaNumeric

func AlphaNumeric() Rule

AlphaNumeric returns a Rule that validates the value contains only ASCII letters and digits.

func Email

func Email() Rule

Email returns a Rule that validates email address format.

func HexColor

func HexColor() Rule

HexColor returns a Rule that validates hex color format (#RGB or #RRGGBB).

func IPv4

func IPv4() Rule

IPv4 returns a Rule that validates IPv4 address format.

func IPv6

func IPv6() Rule

IPv6 returns a Rule that validates IPv6 address format.

func Numeric

func Numeric() Rule

Numeric returns a Rule that validates the value contains only ASCII digits.

func Semver

func Semver() Rule

Semver returns a Rule that validates semantic versioning format (X.Y.Z with optional v prefix).

func Slug

func Slug() Rule

Slug returns a Rule that validates URL slug format (lowercase alphanumeric with hyphens).

func URL

func URL() Rule

URL returns a Rule that validates URL format (requires scheme and host).

func UUID

func UUID() Rule

UUID returns a Rule that validates UUID format (8-4-4-4-12 hex).

Jump to

Keyboard shortcuts

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