Documentation ¶
Index ¶
- func ParseBytes(b []byte) error
- type AdditionalProperties
- func (c AdditionalProperties) ASTNode() jschema.RuleASTNode
- func (c AdditionalProperties) IsEqual(c2 AdditionalProperties) bool
- func (AdditionalProperties) IsJsonTypeCompatible(t json.Type) bool
- func (c AdditionalProperties) Mode() AdditionalPropertiesMode
- func (c AdditionalProperties) SchemaType() jschema.SchemaType
- func (c AdditionalProperties) String() string
- func (AdditionalProperties) Type() Type
- func (c AdditionalProperties) TypeName() bytes.Bytes
- type AdditionalPropertiesMode
- type AllOf
- type AnyConstraint
- type ArrayValidator
- type BoolKeeper
- type BytesKeeper
- type Const
- type Constraint
- type Date
- type DateTime
- type Email
- type Enum
- type ExclusiveMaximum
- type ExclusiveMinimum
- type LiteralValidator
- type Max
- type MaxItems
- type MaxLength
- type Min
- type MinItems
- type MinLength
- type Nullable
- type Optional
- type Or
- type Precision
- type Regex
- type RequiredKeys
- type Type
- type TypeConstraint
- func (c TypeConstraint) ASTNode() jschema.RuleASTNode
- func (c TypeConstraint) Bytes() bytes.Bytes
- func (c TypeConstraint) IsGenerated() bool
- func (TypeConstraint) IsJsonTypeCompatible(json.Type) bool
- func (c TypeConstraint) Source() jschema.RuleASTNodeSource
- func (c TypeConstraint) String() string
- func (TypeConstraint) Type() Type
- type TypesList
- func (c TypesList) ASTNode() jschema.RuleASTNode
- func (c *TypesList) AddName(name, typ string, s jschema.RuleASTNodeSource)
- func (c *TypesList) AddNameWithASTNode(name, typ string, an jschema.RuleASTNode)
- func (c TypesList) HasUserTypes() bool
- func (TypesList) IsJsonTypeCompatible(json.Type) bool
- func (c TypesList) Len() int
- func (c TypesList) Names() []string
- func (c TypesList) Source() jschema.RuleASTNodeSource
- func (c TypesList) String() string
- func (TypesList) Type() Type
- type Uri
- type Uuid
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseBytes ¶
Types ¶
type AdditionalProperties ¶
type AdditionalProperties struct {
// contains filtered or unexported fields
}
func NewAdditionalProperties ¶
func NewAdditionalProperties(ruleValue bytes.Bytes) *AdditionalProperties
NewAdditionalProperties create an additional properties constraint. Depends on `ruleValue` value, might return nil. Might panic if got unknown JSON type.
Handle next cases:
{additionalProperties: "any"} {additionalProperties: true} {additionalProperties: false} - in that case this function will return nil. {additionalProperties: "@Foo"} {additionalProperties: "string"}
func (AdditionalProperties) ASTNode ¶
func (c AdditionalProperties) ASTNode() jschema.RuleASTNode
func (AdditionalProperties) IsEqual ¶
func (c AdditionalProperties) IsEqual(c2 AdditionalProperties) bool
func (AdditionalProperties) IsJsonTypeCompatible ¶
func (AdditionalProperties) IsJsonTypeCompatible(t json.Type) bool
func (AdditionalProperties) Mode ¶
func (c AdditionalProperties) Mode() AdditionalPropertiesMode
func (AdditionalProperties) SchemaType ¶
func (c AdditionalProperties) SchemaType() jschema.SchemaType
func (AdditionalProperties) String ¶
func (c AdditionalProperties) String() string
func (AdditionalProperties) Type ¶
func (AdditionalProperties) Type() Type
func (AdditionalProperties) TypeName ¶
func (c AdditionalProperties) TypeName() bytes.Bytes
type AdditionalPropertiesMode ¶
type AdditionalPropertiesMode int
const ( AdditionalPropertiesCanBeAny AdditionalPropertiesMode = iota AdditionalPropertiesMustBeSchemaType AdditionalPropertiesMustBeType AdditionalPropertiesNotAllowed )
type AllOf ¶
type AllOf struct {
// contains filtered or unexported fields
}
func (AllOf) ASTNode ¶
func (c AllOf) ASTNode() jschema.RuleASTNode
func (AllOf) SchemaNames ¶
type AnyConstraint ¶
type AnyConstraint struct{}
func NewAny ¶
func NewAny() *AnyConstraint
func (AnyConstraint) ASTNode ¶
func (AnyConstraint) ASTNode() jschema.RuleASTNode
func (AnyConstraint) IsJsonTypeCompatible ¶
func (AnyConstraint) IsJsonTypeCompatible(json.Type) bool
func (AnyConstraint) String ¶
func (AnyConstraint) String() string
func (AnyConstraint) Type ¶
func (AnyConstraint) Type() Type
type ArrayValidator ¶
type BoolKeeper ¶
type BoolKeeper interface {
Bool() bool
}
type BytesKeeper ¶
type Const ¶
type Const struct {
// contains filtered or unexported fields
}
func (Const) ASTNode ¶
func (c Const) ASTNode() jschema.RuleASTNode
type Constraint ¶
type Constraint interface { // Type returns the type of constraint. Type() Type // IsJsonTypeCompatible checks the compatibility of the constraint and json // types. IsJsonTypeCompatible(json.Type) bool // String returns a textual description of the constraint. String() string // ASTNode returns an AST node for this constraint. ASTNode() jschema.RuleASTNode }
func NewConstraintFromRule ¶
func NewConstraintFromRule( ruleNameLex lexeme.LexEvent, ruleValue bytes.Bytes, nodeValue bytes.Bytes, ) Constraint
NewConstraintFromRule creates a Constraint from the rule. Might return nil.
type DateTime ¶
type DateTime struct{}
func NewDateTime ¶
func NewDateTime() *DateTime
func (DateTime) ASTNode ¶
func (DateTime) ASTNode() jschema.RuleASTNode
type Enum ¶
type Enum struct {
// contains filtered or unexported fields
}
func (Enum) ASTNode ¶
func (c Enum) ASTNode() jschema.RuleASTNode
func (*Enum) SetComment ¶
type ExclusiveMaximum ¶
type ExclusiveMaximum struct {
// contains filtered or unexported fields
}
func NewExclusiveMaximum ¶
func NewExclusiveMaximum(ruleValue bytes.Bytes) *ExclusiveMaximum
func (ExclusiveMaximum) ASTNode ¶
func (c ExclusiveMaximum) ASTNode() jschema.RuleASTNode
func (ExclusiveMaximum) IsExclusive ¶
func (c ExclusiveMaximum) IsExclusive() bool
func (ExclusiveMaximum) IsJsonTypeCompatible ¶
func (ExclusiveMaximum) IsJsonTypeCompatible(t json.Type) bool
func (ExclusiveMaximum) String ¶
func (c ExclusiveMaximum) String() string
func (ExclusiveMaximum) Type ¶
func (ExclusiveMaximum) Type() Type
type ExclusiveMinimum ¶
type ExclusiveMinimum struct {
// contains filtered or unexported fields
}
func NewExclusiveMinimum ¶
func NewExclusiveMinimum(ruleValue bytes.Bytes) *ExclusiveMinimum
func (ExclusiveMinimum) ASTNode ¶
func (c ExclusiveMinimum) ASTNode() jschema.RuleASTNode
func (ExclusiveMinimum) IsExclusive ¶
func (c ExclusiveMinimum) IsExclusive() bool
func (ExclusiveMinimum) IsJsonTypeCompatible ¶
func (ExclusiveMinimum) IsJsonTypeCompatible(t json.Type) bool
func (ExclusiveMinimum) String ¶
func (c ExclusiveMinimum) String() string
func (ExclusiveMinimum) Type ¶
func (ExclusiveMinimum) Type() Type
type LiteralValidator ¶
type Max ¶
type Max struct {
// contains filtered or unexported fields
}
func (Max) ASTNode ¶
func (c Max) ASTNode() jschema.RuleASTNode
func (*Max) SetExclusive ¶
type MaxItems ¶
type MaxItems struct {
// contains filtered or unexported fields
}
func NewMaxItems ¶
func (MaxItems) ASTNode ¶
func (c MaxItems) ASTNode() jschema.RuleASTNode
func (MaxItems) ValidateTheArray ¶
type MaxLength ¶
type MaxLength struct {
// contains filtered or unexported fields
}
func NewMaxLength ¶
func (MaxLength) ASTNode ¶
func (c MaxLength) ASTNode() jschema.RuleASTNode
type Min ¶
type Min struct {
// contains filtered or unexported fields
}
func (Min) ASTNode ¶
func (c Min) ASTNode() jschema.RuleASTNode
func (*Min) SetExclusive ¶
type MinItems ¶
type MinItems struct {
// contains filtered or unexported fields
}
func NewMinItems ¶
func (MinItems) ASTNode ¶
func (c MinItems) ASTNode() jschema.RuleASTNode
func (MinItems) ValidateTheArray ¶
type MinLength ¶
type MinLength struct {
// contains filtered or unexported fields
}
func NewMinLength ¶
func (MinLength) ASTNode ¶
func (c MinLength) ASTNode() jschema.RuleASTNode
type Nullable ¶
type Nullable struct {
// contains filtered or unexported fields
}
func NewNullable ¶
func (Nullable) ASTNode ¶
func (c Nullable) ASTNode() jschema.RuleASTNode
type Optional ¶
type Optional struct {
// contains filtered or unexported fields
}
func NewOptional ¶
func (Optional) ASTNode ¶
func (c Optional) ASTNode() jschema.RuleASTNode
type Or ¶
type Or struct {
// contains filtered or unexported fields
}
func NewOr ¶
func NewOr(s jschema.RuleASTNodeSource) *Or
func (Or) ASTNode ¶
func (Or) ASTNode() jschema.RuleASTNode
func (Or) IsGenerated ¶
type Precision ¶
type Precision struct {
// contains filtered or unexported fields
}
func NewPrecision ¶
func (Precision) ASTNode ¶
func (c Precision) ASTNode() jschema.RuleASTNode
type Regex ¶
type Regex struct {
// contains filtered or unexported fields
}
func (Regex) ASTNode ¶
func (c Regex) ASTNode() jschema.RuleASTNode
func (Regex) IsJsonTypeCompatible ¶
func (Regex) IsJsonTypeCompatible(t internalJSON.Type) bool
type RequiredKeys ¶
type RequiredKeys struct {
// contains filtered or unexported fields
}
func NewRequiredKeys ¶
func NewRequiredKeys() *RequiredKeys
func (RequiredKeys) ASTNode ¶
func (c RequiredKeys) ASTNode() jschema.RuleASTNode
func (*RequiredKeys) AddKey ¶
func (c *RequiredKeys) AddKey(key string)
func (RequiredKeys) IsJsonTypeCompatible ¶
func (RequiredKeys) IsJsonTypeCompatible(t json.Type) bool
func (RequiredKeys) Keys ¶
func (c RequiredKeys) Keys() []string
func (RequiredKeys) String ¶
func (c RequiredKeys) String() string
func (RequiredKeys) Type ¶
func (RequiredKeys) Type() Type
type Type ¶
type Type int
const ( MinLengthConstraintType Type = iota MaxLengthConstraintType MinConstraintType MaxConstraintType ExclusiveMinimumConstraintType ExclusiveMaximumConstraintType PrecisionConstraintType TypeConstraintType TypesListConstraintType OptionalConstraintType OrConstraintType RequiredKeysConstraintType EmailConstraintType MinItemsConstraintType MaxItemsConstraintType EnumConstraintType AdditionalPropertiesConstraintType AllOfConstraintType AnyConstraintType NullableConstraintType RegexConstraintType UriConstraintType DateConstraintType DateTimeConstraintType UuidConstraintType ConstType )
type TypeConstraint ¶
type TypeConstraint struct {
// contains filtered or unexported fields
}
func NewType ¶
func NewType(ruleValue bytes.Bytes, source jschema.RuleASTNodeSource) *TypeConstraint
func (TypeConstraint) ASTNode ¶
func (c TypeConstraint) ASTNode() jschema.RuleASTNode
func (TypeConstraint) Bytes ¶
func (c TypeConstraint) Bytes() bytes.Bytes
func (TypeConstraint) IsGenerated ¶
func (c TypeConstraint) IsGenerated() bool
func (TypeConstraint) IsJsonTypeCompatible ¶
func (TypeConstraint) IsJsonTypeCompatible(json.Type) bool
func (TypeConstraint) Source ¶
func (c TypeConstraint) Source() jschema.RuleASTNodeSource
func (TypeConstraint) String ¶
func (c TypeConstraint) String() string
func (TypeConstraint) Type ¶
func (TypeConstraint) Type() Type
type TypesList ¶
type TypesList struct {
// contains filtered or unexported fields
}
func NewTypesList ¶
func NewTypesList(s jschema.RuleASTNodeSource) *TypesList
func (TypesList) ASTNode ¶
func (c TypesList) ASTNode() jschema.RuleASTNode
func (*TypesList) AddName ¶
func (c *TypesList) AddName(name, typ string, s jschema.RuleASTNodeSource)
func (*TypesList) AddNameWithASTNode ¶
func (c *TypesList) AddNameWithASTNode(name, typ string, an jschema.RuleASTNode)
func (TypesList) HasUserTypes ¶
func (TypesList) Source ¶
func (c TypesList) Source() jschema.RuleASTNodeSource
Source Files ¶
- ast.go
- c_additional_properties.go
- c_all_of.go
- c_any.go
- c_const.go
- c_date.go
- c_datetime.go
- c_email.go
- c_enum.go
- c_exclusive_maximum.go
- c_exclusive_minimum.go
- c_max.go
- c_max_items.go
- c_max_length.go
- c_min.go
- c_min_items.go
- c_min_length.go
- c_nullable.go
- c_optional.go
- c_or.go
- c_precision.go
- c_regexp.go
- c_required_keys.go
- c_sub_schema_list.go
- c_type.go
- c_uri.go
- c_uuid.go
- constraint.go
- type.go
Click to show internal directories.
Click to hide internal directories.