Documentation
¶
Index ¶
- func IsAllOrEmpty(c Constraint) bool
- func IsBlank(c Constraint) bool
- func IsBlankLimit(l Limit) bool
- func IsGeneric(c Constraint) bool
- func IsGenericLimit(c Limit) bool
- func IsNull(c Constraint) bool
- func IsNullLimit(l Limit) bool
- func Parse(filename string, b []byte, opts ...Option) (any, error)
- func ParseFile(filename string, opts ...Option) (i any, err error)
- func ParseReader(filename string, r io.Reader, opts ...Option) (any, error)
- type AllConstraint
- func (c *AllConstraint) ASCIIDocString(dataType *types.DataType) string
- func (c *AllConstraint) Clone() Constraint
- func (c *AllConstraint) Equal(o Constraint) bool
- func (c *AllConstraint) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *AllConstraint) MarshalJSON() ([]byte, error)
- func (c *AllConstraint) Max(cc Context) (max types.DataTypeExtreme)
- func (c *AllConstraint) Min(cc Context) (min types.DataTypeExtreme)
- func (c *AllConstraint) NeedsParens(topLevel bool) bool
- func (c *AllConstraint) Type() Type
- type BooleanLimit
- func (c *BooleanLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *BooleanLimit) Clone() Limit
- func (c *BooleanLimit) DataModelString(dataType *types.DataType) string
- func (c *BooleanLimit) Equal(o Limit) bool
- func (c *BooleanLimit) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *BooleanLimit) MarshalJSON() ([]byte, error)
- func (c *BooleanLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (c *BooleanLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (c *BooleanLimit) NeedsParens(topLevel bool) bool
- type CharacterLimit
- func (c *CharacterLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *CharacterLimit) Clone() Limit
- func (c *CharacterLimit) DataModelString(dataType *types.DataType) string
- func (c *CharacterLimit) Equal(o Limit) bool
- func (c *CharacterLimit) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *CharacterLimit) MarshalJSON() ([]byte, error)
- func (c *CharacterLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (c *CharacterLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (c *CharacterLimit) NeedsParens(topLevel bool) bool
- type Constraint
- type Context
- type DescribedConstraint
- func (c *DescribedConstraint) ASCIIDocString(dataType *types.DataType) string
- func (c *DescribedConstraint) Clone() Constraint
- func (c *DescribedConstraint) Equal(o Constraint) bool
- func (c *DescribedConstraint) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *DescribedConstraint) MarshalJSON() ([]byte, error)
- func (c *DescribedConstraint) Max(cc Context) (max types.DataTypeExtreme)
- func (c *DescribedConstraint) Min(cc Context) (min types.DataTypeExtreme)
- func (c *DescribedConstraint) NeedsParens(topLevel bool) bool
- func (c *DescribedConstraint) Type() Type
- type DescribedLimit
- func (gl *DescribedLimit) ASCIIDocString(dataType *types.DataType) string
- func (gl *DescribedLimit) Clone() Limit
- func (gl *DescribedLimit) DataModelString(dataType *types.DataType) string
- func (gl *DescribedLimit) Equal(o Limit) bool
- func (gl *DescribedLimit) Fallback(c Context) (max types.DataTypeExtreme)
- func (gl *DescribedLimit) Max(c Context) (max types.DataTypeExtreme)
- func (gl *DescribedLimit) Min(c Context) (min types.DataTypeExtreme)
- func (gl *DescribedLimit) NeedsParens(topLevel bool) bool
- type EmptyLimit
- func (c *EmptyLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *EmptyLimit) Clone() Limit
- func (c *EmptyLimit) DataModelString(dataType *types.DataType) string
- func (c *EmptyLimit) Equal(o Limit) bool
- func (c *EmptyLimit) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *EmptyLimit) MarshalJSON() ([]byte, error)
- func (c *EmptyLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (c *EmptyLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (c *EmptyLimit) NeedsParens(topLevel bool) bool
- type ExactConstraint
- func (c *ExactConstraint) ASCIIDocString(dataType *types.DataType) string
- func (c *ExactConstraint) Clone() Constraint
- func (c *ExactConstraint) Equal(o Constraint) bool
- func (c *ExactConstraint) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *ExactConstraint) MarshalJSON() ([]byte, error)
- func (c *ExactConstraint) Max(cc Context) (max types.DataTypeExtreme)
- func (c *ExactConstraint) Min(cc Context) (min types.DataTypeExtreme)
- func (c *ExactConstraint) NeedsParens(topLevel bool) bool
- func (c *ExactConstraint) Type() Type
- func (c *ExactConstraint) UnmarshalJSON(data []byte) (err error)
- type ExpLimit
- func (c *ExpLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *ExpLimit) Clone() Limit
- func (c *ExpLimit) DataModelString(dataType *types.DataType) string
- func (c *ExpLimit) Equal(o Limit) bool
- func (c *ExpLimit) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *ExpLimit) MarshalJSON() ([]byte, error)
- func (c *ExpLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (c *ExpLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (c *ExpLimit) NeedsParens(topLevel bool) bool
- type GenericConstraint
- func (c *GenericConstraint) ASCIIDocString(dataType *types.DataType) string
- func (c *GenericConstraint) Clone() Constraint
- func (c *GenericConstraint) Equal(o Constraint) bool
- func (c *GenericConstraint) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *GenericConstraint) MarshalJSON() ([]byte, error)
- func (c *GenericConstraint) Max(cc Context) (max types.DataTypeExtreme)
- func (c *GenericConstraint) Min(cc Context) (min types.DataTypeExtreme)
- func (c *GenericConstraint) NeedsParens(topLevel bool) bool
- func (c *GenericConstraint) Type() Type
- type GenericLimit
- func (gl *GenericLimit) ASCIIDocString(dataType *types.DataType) string
- func (gl *GenericLimit) Clone() Limit
- func (gl *GenericLimit) DataModelString(dataType *types.DataType) string
- func (gl *GenericLimit) Equal(o Limit) bool
- func (gl *GenericLimit) Fallback(c Context) (max types.DataTypeExtreme)
- func (gl *GenericLimit) Max(c Context) (max types.DataTypeExtreme)
- func (gl *GenericLimit) Min(c Context) (min types.DataTypeExtreme)
- func (gl *GenericLimit) NeedsParens(topLevel bool) bool
- type HexLimit
- func (c *HexLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *HexLimit) Clone() Limit
- func (c *HexLimit) DataModelString(dataType *types.DataType) string
- func (c *HexLimit) Equal(o Limit) bool
- func (c *HexLimit) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *HexLimit) MarshalJSON() ([]byte, error)
- func (c *HexLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (c *HexLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (c *HexLimit) NeedsParens(topLevel bool) bool
- type IdentifierLimit
- func (c *IdentifierLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *IdentifierLimit) Clone() Limit
- func (c *IdentifierLimit) DataModelString(dataType *types.DataType) string
- func (c *IdentifierLimit) Equal(o Limit) bool
- func (c *IdentifierLimit) Fallback(cc Context) (def types.DataTypeExtreme)
- func (c *IdentifierLimit) MarshalJSON() ([]byte, error)
- func (c *IdentifierLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (c *IdentifierLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (c *IdentifierLimit) NeedsParens(topLevel bool) bool
- type IntLimit
- func (c *IntLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *IntLimit) Clone() Limit
- func (c *IntLimit) DataModelString(dataType *types.DataType) string
- func (c *IntLimit) Equal(o Limit) bool
- func (c *IntLimit) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *IntLimit) MarshalJSON() ([]byte, error)
- func (c *IntLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (c *IntLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (c *IntLimit) NeedsParens(topLevel bool) bool
- type LengthLimit
- func (ll *LengthLimit) ASCIIDocString(dataType *types.DataType) string
- func (ll *LengthLimit) Clone() Limit
- func (ll *LengthLimit) DataModelString(dataType *types.DataType) string
- func (ll *LengthLimit) Equal(o Limit) bool
- func (ll *LengthLimit) Fallback(cc Context) (def types.DataTypeExtreme)
- func (ll *LengthLimit) MarshalJSON() ([]byte, error)
- func (ll *LengthLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (ll *LengthLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (ll *LengthLimit) NeedsParens(topLevel bool) bool
- type Limit
- type LimitSet
- func (ls LimitSet) ASCIIDocString(dataType *types.DataType, sb *strings.Builder)
- func (ls LimitSet) Clone() LimitSet
- func (ls LimitSet) DataModelString(dataType *types.DataType, sb *strings.Builder)
- func (ls LimitSet) Equal(o LimitSet) bool
- func (ls LimitSet) Max(c Context) (max types.DataTypeExtreme)
- func (ls LimitSet) Min(c Context) (min types.DataTypeExtreme)
- func (ls *LimitSet) UnmarshalJSON(data []byte) (err error)
- type ListConstraint
- func (c *ListConstraint) ASCIIDocString(dataType *types.DataType) string
- func (c *ListConstraint) Clone() Constraint
- func (c *ListConstraint) Equal(o Constraint) bool
- func (c *ListConstraint) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *ListConstraint) MarshalJSON() ([]byte, error)
- func (c *ListConstraint) Max(cc Context) (max types.DataTypeExtreme)
- func (c *ListConstraint) Min(cc Context) (min types.DataTypeExtreme)
- func (c *ListConstraint) NeedsParens(topLevel bool) bool
- func (c *ListConstraint) Type() Type
- func (c *ListConstraint) UnmarshalJSON(data []byte) (err error)
- type LogicalConstraint
- func (lc *LogicalConstraint) ASCIIDocString(dataType *types.DataType) string
- func (lc *LogicalConstraint) Clone() Constraint
- func (lc *LogicalConstraint) Equal(c Constraint) bool
- func (lc *LogicalConstraint) Max(c Context) (max types.DataTypeExtreme)
- func (lc *LogicalConstraint) Min(c Context) (min types.DataTypeExtreme)
- func (lc *LogicalConstraint) NeedsParens(topLevel bool) bool
- func (lc *LogicalConstraint) Type() Type
- type LogicalLimit
- func (ll *LogicalLimit) ASCIIDocString(dataType *types.DataType) string
- func (ll *LogicalLimit) Clone() Limit
- func (ll *LogicalLimit) DataModelString(dataType *types.DataType) string
- func (ll *LogicalLimit) Equal(l Limit) bool
- func (ll *LogicalLimit) Fallback(cc Context) (max types.DataTypeExtreme)
- func (le *LogicalLimit) MarshalJSON() ([]byte, error)
- func (ll *LogicalLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (ll *LogicalLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (ll *LogicalLimit) NeedsParens(topLevel bool) bool
- type ManufacturerLimit
- func (c *ManufacturerLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *ManufacturerLimit) Clone() Limit
- func (c *ManufacturerLimit) DataModelString(dataType *types.DataType) string
- func (c *ManufacturerLimit) Equal(o Limit) bool
- func (c *ManufacturerLimit) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *ManufacturerLimit) MarshalJSON() ([]byte, error)
- func (c *ManufacturerLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (c *ManufacturerLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (c *ManufacturerLimit) NeedsParens(topLevel bool) bool
- type MathExpressionLimit
- func (c *MathExpressionLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *MathExpressionLimit) Clone() Limit
- func (c *MathExpressionLimit) DataModelString(dataType *types.DataType) string
- func (c *MathExpressionLimit) Equal(o Limit) bool
- func (c *MathExpressionLimit) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *MathExpressionLimit) MarshalJSON() ([]byte, error)
- func (c *MathExpressionLimit) Max(cc Context) types.DataTypeExtreme
- func (c *MathExpressionLimit) Min(cc Context) types.DataTypeExtreme
- func (c *MathExpressionLimit) NeedsParens(topLevel bool) bool
- func (c *MathExpressionLimit) UnmarshalJSON(data []byte) (err error)
- type MaxConstraint
- func (c *MaxConstraint) ASCIIDocString(dataType *types.DataType) string
- func (c *MaxConstraint) Clone() Constraint
- func (c *MaxConstraint) Equal(o Constraint) bool
- func (c *MaxConstraint) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *MaxConstraint) MarshalJSON() ([]byte, error)
- func (c *MaxConstraint) Max(cc Context) (max types.DataTypeExtreme)
- func (c *MaxConstraint) Min(cc Context) (min types.DataTypeExtreme)
- func (c *MaxConstraint) NeedsParens(topLevel bool) bool
- func (c *MaxConstraint) Type() Type
- func (c *MaxConstraint) UnmarshalJSON(data []byte) (err error)
- type MaxOfLimit
- func (c *MaxOfLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *MaxOfLimit) Clone() Limit
- func (c *MaxOfLimit) DataModelString(dataType *types.DataType) string
- func (c *MaxOfLimit) Equal(o Limit) bool
- func (c *MaxOfLimit) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *MaxOfLimit) MarshalJSON() ([]byte, error)
- func (c *MaxOfLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (c *MaxOfLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (c *MaxOfLimit) NeedsParens(topLevel bool) bool
- func (c *MaxOfLimit) UnmarshalJSON(data []byte) (err error)
- type MinConstraint
- func (c *MinConstraint) ASCIIDocString(dataType *types.DataType) string
- func (c *MinConstraint) Clone() Constraint
- func (c *MinConstraint) Equal(o Constraint) bool
- func (c *MinConstraint) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *MinConstraint) MarshalJSON() ([]byte, error)
- func (c *MinConstraint) Max(cc Context) (max types.DataTypeExtreme)
- func (c *MinConstraint) Min(cc Context) (min types.DataTypeExtreme)
- func (c *MinConstraint) NeedsParens(topLevel bool) bool
- func (c *MinConstraint) Type() Type
- func (c *MinConstraint) UnmarshalJSON(data []byte) (err error)
- type MinOfLimit
- func (c *MinOfLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *MinOfLimit) Clone() Limit
- func (c *MinOfLimit) DataModelString(dataType *types.DataType) string
- func (c *MinOfLimit) Equal(o Limit) bool
- func (c *MinOfLimit) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *MinOfLimit) MarshalJSON() ([]byte, error)
- func (c *MinOfLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (c *MinOfLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (c *MinOfLimit) NeedsParens(topLevel bool) bool
- func (c *MinOfLimit) UnmarshalJSON(data []byte) (err error)
- type NullLimit
- func (c *NullLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *NullLimit) Clone() Limit
- func (c *NullLimit) DataModelString(dataType *types.DataType) string
- func (c *NullLimit) Equal(o Limit) bool
- func (c *NullLimit) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *NullLimit) MarshalJSON() ([]byte, error)
- func (c *NullLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (c *NullLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (c *NullLimit) NeedsParens(topLevel bool) bool
- type Number
- type Option
- type PercentLimit
- func (c *PercentLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *PercentLimit) Clone() Limit
- func (c *PercentLimit) DataModelString(dataType *types.DataType) string
- func (c *PercentLimit) Equal(o Limit) bool
- func (c *PercentLimit) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *PercentLimit) MarshalJSON() ([]byte, error)
- func (c *PercentLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (c *PercentLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (c *PercentLimit) NeedsParens(topLevel bool) bool
- type RangeConstraint
- func (c *RangeConstraint) ASCIIDocString(dataType *types.DataType) string
- func (c *RangeConstraint) Clone() Constraint
- func (c *RangeConstraint) Equal(o Constraint) bool
- func (c *RangeConstraint) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *RangeConstraint) MarshalJSON() ([]byte, error)
- func (c *RangeConstraint) Max(cc Context) (to types.DataTypeExtreme)
- func (c *RangeConstraint) Min(cc Context) (from types.DataTypeExtreme)
- func (c *RangeConstraint) NeedsParens(topLevel bool) bool
- func (c *RangeConstraint) Type() Type
- func (c *RangeConstraint) UnmarshalJSON(data []byte) (err error)
- type ReferenceLimit
- func (c *ReferenceLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *ReferenceLimit) Clone() Limit
- func (c *ReferenceLimit) DataModelString(dataType *types.DataType) string
- func (c *ReferenceLimit) Equal(o Limit) bool
- func (c *ReferenceLimit) Fallback(cc Context) (def types.DataTypeExtreme)
- func (c *ReferenceLimit) MarshalJSON() ([]byte, error)
- func (c *ReferenceLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (c *ReferenceLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (c *ReferenceLimit) NeedsParens(topLevel bool) bool
- type Set
- func (cs Set) ASCIIDocString(dataType *types.DataType) string
- func (cs Set) Clone() Constraint
- func (cs Set) Equal(o Constraint) bool
- func (cs Set) Fallback(cc Context) (max types.DataTypeExtreme)
- func (cs Set) Max(c Context) (max types.DataTypeExtreme)
- func (cs Set) Min(c Context) (min types.DataTypeExtreme)
- func (cs Set) NeedsParens(topLevel bool) bool
- func (cs Set) Type() Type
- func (cs *Set) UnmarshalJSON(data []byte) (err error)
- type Stats
- type StatusCodeLimit
- func (c *StatusCodeLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *StatusCodeLimit) Clone() Limit
- func (c *StatusCodeLimit) DataModelString(dataType *types.DataType) string
- func (c *StatusCodeLimit) Equal(o Limit) bool
- func (c *StatusCodeLimit) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *StatusCodeLimit) MarshalJSON() ([]byte, error)
- func (c *StatusCodeLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (c *StatusCodeLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (c *StatusCodeLimit) NeedsParens(topLevel bool) bool
- type StringLimit
- func (c *StringLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *StringLimit) Clone() Limit
- func (c *StringLimit) DataModelString(dataType *types.DataType) string
- func (c *StringLimit) Equal(o Limit) bool
- func (c *StringLimit) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *StringLimit) MarshalJSON() ([]byte, error)
- func (c *StringLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (c *StringLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (c *StringLimit) NeedsParens(topLevel bool) bool
- type TagIdentifierLimit
- func (c *TagIdentifierLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *TagIdentifierLimit) Clone() Limit
- func (c *TagIdentifierLimit) DataModelString(dataType *types.DataType) string
- func (c *TagIdentifierLimit) Equal(o Limit) bool
- func (c *TagIdentifierLimit) Fallback(cc Context) (def types.DataTypeExtreme)
- func (c *TagIdentifierLimit) MarshalJSON() ([]byte, error)
- func (c *TagIdentifierLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (c *TagIdentifierLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (c *TagIdentifierLimit) NeedsParens(topLevel bool) bool
- type TagListConstraint
- func (tlc *TagListConstraint) ASCIIDocString(dataType *types.DataType) string
- func (tlc *TagListConstraint) Clone() Constraint
- func (tlc *TagListConstraint) Equal(o Constraint) bool
- func (tlc *TagListConstraint) Max(c Context) (max types.DataTypeExtreme)
- func (tlc *TagListConstraint) Min(c Context) (min types.DataTypeExtreme)
- func (tlc *TagListConstraint) NeedsParens(topLevel bool) bool
- func (tlc *TagListConstraint) Type() Type
- type TemperatureLimit
- func (c *TemperatureLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *TemperatureLimit) Clone() Limit
- func (c *TemperatureLimit) DataModelString(dataType *types.DataType) string
- func (c *TemperatureLimit) Equal(o Limit) bool
- func (c *TemperatureLimit) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *TemperatureLimit) MarshalJSON() ([]byte, error)
- func (c *TemperatureLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (c *TemperatureLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (c *TemperatureLimit) NeedsParens(topLevel bool) bool
- type Type
- type UnspecifiedLimit
- func (c *UnspecifiedLimit) ASCIIDocString(dataType *types.DataType) string
- func (c *UnspecifiedLimit) Clone() Limit
- func (c *UnspecifiedLimit) DataModelString(dataType *types.DataType) string
- func (c *UnspecifiedLimit) Equal(o Limit) bool
- func (c *UnspecifiedLimit) Fallback(cc Context) (max types.DataTypeExtreme)
- func (c *UnspecifiedLimit) MarshalJSON() ([]byte, error)
- func (c *UnspecifiedLimit) Max(cc Context) (max types.DataTypeExtreme)
- func (c *UnspecifiedLimit) Min(cc Context) (min types.DataTypeExtreme)
- func (c *UnspecifiedLimit) NeedsParens(topLevel bool) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAllOrEmpty ¶
func IsAllOrEmpty(c Constraint) bool
func IsBlank ¶
func IsBlank(c Constraint) bool
func IsBlankLimit ¶
func IsGeneric ¶
func IsGeneric(c Constraint) bool
func IsGenericLimit ¶
func IsNull ¶
func IsNull(c Constraint) bool
func IsNullLimit ¶
Types ¶
type AllConstraint ¶
type AllConstraint struct {
Value string `json:"value"`
}
func NewAllConstraint ¶
func NewAllConstraint(value string) *AllConstraint
func (*AllConstraint) ASCIIDocString ¶
func (c *AllConstraint) ASCIIDocString(dataType *types.DataType) string
func (*AllConstraint) Clone ¶
func (c *AllConstraint) Clone() Constraint
func (*AllConstraint) Equal ¶
func (c *AllConstraint) Equal(o Constraint) bool
func (*AllConstraint) Fallback ¶
func (c *AllConstraint) Fallback(cc Context) (max types.DataTypeExtreme)
func (*AllConstraint) MarshalJSON ¶
func (c *AllConstraint) MarshalJSON() ([]byte, error)
func (*AllConstraint) Max ¶
func (c *AllConstraint) Max(cc Context) (max types.DataTypeExtreme)
func (*AllConstraint) Min ¶
func (c *AllConstraint) Min(cc Context) (min types.DataTypeExtreme)
func (*AllConstraint) NeedsParens ¶
func (c *AllConstraint) NeedsParens(topLevel bool) bool
func (*AllConstraint) Type ¶
func (c *AllConstraint) Type() Type
type BooleanLimit ¶
type BooleanLimit struct {
Value bool `json:"value"`
}
func (*BooleanLimit) ASCIIDocString ¶
func (c *BooleanLimit) ASCIIDocString(dataType *types.DataType) string
func (*BooleanLimit) Clone ¶
func (c *BooleanLimit) Clone() Limit
func (*BooleanLimit) DataModelString ¶
func (c *BooleanLimit) DataModelString(dataType *types.DataType) string
func (*BooleanLimit) Equal ¶
func (c *BooleanLimit) Equal(o Limit) bool
func (*BooleanLimit) Fallback ¶
func (c *BooleanLimit) Fallback(cc Context) (max types.DataTypeExtreme)
func (*BooleanLimit) MarshalJSON ¶
func (c *BooleanLimit) MarshalJSON() ([]byte, error)
func (*BooleanLimit) Max ¶
func (c *BooleanLimit) Max(cc Context) (max types.DataTypeExtreme)
func (*BooleanLimit) Min ¶
func (c *BooleanLimit) Min(cc Context) (min types.DataTypeExtreme)
func (*BooleanLimit) NeedsParens ¶
func (c *BooleanLimit) NeedsParens(topLevel bool) bool
type CharacterLimit ¶
type CharacterLimit struct {
ByteCount Limit `json:"byteCount"`
CodepointCount Limit `json:"codepointCount"`
}
func (*CharacterLimit) ASCIIDocString ¶
func (c *CharacterLimit) ASCIIDocString(dataType *types.DataType) string
func (*CharacterLimit) Clone ¶
func (c *CharacterLimit) Clone() Limit
func (*CharacterLimit) DataModelString ¶
func (c *CharacterLimit) DataModelString(dataType *types.DataType) string
func (*CharacterLimit) Equal ¶
func (c *CharacterLimit) Equal(o Limit) bool
func (*CharacterLimit) Fallback ¶
func (c *CharacterLimit) Fallback(cc Context) (max types.DataTypeExtreme)
func (*CharacterLimit) MarshalJSON ¶
func (c *CharacterLimit) MarshalJSON() ([]byte, error)
func (*CharacterLimit) Max ¶
func (c *CharacterLimit) Max(cc Context) (max types.DataTypeExtreme)
func (*CharacterLimit) Min ¶
func (c *CharacterLimit) Min(cc Context) (min types.DataTypeExtreme)
func (*CharacterLimit) NeedsParens ¶
func (c *CharacterLimit) NeedsParens(topLevel bool) bool
type Constraint ¶
type Constraint interface {
Type() Type
ASCIIDocString(dataType *types.DataType) string
Equal(o Constraint) bool
Min(c Context) (min types.DataTypeExtreme)
Max(c Context) (max types.DataTypeExtreme)
NeedsParens(topLevel bool) bool
Clone() Constraint
}
func AppendConstraint ¶
func AppendConstraint(c Constraint, n ...Constraint) Constraint
func ParseString ¶
func ParseString(constraint string) Constraint
func TryParseString ¶
func TryParseString(constraint string) (Constraint, error)
func UnmarshalConstraint ¶
func UnmarshalConstraint(raw json.RawMessage) (c Constraint, err error)
type DescribedConstraint ¶
type DescribedConstraint struct {
}
func (*DescribedConstraint) ASCIIDocString ¶
func (c *DescribedConstraint) ASCIIDocString(dataType *types.DataType) string
func (*DescribedConstraint) Clone ¶
func (c *DescribedConstraint) Clone() Constraint
func (*DescribedConstraint) Equal ¶
func (c *DescribedConstraint) Equal(o Constraint) bool
func (*DescribedConstraint) Fallback ¶
func (c *DescribedConstraint) Fallback(cc Context) (max types.DataTypeExtreme)
func (*DescribedConstraint) MarshalJSON ¶
func (c *DescribedConstraint) MarshalJSON() ([]byte, error)
func (*DescribedConstraint) Max ¶
func (c *DescribedConstraint) Max(cc Context) (max types.DataTypeExtreme)
func (*DescribedConstraint) Min ¶
func (c *DescribedConstraint) Min(cc Context) (min types.DataTypeExtreme)
func (*DescribedConstraint) NeedsParens ¶
func (c *DescribedConstraint) NeedsParens(topLevel bool) bool
func (*DescribedConstraint) Type ¶
func (c *DescribedConstraint) Type() Type
type DescribedLimit ¶ added in v1.6.0
type DescribedLimit struct {
}
func (*DescribedLimit) ASCIIDocString ¶ added in v1.6.0
func (gl *DescribedLimit) ASCIIDocString(dataType *types.DataType) string
func (*DescribedLimit) Clone ¶ added in v1.6.0
func (gl *DescribedLimit) Clone() Limit
func (*DescribedLimit) DataModelString ¶ added in v1.6.0
func (gl *DescribedLimit) DataModelString(dataType *types.DataType) string
func (*DescribedLimit) Equal ¶ added in v1.6.0
func (gl *DescribedLimit) Equal(o Limit) bool
func (*DescribedLimit) Fallback ¶ added in v1.6.0
func (gl *DescribedLimit) Fallback(c Context) (max types.DataTypeExtreme)
func (*DescribedLimit) Max ¶ added in v1.6.0
func (gl *DescribedLimit) Max(c Context) (max types.DataTypeExtreme)
func (*DescribedLimit) Min ¶ added in v1.6.0
func (gl *DescribedLimit) Min(c Context) (min types.DataTypeExtreme)
func (*DescribedLimit) NeedsParens ¶ added in v1.6.0
func (gl *DescribedLimit) NeedsParens(topLevel bool) bool
type EmptyLimit ¶
type EmptyLimit struct {
}
func (*EmptyLimit) ASCIIDocString ¶
func (c *EmptyLimit) ASCIIDocString(dataType *types.DataType) string
func (*EmptyLimit) Clone ¶
func (c *EmptyLimit) Clone() Limit
func (*EmptyLimit) DataModelString ¶
func (c *EmptyLimit) DataModelString(dataType *types.DataType) string
func (*EmptyLimit) Equal ¶
func (c *EmptyLimit) Equal(o Limit) bool
func (*EmptyLimit) Fallback ¶
func (c *EmptyLimit) Fallback(cc Context) (max types.DataTypeExtreme)
func (*EmptyLimit) MarshalJSON ¶
func (c *EmptyLimit) MarshalJSON() ([]byte, error)
func (*EmptyLimit) Max ¶
func (c *EmptyLimit) Max(cc Context) (max types.DataTypeExtreme)
func (*EmptyLimit) Min ¶
func (c *EmptyLimit) Min(cc Context) (min types.DataTypeExtreme)
func (*EmptyLimit) NeedsParens ¶
func (c *EmptyLimit) NeedsParens(topLevel bool) bool
type ExactConstraint ¶
type ExactConstraint struct {
Value Limit `json:"value"`
}
func (*ExactConstraint) ASCIIDocString ¶
func (c *ExactConstraint) ASCIIDocString(dataType *types.DataType) string
func (*ExactConstraint) Clone ¶
func (c *ExactConstraint) Clone() Constraint
func (*ExactConstraint) Equal ¶
func (c *ExactConstraint) Equal(o Constraint) bool
func (*ExactConstraint) Fallback ¶
func (c *ExactConstraint) Fallback(cc Context) (max types.DataTypeExtreme)
func (*ExactConstraint) MarshalJSON ¶
func (c *ExactConstraint) MarshalJSON() ([]byte, error)
func (*ExactConstraint) Max ¶
func (c *ExactConstraint) Max(cc Context) (max types.DataTypeExtreme)
func (*ExactConstraint) Min ¶
func (c *ExactConstraint) Min(cc Context) (min types.DataTypeExtreme)
func (*ExactConstraint) NeedsParens ¶
func (c *ExactConstraint) NeedsParens(topLevel bool) bool
func (*ExactConstraint) Type ¶
func (c *ExactConstraint) Type() Type
func (*ExactConstraint) UnmarshalJSON ¶
func (c *ExactConstraint) UnmarshalJSON(data []byte) (err error)
type ExpLimit ¶
func (*ExpLimit) ASCIIDocString ¶
func (*ExpLimit) DataModelString ¶
func (*ExpLimit) MarshalJSON ¶
func (*ExpLimit) NeedsParens ¶
type GenericConstraint ¶
type GenericConstraint struct {
Value string `json:"value"`
}
func (*GenericConstraint) ASCIIDocString ¶
func (c *GenericConstraint) ASCIIDocString(dataType *types.DataType) string
func (*GenericConstraint) Clone ¶
func (c *GenericConstraint) Clone() Constraint
func (*GenericConstraint) Equal ¶
func (c *GenericConstraint) Equal(o Constraint) bool
func (*GenericConstraint) Fallback ¶
func (c *GenericConstraint) Fallback(cc Context) (max types.DataTypeExtreme)
func (*GenericConstraint) MarshalJSON ¶
func (c *GenericConstraint) MarshalJSON() ([]byte, error)
func (*GenericConstraint) Max ¶
func (c *GenericConstraint) Max(cc Context) (max types.DataTypeExtreme)
func (*GenericConstraint) Min ¶
func (c *GenericConstraint) Min(cc Context) (min types.DataTypeExtreme)
func (*GenericConstraint) NeedsParens ¶
func (c *GenericConstraint) NeedsParens(topLevel bool) bool
func (*GenericConstraint) Type ¶
func (c *GenericConstraint) Type() Type
type GenericLimit ¶
type GenericLimit struct {
Value string `json:"value"`
}
func (*GenericLimit) ASCIIDocString ¶
func (gl *GenericLimit) ASCIIDocString(dataType *types.DataType) string
func (*GenericLimit) Clone ¶
func (gl *GenericLimit) Clone() Limit
func (*GenericLimit) DataModelString ¶
func (gl *GenericLimit) DataModelString(dataType *types.DataType) string
func (*GenericLimit) Equal ¶
func (gl *GenericLimit) Equal(o Limit) bool
func (*GenericLimit) Fallback ¶
func (gl *GenericLimit) Fallback(c Context) (max types.DataTypeExtreme)
func (*GenericLimit) Max ¶
func (gl *GenericLimit) Max(c Context) (max types.DataTypeExtreme)
func (*GenericLimit) Min ¶
func (gl *GenericLimit) Min(c Context) (min types.DataTypeExtreme)
func (*GenericLimit) NeedsParens ¶
func (gl *GenericLimit) NeedsParens(topLevel bool) bool
type HexLimit ¶
type HexLimit struct {
Value uint64 `json:"value"`
}
func (*HexLimit) ASCIIDocString ¶
func (*HexLimit) DataModelString ¶
func (*HexLimit) MarshalJSON ¶
func (*HexLimit) NeedsParens ¶
type IdentifierLimit ¶
type IdentifierLimit struct {
ID string `json:"id"`
Not bool `json:"not,omitempty"`
Entity types.Entity
Field Limit `json:"field,omitempty"`
}
func (*IdentifierLimit) ASCIIDocString ¶
func (c *IdentifierLimit) ASCIIDocString(dataType *types.DataType) string
func (*IdentifierLimit) Clone ¶
func (c *IdentifierLimit) Clone() Limit
func (*IdentifierLimit) DataModelString ¶
func (c *IdentifierLimit) DataModelString(dataType *types.DataType) string
func (*IdentifierLimit) Equal ¶
func (c *IdentifierLimit) Equal(o Limit) bool
func (*IdentifierLimit) Fallback ¶
func (c *IdentifierLimit) Fallback(cc Context) (def types.DataTypeExtreme)
func (*IdentifierLimit) MarshalJSON ¶
func (c *IdentifierLimit) MarshalJSON() ([]byte, error)
func (*IdentifierLimit) Max ¶
func (c *IdentifierLimit) Max(cc Context) (max types.DataTypeExtreme)
func (*IdentifierLimit) Min ¶
func (c *IdentifierLimit) Min(cc Context) (min types.DataTypeExtreme)
func (*IdentifierLimit) NeedsParens ¶
func (c *IdentifierLimit) NeedsParens(topLevel bool) bool
type IntLimit ¶
type IntLimit struct {
Value int64 `json:"value"`
}
func (*IntLimit) ASCIIDocString ¶
func (*IntLimit) DataModelString ¶
func (*IntLimit) MarshalJSON ¶
func (*IntLimit) NeedsParens ¶
type LengthLimit ¶
type LengthLimit struct {
Reference Limit `json:"ref"`
}
func (*LengthLimit) ASCIIDocString ¶
func (ll *LengthLimit) ASCIIDocString(dataType *types.DataType) string
func (*LengthLimit) Clone ¶
func (ll *LengthLimit) Clone() Limit
func (*LengthLimit) DataModelString ¶
func (ll *LengthLimit) DataModelString(dataType *types.DataType) string
func (*LengthLimit) Equal ¶
func (ll *LengthLimit) Equal(o Limit) bool
func (*LengthLimit) Fallback ¶
func (ll *LengthLimit) Fallback(cc Context) (def types.DataTypeExtreme)
func (*LengthLimit) MarshalJSON ¶
func (ll *LengthLimit) MarshalJSON() ([]byte, error)
func (*LengthLimit) Max ¶
func (ll *LengthLimit) Max(cc Context) (max types.DataTypeExtreme)
func (*LengthLimit) Min ¶
func (ll *LengthLimit) Min(cc Context) (min types.DataTypeExtreme)
func (*LengthLimit) NeedsParens ¶
func (ll *LengthLimit) NeedsParens(topLevel bool) bool
type Limit ¶
type Limit interface {
ASCIIDocString(dataType *types.DataType) string
DataModelString(dataType *types.DataType) string
Equal(o Limit) bool
Min(c Context) (min types.DataTypeExtreme)
Max(c Context) (max types.DataTypeExtreme)
Fallback(c Context) (max types.DataTypeExtreme)
NeedsParens(topLevel bool) bool
Clone() Limit
}
func ParseLimit ¶
func TryParseLimit ¶
func UnmarshalLimit ¶
func UnmarshalLimit(raw json.RawMessage) (cl Limit, err error)
type LimitSet ¶
type LimitSet []Limit
func (LimitSet) ASCIIDocString ¶
func (LimitSet) DataModelString ¶
func (*LimitSet) UnmarshalJSON ¶
type ListConstraint ¶
type ListConstraint struct {
Constraint Constraint
EntryConstraint Constraint
}
func (*ListConstraint) ASCIIDocString ¶
func (c *ListConstraint) ASCIIDocString(dataType *types.DataType) string
func (*ListConstraint) Clone ¶
func (c *ListConstraint) Clone() Constraint
func (*ListConstraint) Equal ¶
func (c *ListConstraint) Equal(o Constraint) bool
func (*ListConstraint) Fallback ¶
func (c *ListConstraint) Fallback(cc Context) (max types.DataTypeExtreme)
func (*ListConstraint) MarshalJSON ¶
func (c *ListConstraint) MarshalJSON() ([]byte, error)
func (*ListConstraint) Max ¶
func (c *ListConstraint) Max(cc Context) (max types.DataTypeExtreme)
func (*ListConstraint) Min ¶
func (c *ListConstraint) Min(cc Context) (min types.DataTypeExtreme)
func (*ListConstraint) NeedsParens ¶
func (c *ListConstraint) NeedsParens(topLevel bool) bool
func (*ListConstraint) Type ¶
func (c *ListConstraint) Type() Type
func (*ListConstraint) UnmarshalJSON ¶
func (c *ListConstraint) UnmarshalJSON(data []byte) (err error)
type LogicalConstraint ¶
type LogicalConstraint struct {
Operand string
Left Constraint
Right []Constraint
Not bool
}
func NewLogicalConstraint ¶
func NewLogicalConstraint(operand string, left Constraint, right []any) (*LogicalConstraint, error)
func (*LogicalConstraint) ASCIIDocString ¶
func (lc *LogicalConstraint) ASCIIDocString(dataType *types.DataType) string
func (*LogicalConstraint) Clone ¶
func (lc *LogicalConstraint) Clone() Constraint
func (*LogicalConstraint) Equal ¶
func (lc *LogicalConstraint) Equal(c Constraint) bool
func (*LogicalConstraint) Max ¶
func (lc *LogicalConstraint) Max(c Context) (max types.DataTypeExtreme)
func (*LogicalConstraint) Min ¶
func (lc *LogicalConstraint) Min(c Context) (min types.DataTypeExtreme)
func (*LogicalConstraint) NeedsParens ¶
func (lc *LogicalConstraint) NeedsParens(topLevel bool) bool
func (*LogicalConstraint) Type ¶
func (lc *LogicalConstraint) Type() Type
type LogicalLimit ¶
func NewLogicalLimit ¶
func NewLogicalLimit(operand string, left Limit, right []any) (*LogicalLimit, error)
func (*LogicalLimit) ASCIIDocString ¶
func (ll *LogicalLimit) ASCIIDocString(dataType *types.DataType) string
func (*LogicalLimit) Clone ¶
func (ll *LogicalLimit) Clone() Limit
func (*LogicalLimit) DataModelString ¶
func (ll *LogicalLimit) DataModelString(dataType *types.DataType) string
func (*LogicalLimit) Equal ¶
func (ll *LogicalLimit) Equal(l Limit) bool
func (*LogicalLimit) Fallback ¶
func (ll *LogicalLimit) Fallback(cc Context) (max types.DataTypeExtreme)
func (*LogicalLimit) MarshalJSON ¶
func (le *LogicalLimit) MarshalJSON() ([]byte, error)
func (*LogicalLimit) Max ¶
func (ll *LogicalLimit) Max(cc Context) (max types.DataTypeExtreme)
func (*LogicalLimit) Min ¶
func (ll *LogicalLimit) Min(cc Context) (min types.DataTypeExtreme)
func (*LogicalLimit) NeedsParens ¶
func (ll *LogicalLimit) NeedsParens(topLevel bool) bool
type ManufacturerLimit ¶
type ManufacturerLimit struct {
Value string `json:"value,omitempty"`
}
func (*ManufacturerLimit) ASCIIDocString ¶
func (c *ManufacturerLimit) ASCIIDocString(dataType *types.DataType) string
func (*ManufacturerLimit) Clone ¶
func (c *ManufacturerLimit) Clone() Limit
func (*ManufacturerLimit) DataModelString ¶
func (c *ManufacturerLimit) DataModelString(dataType *types.DataType) string
func (*ManufacturerLimit) Equal ¶
func (c *ManufacturerLimit) Equal(o Limit) bool
func (*ManufacturerLimit) Fallback ¶
func (c *ManufacturerLimit) Fallback(cc Context) (max types.DataTypeExtreme)
func (*ManufacturerLimit) MarshalJSON ¶
func (c *ManufacturerLimit) MarshalJSON() ([]byte, error)
func (*ManufacturerLimit) Max ¶
func (c *ManufacturerLimit) Max(cc Context) (max types.DataTypeExtreme)
func (*ManufacturerLimit) Min ¶
func (c *ManufacturerLimit) Min(cc Context) (min types.DataTypeExtreme)
func (*ManufacturerLimit) NeedsParens ¶
func (c *ManufacturerLimit) NeedsParens(topLevel bool) bool
type MathExpressionLimit ¶
func (*MathExpressionLimit) ASCIIDocString ¶
func (c *MathExpressionLimit) ASCIIDocString(dataType *types.DataType) string
func (*MathExpressionLimit) Clone ¶
func (c *MathExpressionLimit) Clone() Limit
func (*MathExpressionLimit) DataModelString ¶
func (c *MathExpressionLimit) DataModelString(dataType *types.DataType) string
func (*MathExpressionLimit) Equal ¶
func (c *MathExpressionLimit) Equal(o Limit) bool
func (*MathExpressionLimit) Fallback ¶
func (c *MathExpressionLimit) Fallback(cc Context) (max types.DataTypeExtreme)
func (*MathExpressionLimit) MarshalJSON ¶
func (c *MathExpressionLimit) MarshalJSON() ([]byte, error)
func (*MathExpressionLimit) Max ¶
func (c *MathExpressionLimit) Max(cc Context) types.DataTypeExtreme
func (*MathExpressionLimit) Min ¶
func (c *MathExpressionLimit) Min(cc Context) types.DataTypeExtreme
func (*MathExpressionLimit) NeedsParens ¶
func (c *MathExpressionLimit) NeedsParens(topLevel bool) bool
func (*MathExpressionLimit) UnmarshalJSON ¶
func (c *MathExpressionLimit) UnmarshalJSON(data []byte) (err error)
type MaxConstraint ¶
type MaxConstraint struct {
Maximum Limit
}
func (*MaxConstraint) ASCIIDocString ¶
func (c *MaxConstraint) ASCIIDocString(dataType *types.DataType) string
func (*MaxConstraint) Clone ¶
func (c *MaxConstraint) Clone() Constraint
func (*MaxConstraint) Equal ¶
func (c *MaxConstraint) Equal(o Constraint) bool
func (*MaxConstraint) Fallback ¶
func (c *MaxConstraint) Fallback(cc Context) (max types.DataTypeExtreme)
func (*MaxConstraint) MarshalJSON ¶
func (c *MaxConstraint) MarshalJSON() ([]byte, error)
func (*MaxConstraint) Max ¶
func (c *MaxConstraint) Max(cc Context) (max types.DataTypeExtreme)
func (*MaxConstraint) Min ¶
func (c *MaxConstraint) Min(cc Context) (min types.DataTypeExtreme)
func (*MaxConstraint) NeedsParens ¶
func (c *MaxConstraint) NeedsParens(topLevel bool) bool
func (*MaxConstraint) Type ¶
func (c *MaxConstraint) Type() Type
func (*MaxConstraint) UnmarshalJSON ¶
func (c *MaxConstraint) UnmarshalJSON(data []byte) (err error)
type MaxOfLimit ¶
type MaxOfLimit struct {
Maximums LimitSet `json:"maximums"`
}
func (*MaxOfLimit) ASCIIDocString ¶
func (c *MaxOfLimit) ASCIIDocString(dataType *types.DataType) string
func (*MaxOfLimit) Clone ¶
func (c *MaxOfLimit) Clone() Limit
func (*MaxOfLimit) DataModelString ¶
func (c *MaxOfLimit) DataModelString(dataType *types.DataType) string
func (*MaxOfLimit) Equal ¶
func (c *MaxOfLimit) Equal(o Limit) bool
func (*MaxOfLimit) Fallback ¶
func (c *MaxOfLimit) Fallback(cc Context) (max types.DataTypeExtreme)
func (*MaxOfLimit) MarshalJSON ¶
func (c *MaxOfLimit) MarshalJSON() ([]byte, error)
func (*MaxOfLimit) Max ¶
func (c *MaxOfLimit) Max(cc Context) (max types.DataTypeExtreme)
func (*MaxOfLimit) Min ¶
func (c *MaxOfLimit) Min(cc Context) (min types.DataTypeExtreme)
func (*MaxOfLimit) NeedsParens ¶
func (c *MaxOfLimit) NeedsParens(topLevel bool) bool
func (*MaxOfLimit) UnmarshalJSON ¶
func (c *MaxOfLimit) UnmarshalJSON(data []byte) (err error)
type MinConstraint ¶
type MinConstraint struct {
Minimum Limit `json:"min"`
}
func (*MinConstraint) ASCIIDocString ¶
func (c *MinConstraint) ASCIIDocString(dataType *types.DataType) string
func (*MinConstraint) Clone ¶
func (c *MinConstraint) Clone() Constraint
func (*MinConstraint) Equal ¶
func (c *MinConstraint) Equal(o Constraint) bool
func (*MinConstraint) Fallback ¶
func (c *MinConstraint) Fallback(cc Context) (max types.DataTypeExtreme)
func (*MinConstraint) MarshalJSON ¶
func (c *MinConstraint) MarshalJSON() ([]byte, error)
func (*MinConstraint) Max ¶
func (c *MinConstraint) Max(cc Context) (max types.DataTypeExtreme)
func (*MinConstraint) Min ¶
func (c *MinConstraint) Min(cc Context) (min types.DataTypeExtreme)
func (*MinConstraint) NeedsParens ¶
func (c *MinConstraint) NeedsParens(topLevel bool) bool
func (*MinConstraint) Type ¶
func (c *MinConstraint) Type() Type
func (*MinConstraint) UnmarshalJSON ¶
func (c *MinConstraint) UnmarshalJSON(data []byte) (err error)
type MinOfLimit ¶
type MinOfLimit struct {
Minimums LimitSet `json:"minimums"`
}
func (*MinOfLimit) ASCIIDocString ¶
func (c *MinOfLimit) ASCIIDocString(dataType *types.DataType) string
func (*MinOfLimit) Clone ¶
func (c *MinOfLimit) Clone() Limit
func (*MinOfLimit) DataModelString ¶
func (c *MinOfLimit) DataModelString(dataType *types.DataType) string
func (*MinOfLimit) Equal ¶
func (c *MinOfLimit) Equal(o Limit) bool
func (*MinOfLimit) Fallback ¶
func (c *MinOfLimit) Fallback(cc Context) (max types.DataTypeExtreme)
func (*MinOfLimit) MarshalJSON ¶
func (c *MinOfLimit) MarshalJSON() ([]byte, error)
func (*MinOfLimit) Max ¶
func (c *MinOfLimit) Max(cc Context) (max types.DataTypeExtreme)
func (*MinOfLimit) Min ¶
func (c *MinOfLimit) Min(cc Context) (min types.DataTypeExtreme)
func (*MinOfLimit) NeedsParens ¶
func (c *MinOfLimit) NeedsParens(topLevel bool) bool
func (*MinOfLimit) UnmarshalJSON ¶
func (c *MinOfLimit) UnmarshalJSON(data []byte) (err error)
type NullLimit ¶
type NullLimit struct {
}
func (*NullLimit) ASCIIDocString ¶
func (*NullLimit) DataModelString ¶
func (*NullLimit) MarshalJSON ¶
func (*NullLimit) NeedsParens ¶
type Option ¶
type Option func(*parser) Option
Option is a function that can set an option on the parser. It returns the previous setting as an Option.
func AllowInvalidUTF8 ¶
AllowInvalidUTF8 creates an Option to allow invalid UTF-8 bytes. Every invalid UTF-8 byte is treated as a utf8.RuneError (U+FFFD) by character class matchers and is matched by the any matcher. The returned matched value, c.text and c.offset are NOT affected.
The default is false.
func Entrypoint ¶
Entrypoint creates an Option to set the rule name to use as entrypoint. The rule name must have been specified in the -alternate-entrypoints if generating the parser with the -optimize-grammar flag, otherwise it may have been optimized out. Passing an empty string sets the entrypoint to the first rule in the grammar.
The default is to start parsing at the first rule in the grammar.
func GlobalStore ¶
GlobalStore creates an Option to set a key to a certain value in the globalStore.
func MaxExpressions ¶
MaxExpressions creates an Option to stop parsing after the provided number of expressions have been parsed, if the value is 0 then the parser will parse for as many steps as needed (possibly an infinite number).
The default for maxExprCnt is 0.
type PercentLimit ¶
type PercentLimit struct {
Value decimal.Decimal `json:"value"`
Hundredths bool `json:"hundredths,omitempty"`
}
func (*PercentLimit) ASCIIDocString ¶
func (c *PercentLimit) ASCIIDocString(dataType *types.DataType) string
func (*PercentLimit) Clone ¶
func (c *PercentLimit) Clone() Limit
func (*PercentLimit) DataModelString ¶
func (c *PercentLimit) DataModelString(dataType *types.DataType) string
func (*PercentLimit) Equal ¶
func (c *PercentLimit) Equal(o Limit) bool
func (*PercentLimit) Fallback ¶
func (c *PercentLimit) Fallback(cc Context) (max types.DataTypeExtreme)
func (*PercentLimit) MarshalJSON ¶
func (c *PercentLimit) MarshalJSON() ([]byte, error)
func (*PercentLimit) Max ¶
func (c *PercentLimit) Max(cc Context) (max types.DataTypeExtreme)
func (*PercentLimit) Min ¶
func (c *PercentLimit) Min(cc Context) (min types.DataTypeExtreme)
func (*PercentLimit) NeedsParens ¶
func (c *PercentLimit) NeedsParens(topLevel bool) bool
type RangeConstraint ¶
func (*RangeConstraint) ASCIIDocString ¶
func (c *RangeConstraint) ASCIIDocString(dataType *types.DataType) string
func (*RangeConstraint) Clone ¶
func (c *RangeConstraint) Clone() Constraint
func (*RangeConstraint) Equal ¶
func (c *RangeConstraint) Equal(o Constraint) bool
func (*RangeConstraint) Fallback ¶
func (c *RangeConstraint) Fallback(cc Context) (max types.DataTypeExtreme)
func (*RangeConstraint) MarshalJSON ¶
func (c *RangeConstraint) MarshalJSON() ([]byte, error)
func (*RangeConstraint) Max ¶
func (c *RangeConstraint) Max(cc Context) (to types.DataTypeExtreme)
func (*RangeConstraint) Min ¶
func (c *RangeConstraint) Min(cc Context) (from types.DataTypeExtreme)
func (*RangeConstraint) NeedsParens ¶
func (c *RangeConstraint) NeedsParens(topLevel bool) bool
func (*RangeConstraint) Type ¶
func (c *RangeConstraint) Type() Type
func (*RangeConstraint) UnmarshalJSON ¶
func (c *RangeConstraint) UnmarshalJSON(data []byte) (err error)
type ReferenceLimit ¶
type ReferenceLimit struct {
Reference string `json:"reference"`
Not bool `json:"not,omitempty"`
Entity types.Entity
Label string `json:"label"`
Field Limit `json:"field,omitempty"`
}
func (*ReferenceLimit) ASCIIDocString ¶
func (c *ReferenceLimit) ASCIIDocString(dataType *types.DataType) string
func (*ReferenceLimit) Clone ¶
func (c *ReferenceLimit) Clone() Limit
func (*ReferenceLimit) DataModelString ¶
func (c *ReferenceLimit) DataModelString(dataType *types.DataType) string
func (*ReferenceLimit) Equal ¶
func (c *ReferenceLimit) Equal(o Limit) bool
func (*ReferenceLimit) Fallback ¶
func (c *ReferenceLimit) Fallback(cc Context) (def types.DataTypeExtreme)
func (*ReferenceLimit) MarshalJSON ¶
func (c *ReferenceLimit) MarshalJSON() ([]byte, error)
func (*ReferenceLimit) Max ¶
func (c *ReferenceLimit) Max(cc Context) (max types.DataTypeExtreme)
func (*ReferenceLimit) Min ¶
func (c *ReferenceLimit) Min(cc Context) (min types.DataTypeExtreme)
func (*ReferenceLimit) NeedsParens ¶
func (c *ReferenceLimit) NeedsParens(topLevel bool) bool
type Set ¶
type Set []Constraint
func UnmarshalConstraintSetJSON ¶
func UnmarshalConstraintSetJSON(list []json.RawMessage) (set Set, err error)
func (Set) Clone ¶
func (cs Set) Clone() Constraint
func (Set) Equal ¶
func (cs Set) Equal(o Constraint) bool
func (Set) NeedsParens ¶
func (*Set) UnmarshalJSON ¶
type Stats ¶
type Stats struct {
// ExprCnt counts the number of expressions processed during parsing
// This value is compared to the maximum number of expressions allowed
// (set by the MaxExpressions option).
ExprCnt uint64
// ChoiceAltCnt is used to count for each ordered choice expression,
// which alternative is used how may times.
// These numbers allow to optimize the order of the ordered choice expression
// to increase the performance of the parser
//
// The outer key of ChoiceAltCnt is composed of the name of the rule as well
// as the line and the column of the ordered choice.
// The inner key of ChoiceAltCnt is the number (one-based) of the matching alternative.
// For each alternative the number of matches are counted. If an ordered choice does not
// match, a special counter is incremented. The name of this counter is set with
// the parser option Statistics.
// For an alternative to be included in ChoiceAltCnt, it has to match at least once.
ChoiceAltCnt map[string]map[string]int
}
Stats stores some statistics, gathered during parsing
type StatusCodeLimit ¶
type StatusCodeLimit struct {
StatusCode types.StatusCode
}
func (*StatusCodeLimit) ASCIIDocString ¶
func (c *StatusCodeLimit) ASCIIDocString(dataType *types.DataType) string
func (*StatusCodeLimit) Clone ¶
func (c *StatusCodeLimit) Clone() Limit
func (*StatusCodeLimit) DataModelString ¶
func (c *StatusCodeLimit) DataModelString(dataType *types.DataType) string
func (*StatusCodeLimit) Equal ¶
func (c *StatusCodeLimit) Equal(o Limit) bool
func (*StatusCodeLimit) Fallback ¶
func (c *StatusCodeLimit) Fallback(cc Context) (max types.DataTypeExtreme)
func (*StatusCodeLimit) MarshalJSON ¶
func (c *StatusCodeLimit) MarshalJSON() ([]byte, error)
func (*StatusCodeLimit) Max ¶
func (c *StatusCodeLimit) Max(cc Context) (max types.DataTypeExtreme)
func (*StatusCodeLimit) Min ¶
func (c *StatusCodeLimit) Min(cc Context) (min types.DataTypeExtreme)
func (*StatusCodeLimit) NeedsParens ¶
func (c *StatusCodeLimit) NeedsParens(topLevel bool) bool
type StringLimit ¶
type StringLimit struct {
Value string `json:"value"`
}
func (*StringLimit) ASCIIDocString ¶
func (c *StringLimit) ASCIIDocString(dataType *types.DataType) string
func (*StringLimit) Clone ¶
func (c *StringLimit) Clone() Limit
func (*StringLimit) DataModelString ¶
func (c *StringLimit) DataModelString(dataType *types.DataType) string
func (*StringLimit) Equal ¶
func (c *StringLimit) Equal(o Limit) bool
func (*StringLimit) Fallback ¶
func (c *StringLimit) Fallback(cc Context) (max types.DataTypeExtreme)
func (*StringLimit) MarshalJSON ¶
func (c *StringLimit) MarshalJSON() ([]byte, error)
func (*StringLimit) Max ¶
func (c *StringLimit) Max(cc Context) (max types.DataTypeExtreme)
func (*StringLimit) Min ¶
func (c *StringLimit) Min(cc Context) (min types.DataTypeExtreme)
func (*StringLimit) NeedsParens ¶
func (c *StringLimit) NeedsParens(topLevel bool) bool
type TagIdentifierLimit ¶
func (*TagIdentifierLimit) ASCIIDocString ¶
func (c *TagIdentifierLimit) ASCIIDocString(dataType *types.DataType) string
func (*TagIdentifierLimit) Clone ¶
func (c *TagIdentifierLimit) Clone() Limit
func (*TagIdentifierLimit) DataModelString ¶
func (c *TagIdentifierLimit) DataModelString(dataType *types.DataType) string
func (*TagIdentifierLimit) Equal ¶
func (c *TagIdentifierLimit) Equal(o Limit) bool
func (*TagIdentifierLimit) Fallback ¶
func (c *TagIdentifierLimit) Fallback(cc Context) (def types.DataTypeExtreme)
func (*TagIdentifierLimit) MarshalJSON ¶
func (c *TagIdentifierLimit) MarshalJSON() ([]byte, error)
func (*TagIdentifierLimit) Max ¶
func (c *TagIdentifierLimit) Max(cc Context) (max types.DataTypeExtreme)
func (*TagIdentifierLimit) Min ¶
func (c *TagIdentifierLimit) Min(cc Context) (min types.DataTypeExtreme)
func (*TagIdentifierLimit) NeedsParens ¶
func (c *TagIdentifierLimit) NeedsParens(topLevel bool) bool
type TagListConstraint ¶
type TagListConstraint struct {
Tags Limit
}
func (*TagListConstraint) ASCIIDocString ¶
func (tlc *TagListConstraint) ASCIIDocString(dataType *types.DataType) string
func (*TagListConstraint) Clone ¶
func (tlc *TagListConstraint) Clone() Constraint
func (*TagListConstraint) Equal ¶
func (tlc *TagListConstraint) Equal(o Constraint) bool
func (*TagListConstraint) Max ¶
func (tlc *TagListConstraint) Max(c Context) (max types.DataTypeExtreme)
func (*TagListConstraint) Min ¶
func (tlc *TagListConstraint) Min(c Context) (min types.DataTypeExtreme)
func (*TagListConstraint) NeedsParens ¶
func (tlc *TagListConstraint) NeedsParens(topLevel bool) bool
func (*TagListConstraint) Type ¶
func (tlc *TagListConstraint) Type() Type
type TemperatureLimit ¶
func (*TemperatureLimit) ASCIIDocString ¶
func (c *TemperatureLimit) ASCIIDocString(dataType *types.DataType) string
func (*TemperatureLimit) Clone ¶
func (c *TemperatureLimit) Clone() Limit
func (*TemperatureLimit) DataModelString ¶
func (c *TemperatureLimit) DataModelString(dataType *types.DataType) string
func (*TemperatureLimit) Equal ¶
func (c *TemperatureLimit) Equal(o Limit) bool
func (*TemperatureLimit) Fallback ¶
func (c *TemperatureLimit) Fallback(cc Context) (max types.DataTypeExtreme)
func (*TemperatureLimit) MarshalJSON ¶
func (c *TemperatureLimit) MarshalJSON() ([]byte, error)
func (*TemperatureLimit) Max ¶
func (c *TemperatureLimit) Max(cc Context) (max types.DataTypeExtreme)
func (*TemperatureLimit) Min ¶
func (c *TemperatureLimit) Min(cc Context) (min types.DataTypeExtreme)
func (*TemperatureLimit) NeedsParens ¶
func (c *TemperatureLimit) NeedsParens(topLevel bool) bool
type Type ¶
type Type uint8
const ( ConstraintTypeUnknown Type = iota ConstraintTypeAll // Special section type for everything that comes before any known sections ConstraintTypeDescribed ConstraintTypeExact ConstraintTypeGeneric ConstraintTypeList ConstraintTypeMax ConstraintTypeMin ConstraintTypeRange ConstraintTypeSet ConstraintTypeTagList )
func (Type) MarshalJSON ¶
func (*Type) UnmarshalJSON ¶
type UnspecifiedLimit ¶
type UnspecifiedLimit struct {
}
func (*UnspecifiedLimit) ASCIIDocString ¶
func (c *UnspecifiedLimit) ASCIIDocString(dataType *types.DataType) string
func (*UnspecifiedLimit) Clone ¶
func (c *UnspecifiedLimit) Clone() Limit
func (*UnspecifiedLimit) DataModelString ¶
func (c *UnspecifiedLimit) DataModelString(dataType *types.DataType) string
func (*UnspecifiedLimit) Equal ¶
func (c *UnspecifiedLimit) Equal(o Limit) bool
func (*UnspecifiedLimit) Fallback ¶
func (c *UnspecifiedLimit) Fallback(cc Context) (max types.DataTypeExtreme)
func (*UnspecifiedLimit) MarshalJSON ¶
func (c *UnspecifiedLimit) MarshalJSON() ([]byte, error)
func (*UnspecifiedLimit) Max ¶
func (c *UnspecifiedLimit) Max(cc Context) (max types.DataTypeExtreme)
func (*UnspecifiedLimit) Min ¶
func (c *UnspecifiedLimit) Min(cc Context) (min types.DataTypeExtreme)
func (*UnspecifiedLimit) NeedsParens ¶
func (c *UnspecifiedLimit) NeedsParens(topLevel bool) bool
Source Files
¶
- all.go
- boolean.go
- character.go
- constraint.go
- context.go
- described.go
- empty.go
- exact.go
- exp.go
- generic.go
- hex.go
- identifier.go
- int.go
- json.go
- length.go
- list.go
- logical.go
- manufacturer.go
- math.go
- max.go
- min.go
- null.go
- parser.go
- percent.go
- range.go
- reference.go
- reserved.go
- set.go
- status.go
- string.go
- tag.go
- temperature.go
- unspecified.go