Help us shape the future of Go! Take the 2026 Go Developer Survey

validate

package
v0.65.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MajorMinorVersionRegex = `^\d+\.\d+?$`
	FullVersionRegex       = `^\d+\.\d+.\d+?$`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Validator

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

func CIDR added in v0.6.0

func CIDR() *Validator

func FileExists added in v0.38.0

func FileExists() *Validator

func IP

func IP(allowZeroAddress bool) *Validator

IP returns a validator that checks, if the given string is a valid IP address. The allowZeroAddress parameter defines, if 0.0.0.0, resp. [::] should be considered valid.

func MinorVersionNumber

func MinorVersionNumber() *Validator

func NoSeparator

func NoSeparator() *Validator

func NonLegacyProjectRole added in v0.26.0

func NonLegacyProjectRole() *Validator

func RFC3339SecondsOnly added in v0.4.0

func RFC3339SecondsOnly() *Validator

func RecordSet added in v0.13.0

func RecordSet() *Validator

func Rrule added in v0.21.0

func Rrule() *Validator

func UUID

func UUID() *Validator

func ValidDurationString added in v0.47.0

func ValidDurationString() *Validator

func ValidNoTrailingNewline added in v0.52.0

func ValidNoTrailingNewline() *Validator

ValidNoTrailingNewline returns a Validator that checks if the input string has no trailing newline character ("\n" or "\r\n"). If a trailing newline is present, a diagnostic error will be appended.

func VersionNumber added in v0.18.0

func VersionNumber() *Validator

func (*Validator) Description

func (v *Validator) Description(_ context.Context) string

func (*Validator) MarkdownDescription

func (v *Validator) MarkdownDescription(_ context.Context) string

func (*Validator) ValidateString

func (v *Validator) ValidateString(ctx context.Context, req validator.StringRequest, resp *validator.StringResponse)

Jump to

Keyboard shortcuts

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