Documentation
¶
Overview ¶
Package validation provides typed, fluent validation of application values. Rules run only during Validate or ValidateContext. Evaluation collects the first violation per field by default, in declaration order. Validator configures broader collection, global stopping, and message formatting. Unexpected rule errors abort evaluation and remain operational errors rather than client-facing messages.
Builders can be branched and reused without sharing evaluation state. Slices and application dependencies are borrowed; callers must not mutate inputs during evaluation and must coordinate any state used by custom rules.
Index ¶
- func Validate(fields ...Field) error
- func ValidateContext(ctx context.Context, fields ...Field) error
- type BoolField
- func (b BoolField[T]) Accepted() BoolField[T]
- func (b BoolField[T]) Check(check func(context.Context, T) error) BoolField[T]
- func (b BoolField[T]) Equal(other T) BoolField[T]
- func (b BoolField[T]) Label(label string) BoolField[T]
- func (b BoolField[T]) Message(message string) BoolField[T]
- func (b BoolField[T]) Using(rule Rule[T]) BoolField[T]
- type ConfigurationError
- type ContextRuleFunc
- type CurrencyCode
- type CurrencyField
- func (b CurrencyField[T]) AED() CurrencyField[T]
- func (b CurrencyField[T]) AFN() CurrencyField[T]
- func (b CurrencyField[T]) ALL() CurrencyField[T]
- func (b CurrencyField[T]) AMD() CurrencyField[T]
- func (b CurrencyField[T]) AOA() CurrencyField[T]
- func (b CurrencyField[T]) ARS() CurrencyField[T]
- func (b CurrencyField[T]) AUD() CurrencyField[T]
- func (b CurrencyField[T]) AWG() CurrencyField[T]
- func (b CurrencyField[T]) AZN() CurrencyField[T]
- func (b CurrencyField[T]) BAM() CurrencyField[T]
- func (b CurrencyField[T]) BBD() CurrencyField[T]
- func (b CurrencyField[T]) BDT() CurrencyField[T]
- func (b CurrencyField[T]) BHD() CurrencyField[T]
- func (b CurrencyField[T]) BIF() CurrencyField[T]
- func (b CurrencyField[T]) BMD() CurrencyField[T]
- func (b CurrencyField[T]) BND() CurrencyField[T]
- func (b CurrencyField[T]) BOB() CurrencyField[T]
- func (b CurrencyField[T]) BOV() CurrencyField[T]
- func (b CurrencyField[T]) BRL() CurrencyField[T]
- func (b CurrencyField[T]) BSD() CurrencyField[T]
- func (b CurrencyField[T]) BTN() CurrencyField[T]
- func (b CurrencyField[T]) BWP() CurrencyField[T]
- func (b CurrencyField[T]) BYN() CurrencyField[T]
- func (b CurrencyField[T]) BZD() CurrencyField[T]
- func (b CurrencyField[T]) CAD() CurrencyField[T]
- func (b CurrencyField[T]) CDF() CurrencyField[T]
- func (b CurrencyField[T]) CHE() CurrencyField[T]
- func (b CurrencyField[T]) CHF() CurrencyField[T]
- func (b CurrencyField[T]) CHW() CurrencyField[T]
- func (b CurrencyField[T]) CLF() CurrencyField[T]
- func (b CurrencyField[T]) CLP() CurrencyField[T]
- func (b CurrencyField[T]) CNY() CurrencyField[T]
- func (b CurrencyField[T]) COP() CurrencyField[T]
- func (b CurrencyField[T]) COU() CurrencyField[T]
- func (b CurrencyField[T]) CRC() CurrencyField[T]
- func (b CurrencyField[T]) CUP() CurrencyField[T]
- func (b CurrencyField[T]) CVE() CurrencyField[T]
- func (b CurrencyField[T]) CZK() CurrencyField[T]
- func (b CurrencyField[T]) Check(check func(context.Context, T) error) CurrencyField[T]
- func (b CurrencyField[T]) DJF() CurrencyField[T]
- func (b CurrencyField[T]) DKK() CurrencyField[T]
- func (b CurrencyField[T]) DOP() CurrencyField[T]
- func (b CurrencyField[T]) DZD() CurrencyField[T]
- func (b CurrencyField[T]) EGP() CurrencyField[T]
- func (b CurrencyField[T]) ERN() CurrencyField[T]
- func (b CurrencyField[T]) ETB() CurrencyField[T]
- func (b CurrencyField[T]) EUR() CurrencyField[T]
- func (b CurrencyField[T]) FJD() CurrencyField[T]
- func (b CurrencyField[T]) FKP() CurrencyField[T]
- func (b CurrencyField[T]) GBP() CurrencyField[T]
- func (b CurrencyField[T]) GEL() CurrencyField[T]
- func (b CurrencyField[T]) GHS() CurrencyField[T]
- func (b CurrencyField[T]) GIP() CurrencyField[T]
- func (b CurrencyField[T]) GMD() CurrencyField[T]
- func (b CurrencyField[T]) GNF() CurrencyField[T]
- func (b CurrencyField[T]) GTQ() CurrencyField[T]
- func (b CurrencyField[T]) GYD() CurrencyField[T]
- func (b CurrencyField[T]) HKD() CurrencyField[T]
- func (b CurrencyField[T]) HNL() CurrencyField[T]
- func (b CurrencyField[T]) HTG() CurrencyField[T]
- func (b CurrencyField[T]) HUF() CurrencyField[T]
- func (b CurrencyField[T]) IDR() CurrencyField[T]
- func (b CurrencyField[T]) ILS() CurrencyField[T]
- func (b CurrencyField[T]) INR() CurrencyField[T]
- func (b CurrencyField[T]) IQD() CurrencyField[T]
- func (b CurrencyField[T]) IRR() CurrencyField[T]
- func (b CurrencyField[T]) ISK() CurrencyField[T]
- func (b CurrencyField[T]) JMD() CurrencyField[T]
- func (b CurrencyField[T]) JOD() CurrencyField[T]
- func (b CurrencyField[T]) JPY() CurrencyField[T]
- func (b CurrencyField[T]) KES() CurrencyField[T]
- func (b CurrencyField[T]) KGS() CurrencyField[T]
- func (b CurrencyField[T]) KHR() CurrencyField[T]
- func (b CurrencyField[T]) KMF() CurrencyField[T]
- func (b CurrencyField[T]) KPW() CurrencyField[T]
- func (b CurrencyField[T]) KRW() CurrencyField[T]
- func (b CurrencyField[T]) KWD() CurrencyField[T]
- func (b CurrencyField[T]) KYD() CurrencyField[T]
- func (b CurrencyField[T]) KZT() CurrencyField[T]
- func (b CurrencyField[T]) LAK() CurrencyField[T]
- func (b CurrencyField[T]) LBP() CurrencyField[T]
- func (b CurrencyField[T]) LKR() CurrencyField[T]
- func (b CurrencyField[T]) LRD() CurrencyField[T]
- func (b CurrencyField[T]) LSL() CurrencyField[T]
- func (b CurrencyField[T]) LYD() CurrencyField[T]
- func (b CurrencyField[T]) Label(label string) CurrencyField[T]
- func (b CurrencyField[T]) MAD() CurrencyField[T]
- func (b CurrencyField[T]) MDL() CurrencyField[T]
- func (b CurrencyField[T]) MGA() CurrencyField[T]
- func (b CurrencyField[T]) MKD() CurrencyField[T]
- func (b CurrencyField[T]) MMK() CurrencyField[T]
- func (b CurrencyField[T]) MNT() CurrencyField[T]
- func (b CurrencyField[T]) MOP() CurrencyField[T]
- func (b CurrencyField[T]) MRU() CurrencyField[T]
- func (b CurrencyField[T]) MUR() CurrencyField[T]
- func (b CurrencyField[T]) MVR() CurrencyField[T]
- func (b CurrencyField[T]) MWK() CurrencyField[T]
- func (b CurrencyField[T]) MXN() CurrencyField[T]
- func (b CurrencyField[T]) MXV() CurrencyField[T]
- func (b CurrencyField[T]) MYR() CurrencyField[T]
- func (b CurrencyField[T]) MZN() CurrencyField[T]
- func (b CurrencyField[T]) Message(message string) CurrencyField[T]
- func (b CurrencyField[T]) NAD() CurrencyField[T]
- func (b CurrencyField[T]) NGN() CurrencyField[T]
- func (b CurrencyField[T]) NIO() CurrencyField[T]
- func (b CurrencyField[T]) NOK() CurrencyField[T]
- func (b CurrencyField[T]) NPR() CurrencyField[T]
- func (b CurrencyField[T]) NZD() CurrencyField[T]
- func (b CurrencyField[T]) OMR() CurrencyField[T]
- func (b CurrencyField[T]) PAB() CurrencyField[T]
- func (b CurrencyField[T]) PEN() CurrencyField[T]
- func (b CurrencyField[T]) PGK() CurrencyField[T]
- func (b CurrencyField[T]) PHP() CurrencyField[T]
- func (b CurrencyField[T]) PKR() CurrencyField[T]
- func (b CurrencyField[T]) PLN() CurrencyField[T]
- func (b CurrencyField[T]) PYG() CurrencyField[T]
- func (b CurrencyField[T]) QAR() CurrencyField[T]
- func (b CurrencyField[T]) RON() CurrencyField[T]
- func (b CurrencyField[T]) RSD() CurrencyField[T]
- func (b CurrencyField[T]) RUB() CurrencyField[T]
- func (b CurrencyField[T]) RWF() CurrencyField[T]
- func (b CurrencyField[T]) Required() CurrencyField[T]
- func (b CurrencyField[T]) RequiredIf(condition bool) CurrencyField[T]
- func (b CurrencyField[T]) SAR() CurrencyField[T]
- func (b CurrencyField[T]) SBD() CurrencyField[T]
- func (b CurrencyField[T]) SCR() CurrencyField[T]
- func (b CurrencyField[T]) SDG() CurrencyField[T]
- func (b CurrencyField[T]) SEK() CurrencyField[T]
- func (b CurrencyField[T]) SGD() CurrencyField[T]
- func (b CurrencyField[T]) SHP() CurrencyField[T]
- func (b CurrencyField[T]) SLE() CurrencyField[T]
- func (b CurrencyField[T]) SOS() CurrencyField[T]
- func (b CurrencyField[T]) SRD() CurrencyField[T]
- func (b CurrencyField[T]) SSP() CurrencyField[T]
- func (b CurrencyField[T]) STN() CurrencyField[T]
- func (b CurrencyField[T]) SVC() CurrencyField[T]
- func (b CurrencyField[T]) SYP() CurrencyField[T]
- func (b CurrencyField[T]) SZL() CurrencyField[T]
- func (b CurrencyField[T]) THB() CurrencyField[T]
- func (b CurrencyField[T]) TJS() CurrencyField[T]
- func (b CurrencyField[T]) TMT() CurrencyField[T]
- func (b CurrencyField[T]) TND() CurrencyField[T]
- func (b CurrencyField[T]) TOP() CurrencyField[T]
- func (b CurrencyField[T]) TRY() CurrencyField[T]
- func (b CurrencyField[T]) TTD() CurrencyField[T]
- func (b CurrencyField[T]) TWD() CurrencyField[T]
- func (b CurrencyField[T]) TZS() CurrencyField[T]
- func (b CurrencyField[T]) UAH() CurrencyField[T]
- func (b CurrencyField[T]) UGX() CurrencyField[T]
- func (b CurrencyField[T]) USD() CurrencyField[T]
- func (b CurrencyField[T]) USN() CurrencyField[T]
- func (b CurrencyField[T]) UYI() CurrencyField[T]
- func (b CurrencyField[T]) UYU() CurrencyField[T]
- func (b CurrencyField[T]) UYW() CurrencyField[T]
- func (b CurrencyField[T]) UZS() CurrencyField[T]
- func (b CurrencyField[T]) Using(rule Rule[T]) CurrencyField[T]
- func (b CurrencyField[T]) VED() CurrencyField[T]
- func (b CurrencyField[T]) VES() CurrencyField[T]
- func (b CurrencyField[T]) VND() CurrencyField[T]
- func (b CurrencyField[T]) VUV() CurrencyField[T]
- func (b CurrencyField[T]) WST() CurrencyField[T]
- func (b CurrencyField[T]) XAD() CurrencyField[T]
- func (b CurrencyField[T]) XAF() CurrencyField[T]
- func (b CurrencyField[T]) XAG() CurrencyField[T]
- func (b CurrencyField[T]) XAU() CurrencyField[T]
- func (b CurrencyField[T]) XBA() CurrencyField[T]
- func (b CurrencyField[T]) XBB() CurrencyField[T]
- func (b CurrencyField[T]) XBC() CurrencyField[T]
- func (b CurrencyField[T]) XBD() CurrencyField[T]
- func (b CurrencyField[T]) XCD() CurrencyField[T]
- func (b CurrencyField[T]) XCG() CurrencyField[T]
- func (b CurrencyField[T]) XDR() CurrencyField[T]
- func (b CurrencyField[T]) XOF() CurrencyField[T]
- func (b CurrencyField[T]) XPD() CurrencyField[T]
- func (b CurrencyField[T]) XPF() CurrencyField[T]
- func (b CurrencyField[T]) XPT() CurrencyField[T]
- func (b CurrencyField[T]) XSU() CurrencyField[T]
- func (b CurrencyField[T]) XTS() CurrencyField[T]
- func (b CurrencyField[T]) XUA() CurrencyField[T]
- func (b CurrencyField[T]) XXX() CurrencyField[T]
- func (b CurrencyField[T]) YER() CurrencyField[T]
- func (b CurrencyField[T]) ZAR() CurrencyField[T]
- func (b CurrencyField[T]) ZMW() CurrencyField[T]
- func (b CurrencyField[T]) ZWG() CurrencyField[T]
- type DecimalField
- func (b DecimalField[T]) Check(check func(context.Context, T) error) DecimalField[T]
- func (b DecimalField[T]) Equal(other T) DecimalField[T]
- func (b DecimalField[T]) GreaterThan(other T) DecimalField[T]
- func (b DecimalField[T]) Label(label string) DecimalField[T]
- func (b DecimalField[T]) LessThan(other T) DecimalField[T]
- func (b DecimalField[T]) Max(max T) DecimalField[T]
- func (b DecimalField[T]) MaxScale(max int) DecimalField[T]
- func (b DecimalField[T]) Message(message string) DecimalField[T]
- func (b DecimalField[T]) Min(min T) DecimalField[T]
- func (b DecimalField[T]) Required() DecimalField[T]
- func (b DecimalField[T]) RequiredIf(condition bool) DecimalField[T]
- func (b DecimalField[T]) Using(rule Rule[T]) DecimalField[T]
- type Errors
- type Field
- type Input
- type Issue
- type MapField
- func (b MapField[T]) Check(check func(context.Context, map[string]T) error) MapField[T]
- func (b MapField[T]) Each(fields func(string, T) []Field) MapField[T]
- func (b MapField[T]) HasKey(key string) MapField[T]
- func (b MapField[T]) Label(label string) MapField[T]
- func (b MapField[T]) Len(length int) MapField[T]
- func (b MapField[T]) Max(max int) MapField[T]
- func (b MapField[T]) Message(message string) MapField[T]
- func (b MapField[T]) Min(min int) MapField[T]
- func (b MapField[T]) OnlyKeys(keys ...string) MapField[T]
- func (b MapField[T]) Required() MapField[T]
- func (b MapField[T]) RequiredIf(condition bool) MapField[T]
- func (b MapField[T]) Using(rule Rule[map[string]T]) MapField[T]
- type NumberField
- func (b NumberField[T]) Check(check func(context.Context, T) error) NumberField[T]
- func (b NumberField[T]) Equal(other T) NumberField[T]
- func (b NumberField[T]) GreaterThan(other T) NumberField[T]
- func (b NumberField[T]) In(values ...T) NumberField[T]
- func (b NumberField[T]) Label(label string) NumberField[T]
- func (b NumberField[T]) LessThan(other T) NumberField[T]
- func (b NumberField[T]) Max(max T) NumberField[T]
- func (b NumberField[T]) Message(message string) NumberField[T]
- func (b NumberField[T]) Min(min T) NumberField[T]
- func (b NumberField[T]) MultipleOf(divisor T) NumberField[T]
- func (b NumberField[T]) NotEqual(other T) NumberField[T]
- func (b NumberField[T]) NotIn(values ...T) NumberField[T]
- func (b NumberField[T]) Using(rule Rule[T]) NumberField[T]
- type Numeric
- type PresenceField
- func (b PresenceField[T]) Label(label string) PresenceField[T]
- func (b PresenceField[T]) Message(message string) PresenceField[T]
- func (b PresenceField[T]) Nullable() PresenceField[T]
- func (b PresenceField[T]) Required() PresenceField[T]
- func (b PresenceField[T]) RequiredIf(condition bool) PresenceField[T]
- type Rule
- type RuleFunc
- type RuleWithContext
- type SliceField
- func (b SliceField[T]) Check(check func(context.Context, []T) error) SliceField[T]
- func (b SliceField[T]) Contains(target T) SliceField[T]
- func (b SliceField[T]) Each(fields func(T) []Field) SliceField[T]
- func (b SliceField[T]) Label(label string) SliceField[T]
- func (b SliceField[T]) Len(length int) SliceField[T]
- func (b SliceField[T]) Max(max int) SliceField[T]
- func (b SliceField[T]) Message(message string) SliceField[T]
- func (b SliceField[T]) Min(min int) SliceField[T]
- func (b SliceField[T]) NotContains(target T) SliceField[T]
- func (b SliceField[T]) Required() SliceField[T]
- func (b SliceField[T]) RequiredIf(condition bool) SliceField[T]
- func (b SliceField[T]) Unique() SliceField[T]
- func (b SliceField[T]) Using(rule Rule[[]T]) SliceField[T]
- type StringField
- func (b StringField[T]) Check(check func(context.Context, T) error) StringField[T]
- func (b StringField[T]) Contains(text string) StringField[T]
- func (b StringField[T]) EndsWith(suffix string) StringField[T]
- func (b StringField[T]) Equal(other T) StringField[T]
- func (b StringField[T]) In(values ...T) StringField[T]
- func (b StringField[T]) IsASCII() StringField[T]
- func (b StringField[T]) IsAlpha() StringField[T]
- func (b StringField[T]) IsAlphanumeric() StringField[T]
- func (b StringField[T]) IsBase64() StringField[T]
- func (b StringField[T]) IsBase64URL() StringField[T]
- func (b StringField[T]) IsCIDR() StringField[T]
- func (b StringField[T]) IsDate(layout string) StringField[T]
- func (b StringField[T]) IsDateIn(layout string, location *time.Location) StringField[T]
- func (b StringField[T]) IsDigits() StringField[T]
- func (b StringField[T]) IsE164() StringField[T]
- func (b StringField[T]) IsEmail() StringField[T]
- func (b StringField[T]) IsHostname() StringField[T]
- func (b StringField[T]) IsIP() StringField[T]
- func (b StringField[T]) IsIPv4() StringField[T]
- func (b StringField[T]) IsIPv6() StringField[T]
- func (b StringField[T]) IsJSON() StringField[T]
- func (b StringField[T]) IsLowercase() StringField[T]
- func (b StringField[T]) IsMAC() StringField[T]
- func (b StringField[T]) IsULID() StringField[T]
- func (b StringField[T]) IsURL() StringField[T]
- func (b StringField[T]) IsUTF8() StringField[T]
- func (b StringField[T]) IsUUID() StringField[T]
- func (b StringField[T]) IsUUIDv4() StringField[T]
- func (b StringField[T]) IsUUIDv7() StringField[T]
- func (b StringField[T]) IsUppercase() StringField[T]
- func (b StringField[T]) Label(label string) StringField[T]
- func (b StringField[T]) Len(length int) StringField[T]
- func (b StringField[T]) Match(pattern *regexp.Regexp) StringField[T]
- func (b StringField[T]) Max(max int) StringField[T]
- func (b StringField[T]) Message(message string) StringField[T]
- func (b StringField[T]) Min(min int) StringField[T]
- func (b StringField[T]) NotBlank() StringField[T]
- func (b StringField[T]) NotContains(text string) StringField[T]
- func (b StringField[T]) NotEqual(other T) StringField[T]
- func (b StringField[T]) NotIn(values ...T) StringField[T]
- func (b StringField[T]) Required() StringField[T]
- func (b StringField[T]) RequiredIf(condition bool) StringField[T]
- func (b StringField[T]) StartsWith(prefix string) StringField[T]
- func (b StringField[T]) Using(rule Rule[T]) StringField[T]
- type TimeField
- func (b TimeField) After(other time.Time) TimeField
- func (b TimeField) Before(other time.Time) TimeField
- func (b TimeField) Check(check func(context.Context, time.Time) error) TimeField
- func (b TimeField) Equal(other time.Time) TimeField
- func (b TimeField) Label(label string) TimeField
- func (b TimeField) Max(max time.Time) TimeField
- func (b TimeField) Message(message string) TimeField
- func (b TimeField) Min(min time.Time) TimeField
- func (b TimeField) Required() TimeField
- func (b TimeField) RequiredIf(condition bool) TimeField
- func (b TimeField) Using(rule Rule[time.Time]) TimeField
- type Validator
- type ValueField
- type Violation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BoolField ¶
type BoolField[T ~bool] struct { // contains filtered or unexported fields }
BoolField is an immutable fluent chain for bool values.
func (BoolField[T]) Accepted ¶
Accepted requires true while ordinary boolean checks continue to accept false.
func (BoolField[T]) Label ¶
Label sets the human-readable field name without changing its output path.
type ConfigurationError ¶
ConfigurationError identifies a malformed chain or rule rather than invalid input.
func (*ConfigurationError) Error ¶
func (e *ConfigurationError) Error() string
Error describes the invalid rule configuration without printing submitted values.
type ContextRuleFunc ¶
ContextRuleFunc adapts a context-aware function into a reusable typed rule.
func (ContextRuleFunc[T]) Validate ¶
func (f ContextRuleFunc[T]) Validate(value T) error
Validate evaluates the rule with a background context.
func (ContextRuleFunc[T]) ValidateContext ¶
func (f ContextRuleFunc[T]) ValidateContext(ctx context.Context, value T) error
ValidateContext forwards the caller's context to the adapted function.
type CurrencyCode ¶ added in v0.2.0
type CurrencyCode string
CurrencyCode identifies a currency without attaching precision or monetary behavior. Package constants provide ISO 4217 identifiers; acceptance requires an explicit allowlist.
const ( // AED identifies the ISO 4217 AED code without prescribing monetary behavior. AED CurrencyCode = "AED" // AFN identifies the ISO 4217 AFN code without prescribing monetary behavior. AFN CurrencyCode = "AFN" // ALL identifies the ISO 4217 ALL code without prescribing monetary behavior. ALL CurrencyCode = "ALL" // AMD identifies the ISO 4217 AMD code without prescribing monetary behavior. AMD CurrencyCode = "AMD" // AOA identifies the ISO 4217 AOA code without prescribing monetary behavior. AOA CurrencyCode = "AOA" // ARS identifies the ISO 4217 ARS code without prescribing monetary behavior. ARS CurrencyCode = "ARS" // AUD identifies the ISO 4217 AUD code without prescribing monetary behavior. AUD CurrencyCode = "AUD" // AWG identifies the ISO 4217 AWG code without prescribing monetary behavior. AWG CurrencyCode = "AWG" // AZN identifies the ISO 4217 AZN code without prescribing monetary behavior. AZN CurrencyCode = "AZN" // BAM identifies the ISO 4217 BAM code without prescribing monetary behavior. BAM CurrencyCode = "BAM" // BBD identifies the ISO 4217 BBD code without prescribing monetary behavior. BBD CurrencyCode = "BBD" // BDT identifies the ISO 4217 BDT code without prescribing monetary behavior. BDT CurrencyCode = "BDT" // BHD identifies the ISO 4217 BHD code without prescribing monetary behavior. BHD CurrencyCode = "BHD" // BIF identifies the ISO 4217 BIF code without prescribing monetary behavior. BIF CurrencyCode = "BIF" // BMD identifies the ISO 4217 BMD code without prescribing monetary behavior. BMD CurrencyCode = "BMD" // BND identifies the ISO 4217 BND code without prescribing monetary behavior. BND CurrencyCode = "BND" // BOB identifies the ISO 4217 BOB code without prescribing monetary behavior. BOB CurrencyCode = "BOB" // BOV identifies the ISO 4217 BOV code without prescribing monetary behavior. BOV CurrencyCode = "BOV" // BRL identifies the ISO 4217 BRL code without prescribing monetary behavior. BRL CurrencyCode = "BRL" // BSD identifies the ISO 4217 BSD code without prescribing monetary behavior. BSD CurrencyCode = "BSD" // BTN identifies the ISO 4217 BTN code without prescribing monetary behavior. BTN CurrencyCode = "BTN" // BWP identifies the ISO 4217 BWP code without prescribing monetary behavior. BWP CurrencyCode = "BWP" // BYN identifies the ISO 4217 BYN code without prescribing monetary behavior. BYN CurrencyCode = "BYN" // BZD identifies the ISO 4217 BZD code without prescribing monetary behavior. BZD CurrencyCode = "BZD" // CAD identifies the ISO 4217 CAD code without prescribing monetary behavior. CAD CurrencyCode = "CAD" // CDF identifies the ISO 4217 CDF code without prescribing monetary behavior. CDF CurrencyCode = "CDF" // CHE identifies the ISO 4217 CHE code without prescribing monetary behavior. CHE CurrencyCode = "CHE" // CHF identifies the ISO 4217 CHF code without prescribing monetary behavior. CHF CurrencyCode = "CHF" // CHW identifies the ISO 4217 CHW code without prescribing monetary behavior. CHW CurrencyCode = "CHW" // CLF identifies the ISO 4217 CLF code without prescribing monetary behavior. CLF CurrencyCode = "CLF" // CLP identifies the ISO 4217 CLP code without prescribing monetary behavior. CLP CurrencyCode = "CLP" // CNY identifies the ISO 4217 CNY code without prescribing monetary behavior. CNY CurrencyCode = "CNY" // COP identifies the ISO 4217 COP code without prescribing monetary behavior. COP CurrencyCode = "COP" // COU identifies the ISO 4217 COU code without prescribing monetary behavior. COU CurrencyCode = "COU" // CRC identifies the ISO 4217 CRC code without prescribing monetary behavior. CRC CurrencyCode = "CRC" // CUP identifies the ISO 4217 CUP code without prescribing monetary behavior. CUP CurrencyCode = "CUP" // CVE identifies the ISO 4217 CVE code without prescribing monetary behavior. CVE CurrencyCode = "CVE" // CZK identifies the ISO 4217 CZK code without prescribing monetary behavior. CZK CurrencyCode = "CZK" // DJF identifies the ISO 4217 DJF code without prescribing monetary behavior. DJF CurrencyCode = "DJF" // DKK identifies the ISO 4217 DKK code without prescribing monetary behavior. DKK CurrencyCode = "DKK" // DOP identifies the ISO 4217 DOP code without prescribing monetary behavior. DOP CurrencyCode = "DOP" // DZD identifies the ISO 4217 DZD code without prescribing monetary behavior. DZD CurrencyCode = "DZD" // EGP identifies the ISO 4217 EGP code without prescribing monetary behavior. EGP CurrencyCode = "EGP" // ERN identifies the ISO 4217 ERN code without prescribing monetary behavior. ERN CurrencyCode = "ERN" // ETB identifies the ISO 4217 ETB code without prescribing monetary behavior. ETB CurrencyCode = "ETB" // EUR identifies the ISO 4217 EUR code without prescribing monetary behavior. EUR CurrencyCode = "EUR" // FJD identifies the ISO 4217 FJD code without prescribing monetary behavior. FJD CurrencyCode = "FJD" // FKP identifies the ISO 4217 FKP code without prescribing monetary behavior. FKP CurrencyCode = "FKP" // GBP identifies the ISO 4217 GBP code without prescribing monetary behavior. GBP CurrencyCode = "GBP" // GEL identifies the ISO 4217 GEL code without prescribing monetary behavior. GEL CurrencyCode = "GEL" // GHS identifies the ISO 4217 GHS code without prescribing monetary behavior. GHS CurrencyCode = "GHS" // GIP identifies the ISO 4217 GIP code without prescribing monetary behavior. GIP CurrencyCode = "GIP" // GMD identifies the ISO 4217 GMD code without prescribing monetary behavior. GMD CurrencyCode = "GMD" // GNF identifies the ISO 4217 GNF code without prescribing monetary behavior. GNF CurrencyCode = "GNF" // GTQ identifies the ISO 4217 GTQ code without prescribing monetary behavior. GTQ CurrencyCode = "GTQ" // GYD identifies the ISO 4217 GYD code without prescribing monetary behavior. GYD CurrencyCode = "GYD" // HKD identifies the ISO 4217 HKD code without prescribing monetary behavior. HKD CurrencyCode = "HKD" // HNL identifies the ISO 4217 HNL code without prescribing monetary behavior. HNL CurrencyCode = "HNL" // HTG identifies the ISO 4217 HTG code without prescribing monetary behavior. HTG CurrencyCode = "HTG" // HUF identifies the ISO 4217 HUF code without prescribing monetary behavior. HUF CurrencyCode = "HUF" // IDR identifies the ISO 4217 IDR code without prescribing monetary behavior. IDR CurrencyCode = "IDR" // ILS identifies the ISO 4217 ILS code without prescribing monetary behavior. ILS CurrencyCode = "ILS" // INR identifies the ISO 4217 INR code without prescribing monetary behavior. INR CurrencyCode = "INR" // IQD identifies the ISO 4217 IQD code without prescribing monetary behavior. IQD CurrencyCode = "IQD" // IRR identifies the ISO 4217 IRR code without prescribing monetary behavior. IRR CurrencyCode = "IRR" // ISK identifies the ISO 4217 ISK code without prescribing monetary behavior. ISK CurrencyCode = "ISK" // JMD identifies the ISO 4217 JMD code without prescribing monetary behavior. JMD CurrencyCode = "JMD" // JOD identifies the ISO 4217 JOD code without prescribing monetary behavior. JOD CurrencyCode = "JOD" // JPY identifies the ISO 4217 JPY code without prescribing monetary behavior. JPY CurrencyCode = "JPY" // KES identifies the ISO 4217 KES code without prescribing monetary behavior. KES CurrencyCode = "KES" // KGS identifies the ISO 4217 KGS code without prescribing monetary behavior. KGS CurrencyCode = "KGS" // KHR identifies the ISO 4217 KHR code without prescribing monetary behavior. KHR CurrencyCode = "KHR" // KMF identifies the ISO 4217 KMF code without prescribing monetary behavior. KMF CurrencyCode = "KMF" // KPW identifies the ISO 4217 KPW code without prescribing monetary behavior. KPW CurrencyCode = "KPW" // KRW identifies the ISO 4217 KRW code without prescribing monetary behavior. KRW CurrencyCode = "KRW" // KWD identifies the ISO 4217 KWD code without prescribing monetary behavior. KWD CurrencyCode = "KWD" // KYD identifies the ISO 4217 KYD code without prescribing monetary behavior. KYD CurrencyCode = "KYD" // KZT identifies the ISO 4217 KZT code without prescribing monetary behavior. KZT CurrencyCode = "KZT" // LAK identifies the ISO 4217 LAK code without prescribing monetary behavior. LAK CurrencyCode = "LAK" // LBP identifies the ISO 4217 LBP code without prescribing monetary behavior. LBP CurrencyCode = "LBP" // LKR identifies the ISO 4217 LKR code without prescribing monetary behavior. LKR CurrencyCode = "LKR" // LRD identifies the ISO 4217 LRD code without prescribing monetary behavior. LRD CurrencyCode = "LRD" // LSL identifies the ISO 4217 LSL code without prescribing monetary behavior. LSL CurrencyCode = "LSL" // LYD identifies the ISO 4217 LYD code without prescribing monetary behavior. LYD CurrencyCode = "LYD" // MAD identifies the ISO 4217 MAD code without prescribing monetary behavior. MAD CurrencyCode = "MAD" // MDL identifies the ISO 4217 MDL code without prescribing monetary behavior. MDL CurrencyCode = "MDL" // MGA identifies the ISO 4217 MGA code without prescribing monetary behavior. MGA CurrencyCode = "MGA" // MKD identifies the ISO 4217 MKD code without prescribing monetary behavior. MKD CurrencyCode = "MKD" // MMK identifies the ISO 4217 MMK code without prescribing monetary behavior. MMK CurrencyCode = "MMK" // MNT identifies the ISO 4217 MNT code without prescribing monetary behavior. MNT CurrencyCode = "MNT" // MOP identifies the ISO 4217 MOP code without prescribing monetary behavior. MOP CurrencyCode = "MOP" // MRU identifies the ISO 4217 MRU code without prescribing monetary behavior. MRU CurrencyCode = "MRU" // MUR identifies the ISO 4217 MUR code without prescribing monetary behavior. MUR CurrencyCode = "MUR" // MVR identifies the ISO 4217 MVR code without prescribing monetary behavior. MVR CurrencyCode = "MVR" // MWK identifies the ISO 4217 MWK code without prescribing monetary behavior. MWK CurrencyCode = "MWK" // MXN identifies the ISO 4217 MXN code without prescribing monetary behavior. MXN CurrencyCode = "MXN" // MXV identifies the ISO 4217 MXV code without prescribing monetary behavior. MXV CurrencyCode = "MXV" // MYR identifies the ISO 4217 MYR code without prescribing monetary behavior. MYR CurrencyCode = "MYR" // MZN identifies the ISO 4217 MZN code without prescribing monetary behavior. MZN CurrencyCode = "MZN" // NAD identifies the ISO 4217 NAD code without prescribing monetary behavior. NAD CurrencyCode = "NAD" // NGN identifies the ISO 4217 NGN code without prescribing monetary behavior. NGN CurrencyCode = "NGN" // NIO identifies the ISO 4217 NIO code without prescribing monetary behavior. NIO CurrencyCode = "NIO" // NOK identifies the ISO 4217 NOK code without prescribing monetary behavior. NOK CurrencyCode = "NOK" // NPR identifies the ISO 4217 NPR code without prescribing monetary behavior. NPR CurrencyCode = "NPR" // NZD identifies the ISO 4217 NZD code without prescribing monetary behavior. NZD CurrencyCode = "NZD" // OMR identifies the ISO 4217 OMR code without prescribing monetary behavior. OMR CurrencyCode = "OMR" // PAB identifies the ISO 4217 PAB code without prescribing monetary behavior. PAB CurrencyCode = "PAB" // PEN identifies the ISO 4217 PEN code without prescribing monetary behavior. PEN CurrencyCode = "PEN" // PGK identifies the ISO 4217 PGK code without prescribing monetary behavior. PGK CurrencyCode = "PGK" // PHP identifies the ISO 4217 PHP code without prescribing monetary behavior. PHP CurrencyCode = "PHP" // PKR identifies the ISO 4217 PKR code without prescribing monetary behavior. PKR CurrencyCode = "PKR" // PLN identifies the ISO 4217 PLN code without prescribing monetary behavior. PLN CurrencyCode = "PLN" // PYG identifies the ISO 4217 PYG code without prescribing monetary behavior. PYG CurrencyCode = "PYG" // QAR identifies the ISO 4217 QAR code without prescribing monetary behavior. QAR CurrencyCode = "QAR" // RON identifies the ISO 4217 RON code without prescribing monetary behavior. RON CurrencyCode = "RON" // RSD identifies the ISO 4217 RSD code without prescribing monetary behavior. RSD CurrencyCode = "RSD" // RUB identifies the ISO 4217 RUB code without prescribing monetary behavior. RUB CurrencyCode = "RUB" // RWF identifies the ISO 4217 RWF code without prescribing monetary behavior. RWF CurrencyCode = "RWF" // SAR identifies the ISO 4217 SAR code without prescribing monetary behavior. SAR CurrencyCode = "SAR" // SBD identifies the ISO 4217 SBD code without prescribing monetary behavior. SBD CurrencyCode = "SBD" // SCR identifies the ISO 4217 SCR code without prescribing monetary behavior. SCR CurrencyCode = "SCR" // SDG identifies the ISO 4217 SDG code without prescribing monetary behavior. SDG CurrencyCode = "SDG" // SEK identifies the ISO 4217 SEK code without prescribing monetary behavior. SEK CurrencyCode = "SEK" // SGD identifies the ISO 4217 SGD code without prescribing monetary behavior. SGD CurrencyCode = "SGD" // SHP identifies the ISO 4217 SHP code without prescribing monetary behavior. SHP CurrencyCode = "SHP" // SLE identifies the ISO 4217 SLE code without prescribing monetary behavior. SLE CurrencyCode = "SLE" // SOS identifies the ISO 4217 SOS code without prescribing monetary behavior. SOS CurrencyCode = "SOS" // SRD identifies the ISO 4217 SRD code without prescribing monetary behavior. SRD CurrencyCode = "SRD" // SSP identifies the ISO 4217 SSP code without prescribing monetary behavior. SSP CurrencyCode = "SSP" // STN identifies the ISO 4217 STN code without prescribing monetary behavior. STN CurrencyCode = "STN" // SVC identifies the ISO 4217 SVC code without prescribing monetary behavior. SVC CurrencyCode = "SVC" // SYP identifies the ISO 4217 SYP code without prescribing monetary behavior. SYP CurrencyCode = "SYP" // SZL identifies the ISO 4217 SZL code without prescribing monetary behavior. SZL CurrencyCode = "SZL" // THB identifies the ISO 4217 THB code without prescribing monetary behavior. THB CurrencyCode = "THB" // TJS identifies the ISO 4217 TJS code without prescribing monetary behavior. TJS CurrencyCode = "TJS" // TMT identifies the ISO 4217 TMT code without prescribing monetary behavior. TMT CurrencyCode = "TMT" // TND identifies the ISO 4217 TND code without prescribing monetary behavior. TND CurrencyCode = "TND" // TOP identifies the ISO 4217 TOP code without prescribing monetary behavior. TOP CurrencyCode = "TOP" // TRY identifies the ISO 4217 TRY code without prescribing monetary behavior. TRY CurrencyCode = "TRY" // TTD identifies the ISO 4217 TTD code without prescribing monetary behavior. TTD CurrencyCode = "TTD" // TWD identifies the ISO 4217 TWD code without prescribing monetary behavior. TWD CurrencyCode = "TWD" // TZS identifies the ISO 4217 TZS code without prescribing monetary behavior. TZS CurrencyCode = "TZS" // UAH identifies the ISO 4217 UAH code without prescribing monetary behavior. UAH CurrencyCode = "UAH" // UGX identifies the ISO 4217 UGX code without prescribing monetary behavior. UGX CurrencyCode = "UGX" // USD identifies the ISO 4217 USD code without prescribing monetary behavior. USD CurrencyCode = "USD" // USN identifies the ISO 4217 USN code without prescribing monetary behavior. USN CurrencyCode = "USN" // UYI identifies the ISO 4217 UYI code without prescribing monetary behavior. UYI CurrencyCode = "UYI" // UYU identifies the ISO 4217 UYU code without prescribing monetary behavior. UYU CurrencyCode = "UYU" // UYW identifies the ISO 4217 UYW code without prescribing monetary behavior. UYW CurrencyCode = "UYW" // UZS identifies the ISO 4217 UZS code without prescribing monetary behavior. UZS CurrencyCode = "UZS" // VED identifies the ISO 4217 VED code without prescribing monetary behavior. VED CurrencyCode = "VED" // VES identifies the ISO 4217 VES code without prescribing monetary behavior. VES CurrencyCode = "VES" // VND identifies the ISO 4217 VND code without prescribing monetary behavior. VND CurrencyCode = "VND" // VUV identifies the ISO 4217 VUV code without prescribing monetary behavior. VUV CurrencyCode = "VUV" // WST identifies the ISO 4217 WST code without prescribing monetary behavior. WST CurrencyCode = "WST" // XAD identifies the ISO 4217 XAD code without prescribing monetary behavior. XAD CurrencyCode = "XAD" // XAF identifies the ISO 4217 XAF code without prescribing monetary behavior. XAF CurrencyCode = "XAF" // XAG identifies the ISO 4217 XAG code without prescribing monetary behavior. XAG CurrencyCode = "XAG" // XAU identifies the ISO 4217 XAU code without prescribing monetary behavior. XAU CurrencyCode = "XAU" // XBA identifies the ISO 4217 XBA code without prescribing monetary behavior. XBA CurrencyCode = "XBA" // XBB identifies the ISO 4217 XBB code without prescribing monetary behavior. XBB CurrencyCode = "XBB" // XBC identifies the ISO 4217 XBC code without prescribing monetary behavior. XBC CurrencyCode = "XBC" // XBD identifies the ISO 4217 XBD code without prescribing monetary behavior. XBD CurrencyCode = "XBD" // XCD identifies the ISO 4217 XCD code without prescribing monetary behavior. XCD CurrencyCode = "XCD" // XCG identifies the ISO 4217 XCG code without prescribing monetary behavior. XCG CurrencyCode = "XCG" // XDR identifies the ISO 4217 XDR code without prescribing monetary behavior. XDR CurrencyCode = "XDR" // XOF identifies the ISO 4217 XOF code without prescribing monetary behavior. XOF CurrencyCode = "XOF" // XPD identifies the ISO 4217 XPD code without prescribing monetary behavior. XPD CurrencyCode = "XPD" // XPF identifies the ISO 4217 XPF code without prescribing monetary behavior. XPF CurrencyCode = "XPF" // XPT identifies the ISO 4217 XPT code without prescribing monetary behavior. XPT CurrencyCode = "XPT" // XSU identifies the ISO 4217 XSU code without prescribing monetary behavior. XSU CurrencyCode = "XSU" // XTS identifies the ISO 4217 XTS code without prescribing monetary behavior. XTS CurrencyCode = "XTS" // XUA identifies the ISO 4217 XUA code without prescribing monetary behavior. XUA CurrencyCode = "XUA" // XXX identifies the ISO 4217 XXX code without prescribing monetary behavior. XXX CurrencyCode = "XXX" // YER identifies the ISO 4217 YER code without prescribing monetary behavior. YER CurrencyCode = "YER" // ZAR identifies the ISO 4217 ZAR code without prescribing monetary behavior. ZAR CurrencyCode = "ZAR" // ZMW identifies the ISO 4217 ZMW code without prescribing monetary behavior. ZMW CurrencyCode = "ZMW" // ZWG identifies the ISO 4217 ZWG code without prescribing monetary behavior. ZWG CurrencyCode = "ZWG" )
type CurrencyField ¶ added in v0.2.0
type CurrencyField[T ~string] struct { // contains filtered or unexported fields }
CurrencyField is an immutable fluent chain with one shared currency allowlist.
func Currency ¶ added in v0.2.0
func Currency[T ~string](path string, value T) CurrencyField[T]
Currency starts a deferred currency allowlist, configured with selectors such as USD and EUR. Select at least one currency before validation; string and defined-string inputs are supported.
func (CurrencyField[T]) AED ¶ added in v0.2.0
func (b CurrencyField[T]) AED() CurrencyField[T]
AED adds AED to the field's shared currency allowlist.
func (CurrencyField[T]) AFN ¶ added in v0.2.0
func (b CurrencyField[T]) AFN() CurrencyField[T]
AFN adds AFN to the field's shared currency allowlist.
func (CurrencyField[T]) ALL ¶ added in v0.2.0
func (b CurrencyField[T]) ALL() CurrencyField[T]
ALL adds ALL to the field's shared currency allowlist.
func (CurrencyField[T]) AMD ¶ added in v0.2.0
func (b CurrencyField[T]) AMD() CurrencyField[T]
AMD adds AMD to the field's shared currency allowlist.
func (CurrencyField[T]) AOA ¶ added in v0.2.0
func (b CurrencyField[T]) AOA() CurrencyField[T]
AOA adds AOA to the field's shared currency allowlist.
func (CurrencyField[T]) ARS ¶ added in v0.2.0
func (b CurrencyField[T]) ARS() CurrencyField[T]
ARS adds ARS to the field's shared currency allowlist.
func (CurrencyField[T]) AUD ¶ added in v0.2.0
func (b CurrencyField[T]) AUD() CurrencyField[T]
AUD adds AUD to the field's shared currency allowlist.
func (CurrencyField[T]) AWG ¶ added in v0.2.0
func (b CurrencyField[T]) AWG() CurrencyField[T]
AWG adds AWG to the field's shared currency allowlist.
func (CurrencyField[T]) AZN ¶ added in v0.2.0
func (b CurrencyField[T]) AZN() CurrencyField[T]
AZN adds AZN to the field's shared currency allowlist.
func (CurrencyField[T]) BAM ¶ added in v0.2.0
func (b CurrencyField[T]) BAM() CurrencyField[T]
BAM adds BAM to the field's shared currency allowlist.
func (CurrencyField[T]) BBD ¶ added in v0.2.0
func (b CurrencyField[T]) BBD() CurrencyField[T]
BBD adds BBD to the field's shared currency allowlist.
func (CurrencyField[T]) BDT ¶ added in v0.2.0
func (b CurrencyField[T]) BDT() CurrencyField[T]
BDT adds BDT to the field's shared currency allowlist.
func (CurrencyField[T]) BHD ¶ added in v0.2.0
func (b CurrencyField[T]) BHD() CurrencyField[T]
BHD adds BHD to the field's shared currency allowlist.
func (CurrencyField[T]) BIF ¶ added in v0.2.0
func (b CurrencyField[T]) BIF() CurrencyField[T]
BIF adds BIF to the field's shared currency allowlist.
func (CurrencyField[T]) BMD ¶ added in v0.2.0
func (b CurrencyField[T]) BMD() CurrencyField[T]
BMD adds BMD to the field's shared currency allowlist.
func (CurrencyField[T]) BND ¶ added in v0.2.0
func (b CurrencyField[T]) BND() CurrencyField[T]
BND adds BND to the field's shared currency allowlist.
func (CurrencyField[T]) BOB ¶ added in v0.2.0
func (b CurrencyField[T]) BOB() CurrencyField[T]
BOB adds BOB to the field's shared currency allowlist.
func (CurrencyField[T]) BOV ¶ added in v0.2.0
func (b CurrencyField[T]) BOV() CurrencyField[T]
BOV adds BOV to the field's shared currency allowlist.
func (CurrencyField[T]) BRL ¶ added in v0.2.0
func (b CurrencyField[T]) BRL() CurrencyField[T]
BRL adds BRL to the field's shared currency allowlist.
func (CurrencyField[T]) BSD ¶ added in v0.2.0
func (b CurrencyField[T]) BSD() CurrencyField[T]
BSD adds BSD to the field's shared currency allowlist.
func (CurrencyField[T]) BTN ¶ added in v0.2.0
func (b CurrencyField[T]) BTN() CurrencyField[T]
BTN adds BTN to the field's shared currency allowlist.
func (CurrencyField[T]) BWP ¶ added in v0.2.0
func (b CurrencyField[T]) BWP() CurrencyField[T]
BWP adds BWP to the field's shared currency allowlist.
func (CurrencyField[T]) BYN ¶ added in v0.2.0
func (b CurrencyField[T]) BYN() CurrencyField[T]
BYN adds BYN to the field's shared currency allowlist.
func (CurrencyField[T]) BZD ¶ added in v0.2.0
func (b CurrencyField[T]) BZD() CurrencyField[T]
BZD adds BZD to the field's shared currency allowlist.
func (CurrencyField[T]) CAD ¶ added in v0.2.0
func (b CurrencyField[T]) CAD() CurrencyField[T]
CAD adds CAD to the field's shared currency allowlist.
func (CurrencyField[T]) CDF ¶ added in v0.2.0
func (b CurrencyField[T]) CDF() CurrencyField[T]
CDF adds CDF to the field's shared currency allowlist.
func (CurrencyField[T]) CHE ¶ added in v0.2.0
func (b CurrencyField[T]) CHE() CurrencyField[T]
CHE adds CHE to the field's shared currency allowlist.
func (CurrencyField[T]) CHF ¶ added in v0.2.0
func (b CurrencyField[T]) CHF() CurrencyField[T]
CHF adds CHF to the field's shared currency allowlist.
func (CurrencyField[T]) CHW ¶ added in v0.2.0
func (b CurrencyField[T]) CHW() CurrencyField[T]
CHW adds CHW to the field's shared currency allowlist.
func (CurrencyField[T]) CLF ¶ added in v0.2.0
func (b CurrencyField[T]) CLF() CurrencyField[T]
CLF adds CLF to the field's shared currency allowlist.
func (CurrencyField[T]) CLP ¶ added in v0.2.0
func (b CurrencyField[T]) CLP() CurrencyField[T]
CLP adds CLP to the field's shared currency allowlist.
func (CurrencyField[T]) CNY ¶ added in v0.2.0
func (b CurrencyField[T]) CNY() CurrencyField[T]
CNY adds CNY to the field's shared currency allowlist.
func (CurrencyField[T]) COP ¶ added in v0.2.0
func (b CurrencyField[T]) COP() CurrencyField[T]
COP adds COP to the field's shared currency allowlist.
func (CurrencyField[T]) COU ¶ added in v0.2.0
func (b CurrencyField[T]) COU() CurrencyField[T]
COU adds COU to the field's shared currency allowlist.
func (CurrencyField[T]) CRC ¶ added in v0.2.0
func (b CurrencyField[T]) CRC() CurrencyField[T]
CRC adds CRC to the field's shared currency allowlist.
func (CurrencyField[T]) CUP ¶ added in v0.2.0
func (b CurrencyField[T]) CUP() CurrencyField[T]
CUP adds CUP to the field's shared currency allowlist.
func (CurrencyField[T]) CVE ¶ added in v0.2.0
func (b CurrencyField[T]) CVE() CurrencyField[T]
CVE adds CVE to the field's shared currency allowlist.
func (CurrencyField[T]) CZK ¶ added in v0.2.0
func (b CurrencyField[T]) CZK() CurrencyField[T]
CZK adds CZK to the field's shared currency allowlist.
func (CurrencyField[T]) Check ¶ added in v0.2.0
func (b CurrencyField[T]) Check(check func(context.Context, T) error) CurrencyField[T]
Check attaches a context-aware application check after the currency allowlist.
func (CurrencyField[T]) DJF ¶ added in v0.2.0
func (b CurrencyField[T]) DJF() CurrencyField[T]
DJF adds DJF to the field's shared currency allowlist.
func (CurrencyField[T]) DKK ¶ added in v0.2.0
func (b CurrencyField[T]) DKK() CurrencyField[T]
DKK adds DKK to the field's shared currency allowlist.
func (CurrencyField[T]) DOP ¶ added in v0.2.0
func (b CurrencyField[T]) DOP() CurrencyField[T]
DOP adds DOP to the field's shared currency allowlist.
func (CurrencyField[T]) DZD ¶ added in v0.2.0
func (b CurrencyField[T]) DZD() CurrencyField[T]
DZD adds DZD to the field's shared currency allowlist.
func (CurrencyField[T]) EGP ¶ added in v0.2.0
func (b CurrencyField[T]) EGP() CurrencyField[T]
EGP adds EGP to the field's shared currency allowlist.
func (CurrencyField[T]) ERN ¶ added in v0.2.0
func (b CurrencyField[T]) ERN() CurrencyField[T]
ERN adds ERN to the field's shared currency allowlist.
func (CurrencyField[T]) ETB ¶ added in v0.2.0
func (b CurrencyField[T]) ETB() CurrencyField[T]
ETB adds ETB to the field's shared currency allowlist.
func (CurrencyField[T]) EUR ¶ added in v0.2.0
func (b CurrencyField[T]) EUR() CurrencyField[T]
EUR adds EUR to the field's shared currency allowlist.
func (CurrencyField[T]) FJD ¶ added in v0.2.0
func (b CurrencyField[T]) FJD() CurrencyField[T]
FJD adds FJD to the field's shared currency allowlist.
func (CurrencyField[T]) FKP ¶ added in v0.2.0
func (b CurrencyField[T]) FKP() CurrencyField[T]
FKP adds FKP to the field's shared currency allowlist.
func (CurrencyField[T]) GBP ¶ added in v0.2.0
func (b CurrencyField[T]) GBP() CurrencyField[T]
GBP adds GBP to the field's shared currency allowlist.
func (CurrencyField[T]) GEL ¶ added in v0.2.0
func (b CurrencyField[T]) GEL() CurrencyField[T]
GEL adds GEL to the field's shared currency allowlist.
func (CurrencyField[T]) GHS ¶ added in v0.2.0
func (b CurrencyField[T]) GHS() CurrencyField[T]
GHS adds GHS to the field's shared currency allowlist.
func (CurrencyField[T]) GIP ¶ added in v0.2.0
func (b CurrencyField[T]) GIP() CurrencyField[T]
GIP adds GIP to the field's shared currency allowlist.
func (CurrencyField[T]) GMD ¶ added in v0.2.0
func (b CurrencyField[T]) GMD() CurrencyField[T]
GMD adds GMD to the field's shared currency allowlist.
func (CurrencyField[T]) GNF ¶ added in v0.2.0
func (b CurrencyField[T]) GNF() CurrencyField[T]
GNF adds GNF to the field's shared currency allowlist.
func (CurrencyField[T]) GTQ ¶ added in v0.2.0
func (b CurrencyField[T]) GTQ() CurrencyField[T]
GTQ adds GTQ to the field's shared currency allowlist.
func (CurrencyField[T]) GYD ¶ added in v0.2.0
func (b CurrencyField[T]) GYD() CurrencyField[T]
GYD adds GYD to the field's shared currency allowlist.
func (CurrencyField[T]) HKD ¶ added in v0.2.0
func (b CurrencyField[T]) HKD() CurrencyField[T]
HKD adds HKD to the field's shared currency allowlist.
func (CurrencyField[T]) HNL ¶ added in v0.2.0
func (b CurrencyField[T]) HNL() CurrencyField[T]
HNL adds HNL to the field's shared currency allowlist.
func (CurrencyField[T]) HTG ¶ added in v0.2.0
func (b CurrencyField[T]) HTG() CurrencyField[T]
HTG adds HTG to the field's shared currency allowlist.
func (CurrencyField[T]) HUF ¶ added in v0.2.0
func (b CurrencyField[T]) HUF() CurrencyField[T]
HUF adds HUF to the field's shared currency allowlist.
func (CurrencyField[T]) IDR ¶ added in v0.2.0
func (b CurrencyField[T]) IDR() CurrencyField[T]
IDR adds IDR to the field's shared currency allowlist.
func (CurrencyField[T]) ILS ¶ added in v0.2.0
func (b CurrencyField[T]) ILS() CurrencyField[T]
ILS adds ILS to the field's shared currency allowlist.
func (CurrencyField[T]) INR ¶ added in v0.2.0
func (b CurrencyField[T]) INR() CurrencyField[T]
INR adds INR to the field's shared currency allowlist.
func (CurrencyField[T]) IQD ¶ added in v0.2.0
func (b CurrencyField[T]) IQD() CurrencyField[T]
IQD adds IQD to the field's shared currency allowlist.
func (CurrencyField[T]) IRR ¶ added in v0.2.0
func (b CurrencyField[T]) IRR() CurrencyField[T]
IRR adds IRR to the field's shared currency allowlist.
func (CurrencyField[T]) ISK ¶ added in v0.2.0
func (b CurrencyField[T]) ISK() CurrencyField[T]
ISK adds ISK to the field's shared currency allowlist.
func (CurrencyField[T]) JMD ¶ added in v0.2.0
func (b CurrencyField[T]) JMD() CurrencyField[T]
JMD adds JMD to the field's shared currency allowlist.
func (CurrencyField[T]) JOD ¶ added in v0.2.0
func (b CurrencyField[T]) JOD() CurrencyField[T]
JOD adds JOD to the field's shared currency allowlist.
func (CurrencyField[T]) JPY ¶ added in v0.2.0
func (b CurrencyField[T]) JPY() CurrencyField[T]
JPY adds JPY to the field's shared currency allowlist.
func (CurrencyField[T]) KES ¶ added in v0.2.0
func (b CurrencyField[T]) KES() CurrencyField[T]
KES adds KES to the field's shared currency allowlist.
func (CurrencyField[T]) KGS ¶ added in v0.2.0
func (b CurrencyField[T]) KGS() CurrencyField[T]
KGS adds KGS to the field's shared currency allowlist.
func (CurrencyField[T]) KHR ¶ added in v0.2.0
func (b CurrencyField[T]) KHR() CurrencyField[T]
KHR adds KHR to the field's shared currency allowlist.
func (CurrencyField[T]) KMF ¶ added in v0.2.0
func (b CurrencyField[T]) KMF() CurrencyField[T]
KMF adds KMF to the field's shared currency allowlist.
func (CurrencyField[T]) KPW ¶ added in v0.2.0
func (b CurrencyField[T]) KPW() CurrencyField[T]
KPW adds KPW to the field's shared currency allowlist.
func (CurrencyField[T]) KRW ¶ added in v0.2.0
func (b CurrencyField[T]) KRW() CurrencyField[T]
KRW adds KRW to the field's shared currency allowlist.
func (CurrencyField[T]) KWD ¶ added in v0.2.0
func (b CurrencyField[T]) KWD() CurrencyField[T]
KWD adds KWD to the field's shared currency allowlist.
func (CurrencyField[T]) KYD ¶ added in v0.2.0
func (b CurrencyField[T]) KYD() CurrencyField[T]
KYD adds KYD to the field's shared currency allowlist.
func (CurrencyField[T]) KZT ¶ added in v0.2.0
func (b CurrencyField[T]) KZT() CurrencyField[T]
KZT adds KZT to the field's shared currency allowlist.
func (CurrencyField[T]) LAK ¶ added in v0.2.0
func (b CurrencyField[T]) LAK() CurrencyField[T]
LAK adds LAK to the field's shared currency allowlist.
func (CurrencyField[T]) LBP ¶ added in v0.2.0
func (b CurrencyField[T]) LBP() CurrencyField[T]
LBP adds LBP to the field's shared currency allowlist.
func (CurrencyField[T]) LKR ¶ added in v0.2.0
func (b CurrencyField[T]) LKR() CurrencyField[T]
LKR adds LKR to the field's shared currency allowlist.
func (CurrencyField[T]) LRD ¶ added in v0.2.0
func (b CurrencyField[T]) LRD() CurrencyField[T]
LRD adds LRD to the field's shared currency allowlist.
func (CurrencyField[T]) LSL ¶ added in v0.2.0
func (b CurrencyField[T]) LSL() CurrencyField[T]
LSL adds LSL to the field's shared currency allowlist.
func (CurrencyField[T]) LYD ¶ added in v0.2.0
func (b CurrencyField[T]) LYD() CurrencyField[T]
LYD adds LYD to the field's shared currency allowlist.
func (CurrencyField[T]) Label ¶ added in v0.2.0
func (b CurrencyField[T]) Label(label string) CurrencyField[T]
Label changes human-readable prose without changing the currency field path.
func (CurrencyField[T]) MAD ¶ added in v0.2.0
func (b CurrencyField[T]) MAD() CurrencyField[T]
MAD adds MAD to the field's shared currency allowlist.
func (CurrencyField[T]) MDL ¶ added in v0.2.0
func (b CurrencyField[T]) MDL() CurrencyField[T]
MDL adds MDL to the field's shared currency allowlist.
func (CurrencyField[T]) MGA ¶ added in v0.2.0
func (b CurrencyField[T]) MGA() CurrencyField[T]
MGA adds MGA to the field's shared currency allowlist.
func (CurrencyField[T]) MKD ¶ added in v0.2.0
func (b CurrencyField[T]) MKD() CurrencyField[T]
MKD adds MKD to the field's shared currency allowlist.
func (CurrencyField[T]) MMK ¶ added in v0.2.0
func (b CurrencyField[T]) MMK() CurrencyField[T]
MMK adds MMK to the field's shared currency allowlist.
func (CurrencyField[T]) MNT ¶ added in v0.2.0
func (b CurrencyField[T]) MNT() CurrencyField[T]
MNT adds MNT to the field's shared currency allowlist.
func (CurrencyField[T]) MOP ¶ added in v0.2.0
func (b CurrencyField[T]) MOP() CurrencyField[T]
MOP adds MOP to the field's shared currency allowlist.
func (CurrencyField[T]) MRU ¶ added in v0.2.0
func (b CurrencyField[T]) MRU() CurrencyField[T]
MRU adds MRU to the field's shared currency allowlist.
func (CurrencyField[T]) MUR ¶ added in v0.2.0
func (b CurrencyField[T]) MUR() CurrencyField[T]
MUR adds MUR to the field's shared currency allowlist.
func (CurrencyField[T]) MVR ¶ added in v0.2.0
func (b CurrencyField[T]) MVR() CurrencyField[T]
MVR adds MVR to the field's shared currency allowlist.
func (CurrencyField[T]) MWK ¶ added in v0.2.0
func (b CurrencyField[T]) MWK() CurrencyField[T]
MWK adds MWK to the field's shared currency allowlist.
func (CurrencyField[T]) MXN ¶ added in v0.2.0
func (b CurrencyField[T]) MXN() CurrencyField[T]
MXN adds MXN to the field's shared currency allowlist.
func (CurrencyField[T]) MXV ¶ added in v0.2.0
func (b CurrencyField[T]) MXV() CurrencyField[T]
MXV adds MXV to the field's shared currency allowlist.
func (CurrencyField[T]) MYR ¶ added in v0.2.0
func (b CurrencyField[T]) MYR() CurrencyField[T]
MYR adds MYR to the field's shared currency allowlist.
func (CurrencyField[T]) MZN ¶ added in v0.2.0
func (b CurrencyField[T]) MZN() CurrencyField[T]
MZN adds MZN to the field's shared currency allowlist.
func (CurrencyField[T]) Message ¶ added in v0.2.0
func (b CurrencyField[T]) Message(message string) CurrencyField[T]
Message overrides the preceding rule message while preserving its code.
func (CurrencyField[T]) NAD ¶ added in v0.2.0
func (b CurrencyField[T]) NAD() CurrencyField[T]
NAD adds NAD to the field's shared currency allowlist.
func (CurrencyField[T]) NGN ¶ added in v0.2.0
func (b CurrencyField[T]) NGN() CurrencyField[T]
NGN adds NGN to the field's shared currency allowlist.
func (CurrencyField[T]) NIO ¶ added in v0.2.0
func (b CurrencyField[T]) NIO() CurrencyField[T]
NIO adds NIO to the field's shared currency allowlist.
func (CurrencyField[T]) NOK ¶ added in v0.2.0
func (b CurrencyField[T]) NOK() CurrencyField[T]
NOK adds NOK to the field's shared currency allowlist.
func (CurrencyField[T]) NPR ¶ added in v0.2.0
func (b CurrencyField[T]) NPR() CurrencyField[T]
NPR adds NPR to the field's shared currency allowlist.
func (CurrencyField[T]) NZD ¶ added in v0.2.0
func (b CurrencyField[T]) NZD() CurrencyField[T]
NZD adds NZD to the field's shared currency allowlist.
func (CurrencyField[T]) OMR ¶ added in v0.2.0
func (b CurrencyField[T]) OMR() CurrencyField[T]
OMR adds OMR to the field's shared currency allowlist.
func (CurrencyField[T]) PAB ¶ added in v0.2.0
func (b CurrencyField[T]) PAB() CurrencyField[T]
PAB adds PAB to the field's shared currency allowlist.
func (CurrencyField[T]) PEN ¶ added in v0.2.0
func (b CurrencyField[T]) PEN() CurrencyField[T]
PEN adds PEN to the field's shared currency allowlist.
func (CurrencyField[T]) PGK ¶ added in v0.2.0
func (b CurrencyField[T]) PGK() CurrencyField[T]
PGK adds PGK to the field's shared currency allowlist.
func (CurrencyField[T]) PHP ¶ added in v0.2.0
func (b CurrencyField[T]) PHP() CurrencyField[T]
PHP adds PHP to the field's shared currency allowlist.
func (CurrencyField[T]) PKR ¶ added in v0.2.0
func (b CurrencyField[T]) PKR() CurrencyField[T]
PKR adds PKR to the field's shared currency allowlist.
func (CurrencyField[T]) PLN ¶ added in v0.2.0
func (b CurrencyField[T]) PLN() CurrencyField[T]
PLN adds PLN to the field's shared currency allowlist.
func (CurrencyField[T]) PYG ¶ added in v0.2.0
func (b CurrencyField[T]) PYG() CurrencyField[T]
PYG adds PYG to the field's shared currency allowlist.
func (CurrencyField[T]) QAR ¶ added in v0.2.0
func (b CurrencyField[T]) QAR() CurrencyField[T]
QAR adds QAR to the field's shared currency allowlist.
func (CurrencyField[T]) RON ¶ added in v0.2.0
func (b CurrencyField[T]) RON() CurrencyField[T]
RON adds RON to the field's shared currency allowlist.
func (CurrencyField[T]) RSD ¶ added in v0.2.0
func (b CurrencyField[T]) RSD() CurrencyField[T]
RSD adds RSD to the field's shared currency allowlist.
func (CurrencyField[T]) RUB ¶ added in v0.2.0
func (b CurrencyField[T]) RUB() CurrencyField[T]
RUB adds RUB to the field's shared currency allowlist.
func (CurrencyField[T]) RWF ¶ added in v0.2.0
func (b CurrencyField[T]) RWF() CurrencyField[T]
RWF adds RWF to the field's shared currency allowlist.
func (CurrencyField[T]) Required ¶ added in v0.2.0
func (b CurrencyField[T]) Required() CurrencyField[T]
Required rejects an empty currency code before allowlist and application checks.
func (CurrencyField[T]) RequiredIf ¶ added in v0.2.0
func (b CurrencyField[T]) RequiredIf(condition bool) CurrencyField[T]
RequiredIf rejects an empty code when condition is true; the allowlist still applies.
func (CurrencyField[T]) SAR ¶ added in v0.2.0
func (b CurrencyField[T]) SAR() CurrencyField[T]
SAR adds SAR to the field's shared currency allowlist.
func (CurrencyField[T]) SBD ¶ added in v0.2.0
func (b CurrencyField[T]) SBD() CurrencyField[T]
SBD adds SBD to the field's shared currency allowlist.
func (CurrencyField[T]) SCR ¶ added in v0.2.0
func (b CurrencyField[T]) SCR() CurrencyField[T]
SCR adds SCR to the field's shared currency allowlist.
func (CurrencyField[T]) SDG ¶ added in v0.2.0
func (b CurrencyField[T]) SDG() CurrencyField[T]
SDG adds SDG to the field's shared currency allowlist.
func (CurrencyField[T]) SEK ¶ added in v0.2.0
func (b CurrencyField[T]) SEK() CurrencyField[T]
SEK adds SEK to the field's shared currency allowlist.
func (CurrencyField[T]) SGD ¶ added in v0.2.0
func (b CurrencyField[T]) SGD() CurrencyField[T]
SGD adds SGD to the field's shared currency allowlist.
func (CurrencyField[T]) SHP ¶ added in v0.2.0
func (b CurrencyField[T]) SHP() CurrencyField[T]
SHP adds SHP to the field's shared currency allowlist.
func (CurrencyField[T]) SLE ¶ added in v0.2.0
func (b CurrencyField[T]) SLE() CurrencyField[T]
SLE adds SLE to the field's shared currency allowlist.
func (CurrencyField[T]) SOS ¶ added in v0.2.0
func (b CurrencyField[T]) SOS() CurrencyField[T]
SOS adds SOS to the field's shared currency allowlist.
func (CurrencyField[T]) SRD ¶ added in v0.2.0
func (b CurrencyField[T]) SRD() CurrencyField[T]
SRD adds SRD to the field's shared currency allowlist.
func (CurrencyField[T]) SSP ¶ added in v0.2.0
func (b CurrencyField[T]) SSP() CurrencyField[T]
SSP adds SSP to the field's shared currency allowlist.
func (CurrencyField[T]) STN ¶ added in v0.2.0
func (b CurrencyField[T]) STN() CurrencyField[T]
STN adds STN to the field's shared currency allowlist.
func (CurrencyField[T]) SVC ¶ added in v0.2.0
func (b CurrencyField[T]) SVC() CurrencyField[T]
SVC adds SVC to the field's shared currency allowlist.
func (CurrencyField[T]) SYP ¶ added in v0.2.0
func (b CurrencyField[T]) SYP() CurrencyField[T]
SYP adds SYP to the field's shared currency allowlist.
func (CurrencyField[T]) SZL ¶ added in v0.2.0
func (b CurrencyField[T]) SZL() CurrencyField[T]
SZL adds SZL to the field's shared currency allowlist.
func (CurrencyField[T]) THB ¶ added in v0.2.0
func (b CurrencyField[T]) THB() CurrencyField[T]
THB adds THB to the field's shared currency allowlist.
func (CurrencyField[T]) TJS ¶ added in v0.2.0
func (b CurrencyField[T]) TJS() CurrencyField[T]
TJS adds TJS to the field's shared currency allowlist.
func (CurrencyField[T]) TMT ¶ added in v0.2.0
func (b CurrencyField[T]) TMT() CurrencyField[T]
TMT adds TMT to the field's shared currency allowlist.
func (CurrencyField[T]) TND ¶ added in v0.2.0
func (b CurrencyField[T]) TND() CurrencyField[T]
TND adds TND to the field's shared currency allowlist.
func (CurrencyField[T]) TOP ¶ added in v0.2.0
func (b CurrencyField[T]) TOP() CurrencyField[T]
TOP adds TOP to the field's shared currency allowlist.
func (CurrencyField[T]) TRY ¶ added in v0.2.0
func (b CurrencyField[T]) TRY() CurrencyField[T]
TRY adds TRY to the field's shared currency allowlist.
func (CurrencyField[T]) TTD ¶ added in v0.2.0
func (b CurrencyField[T]) TTD() CurrencyField[T]
TTD adds TTD to the field's shared currency allowlist.
func (CurrencyField[T]) TWD ¶ added in v0.2.0
func (b CurrencyField[T]) TWD() CurrencyField[T]
TWD adds TWD to the field's shared currency allowlist.
func (CurrencyField[T]) TZS ¶ added in v0.2.0
func (b CurrencyField[T]) TZS() CurrencyField[T]
TZS adds TZS to the field's shared currency allowlist.
func (CurrencyField[T]) UAH ¶ added in v0.2.0
func (b CurrencyField[T]) UAH() CurrencyField[T]
UAH adds UAH to the field's shared currency allowlist.
func (CurrencyField[T]) UGX ¶ added in v0.2.0
func (b CurrencyField[T]) UGX() CurrencyField[T]
UGX adds UGX to the field's shared currency allowlist.
func (CurrencyField[T]) USD ¶ added in v0.2.0
func (b CurrencyField[T]) USD() CurrencyField[T]
USD adds USD to the field's shared currency allowlist.
func (CurrencyField[T]) USN ¶ added in v0.2.0
func (b CurrencyField[T]) USN() CurrencyField[T]
USN adds USN to the field's shared currency allowlist.
func (CurrencyField[T]) UYI ¶ added in v0.2.0
func (b CurrencyField[T]) UYI() CurrencyField[T]
UYI adds UYI to the field's shared currency allowlist.
func (CurrencyField[T]) UYU ¶ added in v0.2.0
func (b CurrencyField[T]) UYU() CurrencyField[T]
UYU adds UYU to the field's shared currency allowlist.
func (CurrencyField[T]) UYW ¶ added in v0.2.0
func (b CurrencyField[T]) UYW() CurrencyField[T]
UYW adds UYW to the field's shared currency allowlist.
func (CurrencyField[T]) UZS ¶ added in v0.2.0
func (b CurrencyField[T]) UZS() CurrencyField[T]
UZS adds UZS to the field's shared currency allowlist.
func (CurrencyField[T]) Using ¶ added in v0.2.0
func (b CurrencyField[T]) Using(rule Rule[T]) CurrencyField[T]
Using attaches an application validator for the exact currency-code input type.
func (CurrencyField[T]) VED ¶ added in v0.2.0
func (b CurrencyField[T]) VED() CurrencyField[T]
VED adds VED to the field's shared currency allowlist.
func (CurrencyField[T]) VES ¶ added in v0.2.0
func (b CurrencyField[T]) VES() CurrencyField[T]
VES adds VES to the field's shared currency allowlist.
func (CurrencyField[T]) VND ¶ added in v0.2.0
func (b CurrencyField[T]) VND() CurrencyField[T]
VND adds VND to the field's shared currency allowlist.
func (CurrencyField[T]) VUV ¶ added in v0.2.0
func (b CurrencyField[T]) VUV() CurrencyField[T]
VUV adds VUV to the field's shared currency allowlist.
func (CurrencyField[T]) WST ¶ added in v0.2.0
func (b CurrencyField[T]) WST() CurrencyField[T]
WST adds WST to the field's shared currency allowlist.
func (CurrencyField[T]) XAD ¶ added in v0.2.0
func (b CurrencyField[T]) XAD() CurrencyField[T]
XAD adds XAD to the field's shared currency allowlist.
func (CurrencyField[T]) XAF ¶ added in v0.2.0
func (b CurrencyField[T]) XAF() CurrencyField[T]
XAF adds XAF to the field's shared currency allowlist.
func (CurrencyField[T]) XAG ¶ added in v0.2.0
func (b CurrencyField[T]) XAG() CurrencyField[T]
XAG adds XAG to the field's shared currency allowlist.
func (CurrencyField[T]) XAU ¶ added in v0.2.0
func (b CurrencyField[T]) XAU() CurrencyField[T]
XAU adds XAU to the field's shared currency allowlist.
func (CurrencyField[T]) XBA ¶ added in v0.2.0
func (b CurrencyField[T]) XBA() CurrencyField[T]
XBA adds XBA to the field's shared currency allowlist.
func (CurrencyField[T]) XBB ¶ added in v0.2.0
func (b CurrencyField[T]) XBB() CurrencyField[T]
XBB adds XBB to the field's shared currency allowlist.
func (CurrencyField[T]) XBC ¶ added in v0.2.0
func (b CurrencyField[T]) XBC() CurrencyField[T]
XBC adds XBC to the field's shared currency allowlist.
func (CurrencyField[T]) XBD ¶ added in v0.2.0
func (b CurrencyField[T]) XBD() CurrencyField[T]
XBD adds XBD to the field's shared currency allowlist.
func (CurrencyField[T]) XCD ¶ added in v0.2.0
func (b CurrencyField[T]) XCD() CurrencyField[T]
XCD adds XCD to the field's shared currency allowlist.
func (CurrencyField[T]) XCG ¶ added in v0.2.0
func (b CurrencyField[T]) XCG() CurrencyField[T]
XCG adds XCG to the field's shared currency allowlist.
func (CurrencyField[T]) XDR ¶ added in v0.2.0
func (b CurrencyField[T]) XDR() CurrencyField[T]
XDR adds XDR to the field's shared currency allowlist.
func (CurrencyField[T]) XOF ¶ added in v0.2.0
func (b CurrencyField[T]) XOF() CurrencyField[T]
XOF adds XOF to the field's shared currency allowlist.
func (CurrencyField[T]) XPD ¶ added in v0.2.0
func (b CurrencyField[T]) XPD() CurrencyField[T]
XPD adds XPD to the field's shared currency allowlist.
func (CurrencyField[T]) XPF ¶ added in v0.2.0
func (b CurrencyField[T]) XPF() CurrencyField[T]
XPF adds XPF to the field's shared currency allowlist.
func (CurrencyField[T]) XPT ¶ added in v0.2.0
func (b CurrencyField[T]) XPT() CurrencyField[T]
XPT adds XPT to the field's shared currency allowlist.
func (CurrencyField[T]) XSU ¶ added in v0.2.0
func (b CurrencyField[T]) XSU() CurrencyField[T]
XSU adds XSU to the field's shared currency allowlist.
func (CurrencyField[T]) XTS ¶ added in v0.2.0
func (b CurrencyField[T]) XTS() CurrencyField[T]
XTS adds XTS to the field's shared currency allowlist.
func (CurrencyField[T]) XUA ¶ added in v0.2.0
func (b CurrencyField[T]) XUA() CurrencyField[T]
XUA adds XUA to the field's shared currency allowlist.
func (CurrencyField[T]) XXX ¶ added in v0.2.0
func (b CurrencyField[T]) XXX() CurrencyField[T]
XXX adds XXX to the field's shared currency allowlist.
func (CurrencyField[T]) YER ¶ added in v0.2.0
func (b CurrencyField[T]) YER() CurrencyField[T]
YER adds YER to the field's shared currency allowlist.
func (CurrencyField[T]) ZAR ¶ added in v0.2.0
func (b CurrencyField[T]) ZAR() CurrencyField[T]
ZAR adds ZAR to the field's shared currency allowlist.
func (CurrencyField[T]) ZMW ¶ added in v0.2.0
func (b CurrencyField[T]) ZMW() CurrencyField[T]
ZMW adds ZMW to the field's shared currency allowlist.
func (CurrencyField[T]) ZWG ¶ added in v0.2.0
func (b CurrencyField[T]) ZWG() CurrencyField[T]
ZWG adds ZWG to the field's shared currency allowlist.
type DecimalField ¶ added in v0.2.0
type DecimalField[T ~string] struct { // contains filtered or unexported fields }
DecimalField is an immutable fluent chain for exact plain-decimal text. T may be an application-defined string type; submitted text is never rounded or rewritten.
func Decimal ¶ added in v0.2.0
func Decimal[T ~string](path string, value T) DecimalField[T]
Decimal starts a deferred chain for signed decimal text without exponent notation. Values require ASCII integer digits and may include a fractional part with digits after the point.
func (DecimalField[T]) Check ¶ added in v0.2.0
func (b DecimalField[T]) Check(check func(context.Context, T) error) DecimalField[T]
Check attaches a context-aware application check without converting the submitted text.
func (DecimalField[T]) Equal ¶ added in v0.2.0
func (b DecimalField[T]) Equal(other T) DecimalField[T]
Equal compares numeric value exactly without exposing its target; written scale may differ.
func (DecimalField[T]) GreaterThan ¶ added in v0.2.0
func (b DecimalField[T]) GreaterThan(other T) DecimalField[T]
GreaterThan requires a strict lower bound without exposing the comparison value in failures.
func (DecimalField[T]) Label ¶ added in v0.2.0
func (b DecimalField[T]) Label(label string) DecimalField[T]
Label sets the human-readable field name without changing its output path.
func (DecimalField[T]) LessThan ¶ added in v0.2.0
func (b DecimalField[T]) LessThan(other T) DecimalField[T]
LessThan requires a strict upper bound without exposing the comparison value in failures.
func (DecimalField[T]) Max ¶ added in v0.2.0
func (b DecimalField[T]) Max(max T) DecimalField[T]
Max requires an exact inclusive upper bound expressed as plain decimal text.
func (DecimalField[T]) MaxScale ¶ added in v0.2.0
func (b DecimalField[T]) MaxScale(max int) DecimalField[T]
MaxScale permits at most max written fractional digits, counting trailing zeros.
func (DecimalField[T]) Message ¶ added in v0.2.0
func (b DecimalField[T]) Message(message string) DecimalField[T]
Message overrides the preceding rule message while preserving its code.
func (DecimalField[T]) Min ¶ added in v0.2.0
func (b DecimalField[T]) Min(min T) DecimalField[T]
Min requires an exact inclusive lower bound expressed as plain decimal text.
func (DecimalField[T]) Required ¶ added in v0.2.0
func (b DecimalField[T]) Required() DecimalField[T]
Required rejects empty text before decimal syntax and content checks run.
func (DecimalField[T]) RequiredIf ¶ added in v0.2.0
func (b DecimalField[T]) RequiredIf(condition bool) DecimalField[T]
RequiredIf rejects empty text when condition is true; decimal syntax checks still apply.
func (DecimalField[T]) Using ¶ added in v0.2.0
func (b DecimalField[T]) Using(rule Rule[T]) DecimalField[T]
Using attaches a reusable validator for the exact decimal-text type.
type Errors ¶
type Errors struct {
// contains filtered or unexported fields
}
Errors contains ordered field failures and supports errors.As.
type Field ¶
type Field interface {
// contains filtered or unexported methods
}
Field is a deferred validation operation constructed by a typed builder or group.
type Input ¶
type Input[T any] struct { // contains filtered or unexported fields }
Input preserves whether JSON supplied a value, null, or no property at all. Its zero value is absent; use json's omitzero option to omit absent properties. Decoding T uses json.Unmarshal, so enclosing decoder options do not propagate.
func (Input[T]) Get ¶
Get returns the supplied value and reports whether it is present and non-null.
func (Input[T]) IsPresent ¶
IsPresent reports whether a property was supplied, including explicit null.
func (Input[T]) MarshalJSON ¶
MarshalJSON emits null for absent or null inputs and otherwise encodes the value.
func (*Input[T]) UnmarshalJSON ¶
UnmarshalJSON replaces the input only after a complete successful decode.
type Issue ¶
type Issue struct {
Path string `json:"path"`
Code string `json:"code"`
Message string `json:"message"`
Parameters map[string]string `json:"parameters,omitempty"`
}
Issue describes a failed field without retaining its submitted value.
type MapField ¶
type MapField[T any] struct { // contains filtered or unexported fields }
MapField validates a borrowed string-keyed map with deterministic child paths.
func (MapField[T]) Each ¶
Each constructs key and value checks in sorted key order after parent constraints pass.
func (MapField[T]) Message ¶
Message customizes the preceding parent constraint while preserving its code.
func (MapField[T]) OnlyKeys ¶
OnlyKeys permits only the listed keys, copying configuration independently of the caller.
func (MapField[T]) RequiredIf ¶
RequiredIf enforces a nonempty map only when condition is true.
type NumberField ¶
type NumberField[T Numeric] struct { // contains filtered or unexported fields }
NumberField is an immutable fluent chain for number values.
func Number ¶
func Number[T Numeric](path string, value T) NumberField[T]
Number starts a deferred chain for a borrowed application value.
func (NumberField[T]) Check ¶
func (b NumberField[T]) Check(check func(context.Context, T) error) NumberField[T]
Check attaches a context-aware application check.
func (NumberField[T]) Equal ¶
func (b NumberField[T]) Equal(other T) NumberField[T]
Equal requires the other value without exposing it in error messages.
func (NumberField[T]) GreaterThan ¶
func (b NumberField[T]) GreaterThan(other T) NumberField[T]
GreaterThan requires a strict lower bound in the field's numeric type.
func (NumberField[T]) In ¶
func (b NumberField[T]) In(values ...T) NumberField[T]
In permits only finite listed values and owns its constraint slice.
func (NumberField[T]) Label ¶
func (b NumberField[T]) Label(label string) NumberField[T]
Label sets the human-readable field name without changing its output path.
func (NumberField[T]) LessThan ¶
func (b NumberField[T]) LessThan(other T) NumberField[T]
LessThan requires a strict upper bound in the field's numeric type.
func (NumberField[T]) Max ¶
func (b NumberField[T]) Max(max T) NumberField[T]
Max requires an inclusive upper bound in the field's exact numeric type.
func (NumberField[T]) Message ¶
func (b NumberField[T]) Message(message string) NumberField[T]
Message overrides the preceding rule message while preserving its code.
func (NumberField[T]) Min ¶
func (b NumberField[T]) Min(min T) NumberField[T]
Min requires an inclusive lower bound in the field's exact numeric type.
func (NumberField[T]) MultipleOf ¶
func (b NumberField[T]) MultipleOf(divisor T) NumberField[T]
MultipleOf requires an exact remainder of zero; floats use binary math.Mod semantics.
func (NumberField[T]) NotEqual ¶
func (b NumberField[T]) NotEqual(other T) NumberField[T]
NotEqual rejects the other finite value without exposing it in errors.
func (NumberField[T]) NotIn ¶
func (b NumberField[T]) NotIn(values ...T) NumberField[T]
NotIn rejects the finite listed values and owns its constraint slice.
func (NumberField[T]) Using ¶
func (b NumberField[T]) Using(rule Rule[T]) NumberField[T]
Using attaches a reusable validator for the exact value type.
type Numeric ¶
type Numeric interface {
~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr | ~float32 | ~float64
}
Numeric permits all Go integer and floating-point types, including defined types.
type PresenceField ¶
type PresenceField[T any] struct { // contains filtered or unexported fields }
PresenceField validates an Input while preserving omitted and explicit-null states.
func Presence ¶
func Presence[T any](path string, input Input[T], build func(T) Field) PresenceField[T]
Presence defers child validation until input contains a non-null value. Use an empty child path to retain path, or a named child to append a segment.
func (PresenceField[T]) Label ¶
func (b PresenceField[T]) Label(label string) PresenceField[T]
Label sets the human-readable name for presence failures.
func (PresenceField[T]) Message ¶
func (b PresenceField[T]) Message(message string) PresenceField[T]
Message overrides the preceding presence rule message while preserving its code.
func (PresenceField[T]) Nullable ¶
func (b PresenceField[T]) Nullable() PresenceField[T]
Nullable permits explicit null without constructing child validation.
func (PresenceField[T]) Required ¶
func (b PresenceField[T]) Required() PresenceField[T]
Required requires a supplied, non-null value; zero values remain valid.
func (PresenceField[T]) RequiredIf ¶
func (b PresenceField[T]) RequiredIf(condition bool) PresenceField[T]
RequiredIf requires a supplied, non-null value when condition is true.
type Rule ¶
type Rule[T any] interface { // Validate returns nil, an explicit Violation, or an operational error. Validate(value T) error }
Rule validates a value using application-owned configuration and dependencies.
func UniqueBy ¶
func UniqueBy[T any, K comparable](key func(T) K) Rule[[]T]
UniqueBy requires distinct comparable keys without retaining keys in failures.
type RuleWithContext ¶
type RuleWithContext[T any] interface { Rule[T] // ValidateContext uses the evaluation context for dependent operations. ValidateContext(ctx context.Context, value T) error }
RuleWithContext propagates request cancellation to dependent operations.
type SliceField ¶
type SliceField[T any] struct { // contains filtered or unexported fields }
SliceField is an immutable fluent chain for slice values.
func Slice ¶
func Slice[T any](path string, value []T) SliceField[T]
Slice starts a deferred chain for a borrowed application value.
func (SliceField[T]) Check ¶
func (b SliceField[T]) Check(check func(context.Context, []T) error) SliceField[T]
Check attaches a context-aware application check.
func (SliceField[T]) Contains ¶
func (b SliceField[T]) Contains(target T) SliceField[T]
Contains requires an element equal under reflect.DeepEqual; the target value is borrowed.
func (SliceField[T]) Each ¶
func (b SliceField[T]) Each(fields func(T) []Field) SliceField[T]
Each lazily constructs child fields for each element after parent checks pass.
func (SliceField[T]) Label ¶
func (b SliceField[T]) Label(label string) SliceField[T]
Label sets the human-readable field name without changing its output path.
func (SliceField[T]) Len ¶
func (b SliceField[T]) Len(length int) SliceField[T]
Len requires exactly length elements.
func (SliceField[T]) Max ¶
func (b SliceField[T]) Max(max int) SliceField[T]
Max permits at most max elements.
func (SliceField[T]) Message ¶
func (b SliceField[T]) Message(message string) SliceField[T]
Message overrides the preceding rule message while preserving its code.
func (SliceField[T]) Min ¶
func (b SliceField[T]) Min(min int) SliceField[T]
Min requires at least min elements.
func (SliceField[T]) NotContains ¶
func (b SliceField[T]) NotContains(target T) SliceField[T]
NotContains rejects an element equal under reflect.DeepEqual; the target value is borrowed.
func (SliceField[T]) Required ¶
func (b SliceField[T]) Required() SliceField[T]
Required rejects empty and nil slices before evaluating child fields.
func (SliceField[T]) RequiredIf ¶
func (b SliceField[T]) RequiredIf(condition bool) SliceField[T]
RequiredIf applies a nonempty constraint only when condition is true.
func (SliceField[T]) Unique ¶
func (b SliceField[T]) Unique() SliceField[T]
Unique requires distinct Go-comparable elements; use UniqueBy for structs with slices or maps.
func (SliceField[T]) Using ¶
func (b SliceField[T]) Using(rule Rule[[]T]) SliceField[T]
Using attaches a reusable validator for the exact value type.
type StringField ¶
type StringField[T ~string] struct { // contains filtered or unexported fields }
StringField is an immutable fluent chain for string values.
func String ¶
func String[T ~string](path string, value T) StringField[T]
String starts a deferred chain for a borrowed application value.
func (StringField[T]) Check ¶
func (b StringField[T]) Check(check func(context.Context, T) error) StringField[T]
Check attaches a context-aware application check.
func (StringField[T]) Contains ¶
func (b StringField[T]) Contains(text string) StringField[T]
Contains requires the configured substring without modifying case or whitespace.
func (StringField[T]) EndsWith ¶
func (b StringField[T]) EndsWith(suffix string) StringField[T]
EndsWith requires a literal suffix.
func (StringField[T]) Equal ¶
func (b StringField[T]) Equal(other T) StringField[T]
Equal requires the other value without retaining it in failure details.
func (StringField[T]) In ¶
func (b StringField[T]) In(values ...T) StringField[T]
In permits only the given values and owns a copy of their slice.
func (StringField[T]) IsASCII ¶
func (b StringField[T]) IsASCII() StringField[T]
IsASCII requires nonempty ASCII text, including control bytes.
func (StringField[T]) IsAlpha ¶
func (b StringField[T]) IsAlpha() StringField[T]
IsAlpha requires nonempty ASCII letters.
func (StringField[T]) IsAlphanumeric ¶
func (b StringField[T]) IsAlphanumeric() StringField[T]
IsAlphanumeric requires nonempty ASCII letters and digits.
func (StringField[T]) IsBase64 ¶
func (b StringField[T]) IsBase64() StringField[T]
IsBase64 requires strict standard padded Base64 without whitespace.
func (StringField[T]) IsBase64URL ¶
func (b StringField[T]) IsBase64URL() StringField[T]
IsBase64URL requires strict padded or raw URL-safe Base64.
func (StringField[T]) IsCIDR ¶
func (b StringField[T]) IsCIDR() StringField[T]
IsCIDR requires an IP prefix without normalizing host bits.
func (StringField[T]) IsDate ¶
func (b StringField[T]) IsDate(layout string) StringField[T]
IsDate requires a value parseable with a Go time layout, using UTC for unzoned input.
func (StringField[T]) IsDateIn ¶
func (b StringField[T]) IsDateIn(layout string, location *time.Location) StringField[T]
IsDateIn interprets unzoned input in location without changing the supplied string.
func (StringField[T]) IsDigits ¶
func (b StringField[T]) IsDigits() StringField[T]
IsDigits requires nonempty ASCII decimal digits.
func (StringField[T]) IsE164 ¶
func (b StringField[T]) IsE164() StringField[T]
IsE164 requires international phone-number syntax, without assignment checks.
func (StringField[T]) IsEmail ¶
func (b StringField[T]) IsEmail() StringField[T]
IsEmail requires a bare ASCII mailbox with a dotted domain.
func (StringField[T]) IsHostname ¶
func (b StringField[T]) IsHostname() StringField[T]
IsHostname requires ASCII DNS labels, optionally ending in a root dot.
func (StringField[T]) IsIP ¶
func (b StringField[T]) IsIP() StringField[T]
IsIP requires an unzoned IP address literal.
func (StringField[T]) IsIPv4 ¶
func (b StringField[T]) IsIPv4() StringField[T]
IsIPv4 requires an IPv4 address literal.
func (StringField[T]) IsIPv6 ¶
func (b StringField[T]) IsIPv6() StringField[T]
IsIPv6 requires an unzoned IPv6 address literal.
func (StringField[T]) IsJSON ¶
func (b StringField[T]) IsJSON() StringField[T]
IsJSON requires any valid JSON document, including scalar values.
func (StringField[T]) IsLowercase ¶
func (b StringField[T]) IsLowercase() StringField[T]
IsLowercase requires valid UTF-8 with at least one cased letter and no uppercase or titlecase letters.
func (StringField[T]) IsMAC ¶
func (b StringField[T]) IsMAC() StringField[T]
IsMAC requires a 48-bit or 64-bit link-layer address.
func (StringField[T]) IsULID ¶
func (b StringField[T]) IsULID() StringField[T]
IsULID requires a case-insensitive 128-bit ULID.
func (StringField[T]) IsURL ¶
func (b StringField[T]) IsURL() StringField[T]
IsURL requires an absolute HTTP or HTTPS URL with a host.
func (StringField[T]) IsUTF8 ¶
func (b StringField[T]) IsUTF8() StringField[T]
IsUTF8 requires valid UTF-8, including empty text.
func (StringField[T]) IsUUID ¶
func (b StringField[T]) IsUUID() StringField[T]
IsUUID requires a canonical UUID, including nil and max UUIDs.
func (StringField[T]) IsUUIDv4 ¶
func (b StringField[T]) IsUUIDv4() StringField[T]
IsUUIDv4 requires a canonical version 4 UUID.
func (StringField[T]) IsUUIDv7 ¶
func (b StringField[T]) IsUUIDv7() StringField[T]
IsUUIDv7 requires a canonical version 7 UUID.
func (StringField[T]) IsUppercase ¶
func (b StringField[T]) IsUppercase() StringField[T]
IsUppercase requires valid UTF-8 with at least one cased letter and no lowercase or titlecase letters.
func (StringField[T]) Label ¶
func (b StringField[T]) Label(label string) StringField[T]
Label sets the human-readable field name without changing its output path.
func (StringField[T]) Len ¶
func (b StringField[T]) Len(length int) StringField[T]
Len requires exactly length Unicode code points.
func (StringField[T]) Match ¶
func (b StringField[T]) Match(pattern *regexp.Regexp) StringField[T]
Match requires a match against an already compiled, caller-owned expression.
func (StringField[T]) Max ¶
func (b StringField[T]) Max(max int) StringField[T]
Max permits at most max Unicode code points.
func (StringField[T]) Message ¶
func (b StringField[T]) Message(message string) StringField[T]
Message overrides the preceding rule message while preserving its code.
func (StringField[T]) Min ¶
func (b StringField[T]) Min(min int) StringField[T]
Min requires at least min Unicode code points.
func (StringField[T]) NotBlank ¶
func (b StringField[T]) NotBlank() StringField[T]
NotBlank rejects empty strings and strings containing only Unicode whitespace.
func (StringField[T]) NotContains ¶
func (b StringField[T]) NotContains(text string) StringField[T]
NotContains rejects the configured substring without exposing it in failures.
func (StringField[T]) NotEqual ¶
func (b StringField[T]) NotEqual(other T) StringField[T]
NotEqual rejects the other value without retaining it in failure details.
func (StringField[T]) NotIn ¶
func (b StringField[T]) NotIn(values ...T) StringField[T]
NotIn rejects the listed values and owns a copy of their slice.
func (StringField[T]) Required ¶
func (b StringField[T]) Required() StringField[T]
Required rejects an empty string before content rules run.
func (StringField[T]) RequiredIf ¶
func (b StringField[T]) RequiredIf(condition bool) StringField[T]
RequiredIf applies an emptiness check only when condition is true.
func (StringField[T]) StartsWith ¶
func (b StringField[T]) StartsWith(prefix string) StringField[T]
StartsWith requires a literal prefix.
func (StringField[T]) Using ¶
func (b StringField[T]) Using(rule Rule[T]) StringField[T]
Using attaches a reusable validator for the exact value type.
type TimeField ¶
type TimeField struct {
// contains filtered or unexported fields
}
TimeField is an immutable fluent chain for time instants.
func (TimeField) Equal ¶
Equal requires the same instant without exposing the expected value in failures.
func (TimeField) RequiredIf ¶
RequiredIf rejects the zero time when condition is true.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator is an immutable evaluation policy; its zero value uses package defaults. Rule and formatter callbacks retain application ownership and concurrency requirements.
func New ¶
func New() Validator
New creates a validator with first-violation-per-field collection and default messages.
func (Validator) CollectAll ¶
CollectAll collects all content failures per field; required failures still stop that field.
func (Validator) FormatMessages ¶
FormatMessages formats violations by path, code, and owned parameters, unless Message overrides it. The callback receives no submitted value and may provide application-localized messages.
func (Validator) StopOnFirstError ¶
StopOnFirstError stops the entire evaluation after its first input violation.
type ValueField ¶
type ValueField[T any] struct { // contains filtered or unexported fields }
ValueField is an immutable fluent chain for value values.
func Value ¶
func Value[T any](path string, value T) ValueField[T]
Value starts a deferred chain for a borrowed application value.
func (ValueField[T]) Check ¶
func (b ValueField[T]) Check(check func(context.Context, T) error) ValueField[T]
Check attaches a context-aware application check.
func (ValueField[T]) Label ¶
func (b ValueField[T]) Label(label string) ValueField[T]
Label sets the human-readable field name without changing its output path.
func (ValueField[T]) Message ¶
func (b ValueField[T]) Message(message string) ValueField[T]
Message overrides the preceding rule message while preserving its code.
func (ValueField[T]) Using ¶
func (b ValueField[T]) Using(rule Rule[T]) ValueField[T]
Using attaches a reusable validator for the exact value type.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
advanced
command
|
|
|
constraints
command
|
|
|
context
command
|
|
|
currency
command
|
|
|
custom
command
|
|
|
decimal
command
|
|
|
domain
command
|
|
|
errors
command
|
|
|
formats
command
|
|
|
moreformats
command
|
|
|
nested
command
|
|
|
patch
command
|
|
|
policies
command
|
|
|
presence
command
|
|
|
quickstart
command
|
|
|
time
command
|
|
|
internal
|
|
|
formats
Package formats owns the checks behind fluent string format methods.
|
Package formats owns the checks behind fluent string format methods. |
|
violation
Package violation shares coded failures between validation and format rules.
|
Package violation shares coded failures between validation and format rules. |