Skip to content

constraint.NetIsURI

marrow16 edited this page Oct 22, 2022 · 4 revisions

Prev Home Next

Constraint: NetIsURI

Description

Check that string value is a valid URI

V8n Tag Abbreviation

isURI

Fields

Field Type Description
CheckHost bool if set, the host is also checked
AllowIPAddress bool when set, allows IP address hostnames
AllowIPV6 bool when set, allows IP v6 address hostnames
AllowLocal bool when set, allows hostnames 'local' (e.g. "localhost", "local", "localdomain", "127.0.0.1", "::1")
AllowTldOnly bool when set, allows hostnames with only Tld specified (e.g. "audi")
AllowGeographicTlds bool when set, allows hostnames with geographic Tlds (e.g. "some-company.africa")
AllowGenericTlds bool when set, allows hostnames with generic Tlds (e.g. "some.academy")
AllowBrandTlds bool when set, allows hostnames with brand Tlds (e.g. "my.audi")
AllowInfraTlds bool when set, allows hostnames with infrastructure Tlds (e.g. "arpa")
AllowTestTlds bool when set, allows hostnames with test Tlds and test domains (e.g. "example.com", "test.com")
AddCountryCodeTlds []string is an optional slice of additional country (and geographic) Tlds to allow
ExcCountryCodeTlds []string is an optional slice of country (and geographic) Tlds to disallow
AddGenericTlds []string is an optional slice of additional generic Tlds to allow (only checked if AllowGenericTlds is also set)
ExcGenericTlds []string is an optional slice of generic Tlds to disallow (only relevant if AllowGenericTlds is also set)
AddBrandTlds []string is an optional slice of additional brand Tlds to allow (only checked if AllowBrandTlds is also set)
ExcBrandTlds []string is an optional slice of brand Tlds to disallow (only relevant if AllowBrandTlds is also set)
AddLocalTlds []string is an optional slice of additional local Tlds to allow (only checked if AllowLocal is also set)
ExcLocalTlds []string is an optional slice of local Tlds to disallow (only relevant if AllowLocal is also set)
Message string the violation message to be used if the constraint fails. If empty, the default message is used
Stop bool when set to true, Stop prevents further validation checks on the property if this constraint fails

Examples

Clone this wiki locally