Documentation
¶
Index ¶
Constants ¶
View Source
const (
AnnotationSchemaNullable structmeta.AnnotationName = "schema/nullable"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayItemType ¶
func NewArrayItemType ¶
func NewArrayItemType(item *yamlmeta.ArrayItem) (*ArrayItemType, error)
func (ArrayItemType) AssignTypeTo ¶
func (t ArrayItemType) AssignTypeTo(typeable yamlmeta.Typeable) (chk yamlmeta.TypeCheck)
func (ArrayItemType) CheckType ¶
func (a ArrayItemType) CheckType(node yamlmeta.TypeWithValues, prependErrorMessage string) (chk yamlmeta.TypeCheck)
func (ArrayItemType) GetValueType ¶
func (a ArrayItemType) GetValueType() yamlmeta.Type
type ArrayType ¶
func (*ArrayType) AssignTypeTo ¶
func (ArrayType) GetValueType ¶
type DocumentSchema ¶
type DocumentSchema struct {
Name string
Source *yamlmeta.Document
Allowed *DocumentType
}
func NewDocumentSchema ¶
func NewDocumentSchema(doc *yamlmeta.Document) (*DocumentSchema, error)
func (*DocumentSchema) AssignType ¶
func (s *DocumentSchema) AssignType(typeable yamlmeta.Typeable) yamlmeta.TypeCheck
type DocumentType ¶
type DocumentType struct {
Source *yamlmeta.Document
ValueType yamlmeta.Type // typically one of: MapType, ArrayType, ScalarType
}
func (*DocumentType) AssignTypeTo ¶
func (t *DocumentType) AssignTypeTo(typeable yamlmeta.Typeable) (chk yamlmeta.TypeCheck)
func (*DocumentType) CheckType ¶
func (t *DocumentType) CheckType(_ yamlmeta.TypeWithValues, _ string) (chk yamlmeta.TypeCheck)
func (*DocumentType) GetValueType ¶
func (t *DocumentType) GetValueType() yamlmeta.Type
type MapItemType ¶
type MapItemType struct {
Key interface{} // usually a string
ValueType yamlmeta.Type
DefaultValue interface{}
Position *filepos.Position
Annotations TypeAnnotations
}
func NewMapItemType ¶
func NewMapItemType(item *yamlmeta.MapItem) (*MapItemType, error)
func (*MapItemType) AssignTypeTo ¶
func (t *MapItemType) AssignTypeTo(typeable yamlmeta.Typeable) (chk yamlmeta.TypeCheck)
func (MapItemType) CheckType ¶
func (m MapItemType) CheckType(node yamlmeta.TypeWithValues, prependErrorMessage string) (chk yamlmeta.TypeCheck)
func (MapItemType) GetValueType ¶
func (m MapItemType) GetValueType() yamlmeta.Type
func (MapItemType) IsNullable ¶
func (t MapItemType) IsNullable() bool
type MapType ¶
type MapType struct {
Items []*MapItemType
}
func (*MapType) AssignTypeTo ¶
func (MapType) GetValueType ¶
type ScalarType ¶
type ScalarType struct {
Type interface{}
}
func (*ScalarType) AssignTypeTo ¶
func (t *ScalarType) AssignTypeTo(typeable yamlmeta.Typeable) (chk yamlmeta.TypeCheck)
func (ScalarType) CheckType ¶
func (m ScalarType) CheckType(node yamlmeta.TypeWithValues, prependErrorMessage string) (chk yamlmeta.TypeCheck)
func (ScalarType) GetValueType ¶
func (m ScalarType) GetValueType() yamlmeta.Type
type TypeAnnotations ¶
type TypeAnnotations map[structmeta.AnnotationName]interface{}
Click to show internal directories.
Click to hide internal directories.