Documentation
¶
Overview ¶
Code generated by genx:code DO NOT EDIT.
Index ¶
- func ExtractFloatScales(v string) (w, p uint)
- func ParseEnumValue[T Enum](data string) (T, error)
- type Enum
- type EnumVa
- type EnumValidation
- type Error
- type FloatScaleVa
- type IntScaleVa
- type LengthVa
- type LengthValidation
- type MultipleVa
- type Numeric
- type NumericMultipleValidation
- type NumericRangeValidation
- type RangeVa
- type RegexpVa
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractFloatScales ¶
func ParseEnumValue ¶
Types ¶
type EnumVa ¶
type EnumVa[T comparable] struct { // contains filtered or unexported fields }
type EnumValidation ¶
type EnumValidation interface {
Enums() []any
}
type Error ¶
type Error int8
Error va error codes +genx:code
const ( ERROR_UNDEFINED Error = iota ERROR__INVALID_LENGTH_RANGE // invalid length range, expect 1 or 2 uint values ERROR__OUT_OF_LENGTH // input value out of length limitation ERROR__INVALID_VALUE_RANGE // invalid range value ERROR__OUT_OF_VALUE_RANGE // input value out of value range ERROR__INVALID_ENUM // invalid enumeration value ERROR__OUT_OF_ENUMERATED_VALUES // input value out of enumerated values ERROR__INVALID_MULTIPLE // invalid multiple ERROR__NOT_MATCH_MULTIPLE // input value not match multiple ERROR__INVALID_FLOAT_SCALE // invalid float scale, expect most 2 uint max 31 ERROR__OUT_OF_FLOAT_SCALE // input value out of float scale ERROR__INVALID_INT_BITS // invalid int bits, expect most 1 uint max 64 ERROR__OUT_OF_INT_BITS // input value out of int bits ERROR__NOT_MATCH_REGEXP // input value not match regexp ERROR__INVALID_INT_VALUE // invalid input, expect int64/uint64 )
type FloatScaleVa ¶
type FloatScaleVa struct {
// contains filtered or unexported fields
}
func NewFloatScaleVa ¶
func NewFloatScaleVa(r rule.Rule) (*FloatScaleVa, error)
func (*FloatScaleVa) BuildTo ¶
func (fs *FloatScaleVa) BuildTo(b rule.Builder)
func (*FloatScaleVa) String ¶
func (fs *FloatScaleVa) String() string
func (*FloatScaleVa) Validate ¶
func (fs *FloatScaleVa) Validate(v string) error
type IntScaleVa ¶
type IntScaleVa struct {
// contains filtered or unexported fields
}
func NewIntScaleVa ¶
func NewIntScaleVa(r rule.Rule) (*IntScaleVa, error)
func (*IntScaleVa) Bits ¶
func (is *IntScaleVa) Bits() uint8
func (*IntScaleVa) BuiltTo ¶
func (is *IntScaleVa) BuiltTo(b rule.Builder)
func (*IntScaleVa) String ¶
func (is *IntScaleVa) String() string
func (*IntScaleVa) Unsigned ¶
func (is *IntScaleVa) Unsigned() bool
func (*IntScaleVa) Validate ¶
func (is *IntScaleVa) Validate(v any) error
type LengthVa ¶
type LengthVa struct {
// contains filtered or unexported fields
}
func (*LengthVa) LengthRange ¶
type LengthValidation ¶
type MultipleVa ¶
type MultipleVa[T Numeric] struct { // contains filtered or unexported fields }
func NewMultipleVa ¶
func NewMultipleVa[T Numeric](r rule.Rule) (*MultipleVa[T], error)
func (*MultipleVa[T]) BuiltTo ¶
func (m *MultipleVa[T]) BuiltTo(b rule.Builder)
func (*MultipleVa[T]) MultipleOf ¶
func (m *MultipleVa[T]) MultipleOf() T
func (*MultipleVa[T]) Validate ¶
func (m *MultipleVa[T]) Validate(v T, precision uint) error
type NumericMultipleValidation ¶
type NumericMultipleValidation[T Numeric] interface { MultipleOf() T }
type NumericRangeValidation ¶
type RangeVa ¶
type RangeVa[T Numeric] struct { // contains filtered or unexported fields }
func (*RangeVa[T]) ExclusiveMax ¶
func (*RangeVa[T]) ExclusiveMin ¶
Click to show internal directories.
Click to hide internal directories.