Documentation
¶
Index ¶
- func ParseAnyTime(date string) time.Time
- type ArrayScheme
- type Node
- type NumberScheme
- type ObjectScheme
- type OneOfSchema
- type OneOrMore
- func (o *OneOrMore[T]) Do(f func(t *T) bool) bool
- func (o *OneOrMore[T]) Iter() chan<- *T
- func (o *OneOrMore[T]) MarshalJSON() ([]byte, error)
- func (o *OneOrMore[T]) MarshalYAML() ([]byte, error)
- func (o *OneOrMore[T]) UnmarshalJSON(data []byte) error
- func (o *OneOrMore[T]) UnmarshalYAML(data []byte) error
- type PathResolver
- type RefScheme
- type Regexp
- type SampleGenerator
- type Schema
- func (s *Schema) MarshalJSON() ([]byte, error)
- func (s *Schema) MarshalYAML() ([]byte, error)
- func (s *Schema) Parse(pr PathResolver, buf []byte) (*Node, error)
- func (s *Schema) SampleJSON() any
- func (s *Schema) Type() string
- func (s *Schema) UnmarshalJSON(data []byte) error
- func (s *Schema) Validate(buf []byte) bool
- func (s *Schema) ValidateNode(pr PathResolver, node *Node) bool
- type StringScheme
- type UnixTime
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseAnyTime ¶
Types ¶
type ArrayScheme ¶
type ArrayScheme struct {
TypeName string `json:"type"`
Items *Schema `json:"items,omitempty"`
MaxItems *int `json:"maxItems,omitempty"`
MinItems *int `json:"minItems,omitempty"`
}
func (*ArrayScheme) SampleJSON ¶
func (s *ArrayScheme) SampleJSON() any
func (*ArrayScheme) Type ¶
func (s *ArrayScheme) Type() string
func (*ArrayScheme) Validate ¶
func (s *ArrayScheme) Validate(buf []byte) bool
type NumberScheme ¶
type NumberScheme struct {
TypeName string `json:"type"`
Description string `json:"description,omitempty"`
Value *float64 `json:"value,omitempty"`
Max *float64 `json:"maximum,omitempty"`
ExclusiveMax *float64 `json:"exclusiveMaximum,omitempty"`
Min *float64 `json:"minimum,omitempty"`
ExclusiveMin *float64 `json:"exclusiveMinimum,omitempty"`
MultipleOf *int `json:"multipleOf,omitempty"`
}
func (*NumberScheme) SampleJSON ¶
func (s *NumberScheme) SampleJSON() any
func (*NumberScheme) Type ¶
func (s *NumberScheme) Type() string
func (*NumberScheme) Validate ¶
func (s *NumberScheme) Validate(buf []byte) bool
type ObjectScheme ¶
type ObjectScheme struct {
TypeName string `json:"type"`
Properties map[string]*Schema `json:"properties,omitempty"`
Required []string `json:"required,omitempty"`
Order []string `json:"order,omitempty"`
}
func (*ObjectScheme) SampleJSON ¶
func (s *ObjectScheme) SampleJSON() any
func (*ObjectScheme) Type ¶
func (s *ObjectScheme) Type() string
func (*ObjectScheme) Validate ¶
func (s *ObjectScheme) Validate(buf []byte) bool
type OneOfSchema ¶
type OneOfSchema struct {
OneOf []*Schema `json:"oneOf,omitempty"`
}
func (*OneOfSchema) SampleJSON ¶
func (s *OneOfSchema) SampleJSON() any
func (*OneOfSchema) Type ¶
func (s *OneOfSchema) Type() string
func (*OneOfSchema) Validate ¶
func (s *OneOfSchema) Validate(buf []byte) bool
type OneOrMore ¶
type OneOrMore[T any] struct { One *T More []*T }
func (*OneOrMore[T]) MarshalJSON ¶
func (*OneOrMore[T]) MarshalYAML ¶
func (*OneOrMore[T]) UnmarshalJSON ¶
func (*OneOrMore[T]) UnmarshalYAML ¶
type PathResolver ¶
type Regexp ¶
type Regexp struct {
Pattern string
// contains filtered or unexported fields
}
func (*Regexp) MarshalJSON ¶
func (*Regexp) MarshalYAML ¶
func (*Regexp) UnmarshalJSON ¶
func (*Regexp) UnmarshalYAML ¶
type SampleGenerator ¶
type SampleGenerator interface {
SampleJSON() any
// contains filtered or unexported methods
}
type Schema ¶
type Schema struct {
TypeName string `json:"type"`
Format string `json:"format,omitempty"`
This schemaNode `json:"-"`
}
func SchemaFrom ¶
func (*Schema) MarshalJSON ¶
func (*Schema) MarshalYAML ¶
func (*Schema) SampleJSON ¶
func (*Schema) UnmarshalJSON ¶
func (*Schema) ValidateNode ¶
func (s *Schema) ValidateNode(pr PathResolver, node *Node) bool
type StringScheme ¶
type StringScheme struct {
TypeName string `json:"type"`
Description string `json:"description,omitempty"`
Value *string `json:"value,omitempty"`
MaxLength *int `json:"maxLength,omitempty"`
MinLength *int `json:"minLength,omitempty"`
Pattern *string `json:"pattern,omitempty"`
// contains filtered or unexported fields
}
func (*StringScheme) SampleJSON ¶
func (s *StringScheme) SampleJSON() any
func (*StringScheme) Type ¶
func (s *StringScheme) Type() string
func (*StringScheme) Validate ¶
func (s *StringScheme) Validate(buf []byte) bool
type UnixTime ¶
type UnixTime struct {
// contains filtered or unexported fields
}
func (UnixTime) MarshalJSON ¶
func (UnixTime) MarshalYAML ¶
func (*UnixTime) UnmarshalJSON ¶
func (*UnixTime) UnmarshalYAML ¶
Click to show internal directories.
Click to hide internal directories.