types

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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 (i *BaseType) Description() string

func (*BaseType) HasValue added in v0.1.0

func (i *BaseType) HasValue() bool

func (*BaseType) Name added in v0.1.0

func (i *BaseType) Name() string

func (*BaseType) SetConstraint added in v0.1.0

func (i *BaseType) SetConstraint(c interfaces.Constraint)

func (*BaseType) SetValueInternal added in v0.1.0

func (i *BaseType) SetValueInternal(strVal string, raw any)

func (*BaseType) Value added in v0.1.0

func (i *BaseType) Value() string

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 FloatType

type FloatType struct {
	BaseType
}

func NewFloat

func NewFloat(name string) *FloatType

func (*FloatType) SetValue

func (i *FloatType) SetValue(s string) bool

func (*FloatType) String

func (i *FloatType) String() string

func (*FloatType) Type

func (i *FloatType) Type() string

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 IntType

type IntType struct {
	BaseType
}

func NewInt

func NewInt(name string) *IntType

func (*IntType) SetValue

func (i *IntType) SetValue(s string) bool

func (*IntType) Type

func (i *IntType) Type() string

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

Jump to

Keyboard shortcuts

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