valid

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: MIT Imports: 7 Imported by: 0

README

valid

build Go report codecov Documentation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Directory

func Directory() validation.Rule

Directory checks if validatable value is valid path to directory.

func File

func File() validation.Rule

File checks if validatable value is valid path to file.

func IPRange

func IPRange() validation.Rule

IPRange checks if validatable value is valid IPv4 or IPv6 range. Can be in one of the following forms: - Single address. Examples: `192.168.1.1`, `2001:db8:a0b:12f0::1` - CIDR. Examples: `192.168.1.0/24`, `2001:db8:a0b:12f0::1` - Begin_End. Examples: `192.168.1.10_192.168.2.20`, `2001:db8:a0b:12f0::1_2001:db8:a0b:12f0::10` - Octets ranges: `192.168.1,3-5.1-10`, `2001:db8:a0b:12f0::1,1-10`

func OneOf

func OneOf(values []string, caseSensetive bool) validation.Rule

OneOf checks if validatable value is present among the provided values. If second argument is true case sensitive comparison will be used.

func Regexp

func Regexp() validation.Rule

Regexp checks if validatable value is valid regular expression.

Types

This section is empty.

Jump to

Keyboard shortcuts

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