Documentation ¶
Index ¶
- type BaseConstraint
- type BaseType
- func (i *BaseType) Constraint() interfaces.Constraint
- func (i *BaseType) Description() string
- func (i *BaseType) HasValue() bool
- func (i *BaseType) Name() string
- func (i *BaseType) SetConstraint(c interfaces.Constraint)
- func (i *BaseType) SetValueInternal(strVal string, raw any)
- func (i *BaseType) Value() string
- type FloatConstraint
- type FloatType
- type IntConstraint
- type IntType
- type NilConstraint
- type StringConstraint
- type StringType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseConstraint ¶ added in v0.1.0
type BaseConstraint struct { Default string `json:"default"` Description string `json:"description"` }
func (*BaseConstraint) DescriptionStr ¶ added in v0.1.0
func (b *BaseConstraint) DescriptionStr() *string
func (*BaseConstraint) ToMap ¶ added in v0.1.2
func (b *BaseConstraint) ToMap() map[string]any
type BaseType ¶ added in v0.1.0
type BaseType struct {
// contains filtered or unexported fields
}
func (*BaseType) Constraint ¶ added in v0.1.0
func (i *BaseType) Constraint() interfaces.Constraint
func (*BaseType) Description ¶ added in v0.1.0
func (*BaseType) SetConstraint ¶ added in v0.1.0
func (i *BaseType) SetConstraint(c interfaces.Constraint)
func (*BaseType) SetValueInternal ¶ added in v0.1.0
type FloatConstraint ¶
type FloatConstraint struct { BaseConstraint Min *float64 `json:"min,omitempty"` Max *float64 `json:"max,omitempty"` }
func (*FloatConstraint) CanFit ¶
func (i *FloatConstraint) CanFit(v string) bool
func (*FloatConstraint) String ¶
func (i *FloatConstraint) String() string
func (*FloatConstraint) ToMap ¶ added in v0.1.2
func (i *FloatConstraint) ToMap() map[string]any
func (*FloatConstraint) Validate ¶ added in v0.0.2
func (i *FloatConstraint) Validate() error
type IntConstraint ¶
type IntConstraint struct { BaseConstraint Min *int64 `json:"min,omitempty"` Max *int64 `json:"max,omitempty"` }
func (*IntConstraint) CanFit ¶
func (i *IntConstraint) CanFit(v string) bool
func (*IntConstraint) String ¶
func (i *IntConstraint) String() string
func (*IntConstraint) ToMap ¶ added in v0.1.2
func (i *IntConstraint) ToMap() map[string]any
func (*IntConstraint) Validate ¶ added in v0.0.2
func (i *IntConstraint) Validate() error
type NilConstraint ¶
type NilConstraint struct { }
func (*NilConstraint) CanFit ¶
func (c *NilConstraint) CanFit(value string) bool
func (*NilConstraint) DescriptionStr ¶ added in v0.1.0
func (c *NilConstraint) DescriptionStr() *string
func (*NilConstraint) String ¶
func (c *NilConstraint) String() string
func (*NilConstraint) ToMap ¶ added in v0.1.2
func (c *NilConstraint) ToMap() map[string]any
func (*NilConstraint) Validate ¶ added in v0.0.2
func (c *NilConstraint) Validate() error
type StringConstraint ¶
type StringConstraint struct { BaseConstraint MinLength *int `json:"minLen"` MaxLength *int `json:"maxLen"` }
func (*StringConstraint) CanFit ¶
func (s *StringConstraint) CanFit(s2 string) bool
func (*StringConstraint) String ¶
func (s *StringConstraint) String() string
func (*StringConstraint) ToMap ¶ added in v0.1.2
func (s *StringConstraint) ToMap() map[string]any
func (*StringConstraint) Validate ¶ added in v0.0.2
func (s *StringConstraint) Validate() error
type StringType ¶
type StringType struct { BaseType // contains filtered or unexported fields }
func NewString ¶
func NewString(name string) *StringType
func (*StringType) SetValue ¶
func (s *StringType) SetValue(s2 string) bool
func (*StringType) Type ¶
func (s *StringType) Type() string
Click to show internal directories.
Click to hide internal directories.