Documentation
¶
Index ¶
- Constants
- func NewInvalidArrayDefinitionError(found yamlmeta.Node, hint string) error
- func NewInvalidSchemaError(found yamlmeta.Node, message, hint string) error
- func NewMismatchedTypeError(foundType yamlmeta.TypeWithValues, expectedType yamlmeta.Type) error
- func NewUnexpectedKeyError(found *yamlmeta.MapItem, definition *filepos.Position) error
- type Annotation
- type AnyType
- type ArrayItemType
- func (a *ArrayItemType) AssignTypeTo(typeable yamlmeta.Typeable) (chk yamlmeta.TypeCheck)
- func (a *ArrayItemType) CheckType(node yamlmeta.TypeWithValues) (chk yamlmeta.TypeCheck)
- func (a ArrayItemType) GetValueType() yamlmeta.Type
- func (a ArrayItemType) PositionOfDefinition() *filepos.Position
- func (a ArrayItemType) String() string
- type ArrayType
- func (a *ArrayType) AssignTypeTo(typeable yamlmeta.Typeable) (chk yamlmeta.TypeCheck)
- func (a *ArrayType) CheckType(node yamlmeta.TypeWithValues) (chk yamlmeta.TypeCheck)
- func (a ArrayType) GetValueType() yamlmeta.Type
- func (a ArrayType) PositionOfDefinition() *filepos.Position
- func (a ArrayType) String() string
- type DocumentSchema
- type DocumentSchemaEnvelope
- func (e *DocumentSchemaEnvelope) Desc() string
- func (e *DocumentSchemaEnvelope) IntendedForAnotherLibrary() bool
- func (e *DocumentSchemaEnvelope) IsUsed() bool
- func (e *DocumentSchemaEnvelope) Source() *yamlmeta.Document
- func (e *DocumentSchemaEnvelope) UsedInLibrary(expectedRefPiece ref.LibraryRef) (*DocumentSchemaEnvelope, bool)
- type DocumentType
- func (t *DocumentType) AssignTypeTo(typeable yamlmeta.Typeable) (chk yamlmeta.TypeCheck)
- func (t *DocumentType) CheckType(_ yamlmeta.TypeWithValues) (chk yamlmeta.TypeCheck)
- func (t *DocumentType) GetValueType() yamlmeta.Type
- func (t *DocumentType) PositionOfDefinition() *filepos.Position
- func (t *DocumentType) String() string
- type ExtractLibRefs
- type MapItemType
- func (t *MapItemType) AssignTypeTo(typeable yamlmeta.Typeable) (chk yamlmeta.TypeCheck)
- func (t *MapItemType) CheckType(node yamlmeta.TypeWithValues) (chk yamlmeta.TypeCheck)
- func (t MapItemType) GetValueType() yamlmeta.Type
- func (t MapItemType) PositionOfDefinition() *filepos.Position
- func (t MapItemType) String() string
- type MapType
- func (m *MapType) AllowsKey(key interface{}) bool
- func (m *MapType) AssignTypeTo(typeable yamlmeta.Typeable) (chk yamlmeta.TypeCheck)
- func (m *MapType) CheckType(node yamlmeta.TypeWithValues) (chk yamlmeta.TypeCheck)
- func (m MapType) GetValueType() yamlmeta.Type
- func (m MapType) PositionOfDefinition() *filepos.Position
- func (m MapType) String() string
- type NullSchema
- type NullType
- func (n NullType) AssignTypeTo(typeable yamlmeta.Typeable) (chk yamlmeta.TypeCheck)
- func (n NullType) CheckType(node yamlmeta.TypeWithValues) (chk yamlmeta.TypeCheck)
- func (n NullType) GetValueType() yamlmeta.Type
- func (n NullType) PositionOfDefinition() *filepos.Position
- func (n NullType) String() string
- type NullableAnnotation
- type ScalarType
- func (m *ScalarType) AssignTypeTo(typeable yamlmeta.Typeable) yamlmeta.TypeCheck
- func (m *ScalarType) CheckType(node yamlmeta.TypeWithValues) (chk yamlmeta.TypeCheck)
- func (m ScalarType) GetValueType() yamlmeta.Type
- func (m ScalarType) PositionOfDefinition() *filepos.Position
- func (m ScalarType) String() string
- type TypeAnnotation
Constants ¶
View Source
const ( AnnotationNullable structmeta.AnnotationName = "schema/nullable" AnnotationType structmeta.AnnotationName = "schema/type" TypeAnnotationKwargAny string = "any" )
Variables ¶
This section is empty.
Functions ¶
func NewInvalidArrayDefinitionError ¶ added in v0.32.0
func NewInvalidSchemaError ¶ added in v0.32.0
func NewMismatchedTypeError ¶ added in v0.32.0
func NewMismatchedTypeError(foundType yamlmeta.TypeWithValues, expectedType yamlmeta.Type) error
Types ¶
type Annotation ¶ added in v0.34.0
type AnyType ¶ added in v0.34.0
func (AnyType) AssignTypeTo ¶ added in v0.34.0
func (AnyType) CheckType ¶ added in v0.34.0
func (a AnyType) CheckType(_ yamlmeta.TypeWithValues) (chk yamlmeta.TypeCheck)
func (AnyType) GetValueType ¶ added in v0.34.0
func (AnyType) PositionOfDefinition ¶ added in v0.34.0
type ArrayItemType ¶
func NewArrayItemType ¶
func NewArrayItemType(item *yamlmeta.ArrayItem) (*ArrayItemType, error)
func (*ArrayItemType) AssignTypeTo ¶
func (a *ArrayItemType) AssignTypeTo(typeable yamlmeta.Typeable) (chk yamlmeta.TypeCheck)
func (*ArrayItemType) CheckType ¶
func (a *ArrayItemType) CheckType(node yamlmeta.TypeWithValues) (chk yamlmeta.TypeCheck)
func (ArrayItemType) GetValueType ¶
func (a ArrayItemType) GetValueType() yamlmeta.Type
func (ArrayItemType) PositionOfDefinition ¶ added in v0.32.0
func (a ArrayItemType) PositionOfDefinition() *filepos.Position
func (ArrayItemType) String ¶ added in v0.32.0
func (a ArrayItemType) String() string
type ArrayType ¶
func (*ArrayType) AssignTypeTo ¶
func (*ArrayType) CheckType ¶
func (a *ArrayType) CheckType(node yamlmeta.TypeWithValues) (chk yamlmeta.TypeCheck)
func (ArrayType) GetValueType ¶
func (ArrayType) PositionOfDefinition ¶ added in v0.32.0
type DocumentSchema ¶
type DocumentSchema struct {
Source *yamlmeta.Document
Allowed *DocumentType
// contains filtered or unexported fields
}
func NewDocumentSchema ¶
func NewDocumentSchema(doc *yamlmeta.Document) (*DocumentSchema, error)
func NewPermissiveSchema ¶ added in v0.34.0
func NewPermissiveSchema() *DocumentSchema
func (*DocumentSchema) AssignType ¶
func (s *DocumentSchema) AssignType(typeable yamlmeta.Typeable) yamlmeta.TypeCheck
func (*DocumentSchema) DefaultDataValues ¶ added in v0.32.0
func (s *DocumentSchema) DefaultDataValues() *yamlmeta.Document
func (*DocumentSchema) ValidateWithValues ¶ added in v0.32.0
func (s *DocumentSchema) ValidateWithValues(valuesFilesCount int) error
type DocumentSchemaEnvelope ¶ added in v0.34.0
type DocumentSchemaEnvelope struct {
Doc *DocumentSchema
// contains filtered or unexported fields
}
func NewDocumentSchemaEnvelope ¶ added in v0.34.0
func NewDocumentSchemaEnvelope(doc *yamlmeta.Document) (*DocumentSchemaEnvelope, error)
func (*DocumentSchemaEnvelope) Desc ¶ added in v0.34.0
func (e *DocumentSchemaEnvelope) Desc() string
func (*DocumentSchemaEnvelope) IntendedForAnotherLibrary ¶ added in v0.34.0
func (e *DocumentSchemaEnvelope) IntendedForAnotherLibrary() bool
func (*DocumentSchemaEnvelope) IsUsed ¶ added in v0.34.0
func (e *DocumentSchemaEnvelope) IsUsed() bool
func (*DocumentSchemaEnvelope) Source ¶ added in v0.34.0
func (e *DocumentSchemaEnvelope) Source() *yamlmeta.Document
func (*DocumentSchemaEnvelope) UsedInLibrary ¶ added in v0.34.0
func (e *DocumentSchemaEnvelope) UsedInLibrary(expectedRefPiece ref.LibraryRef) (*DocumentSchemaEnvelope, bool)
type DocumentType ¶
type DocumentType struct {
Source *yamlmeta.Document
ValueType yamlmeta.Type // typically one of: MapType, ArrayType, ScalarType
Position *filepos.Position
}
func NewDocumentType ¶ added in v0.32.0
func NewDocumentType(doc *yamlmeta.Document) (*DocumentType, error)
func (*DocumentType) AssignTypeTo ¶
func (t *DocumentType) AssignTypeTo(typeable yamlmeta.Typeable) (chk yamlmeta.TypeCheck)
func (*DocumentType) CheckType ¶
func (t *DocumentType) CheckType(_ yamlmeta.TypeWithValues) (chk yamlmeta.TypeCheck)
func (*DocumentType) GetValueType ¶
func (t *DocumentType) GetValueType() yamlmeta.Type
func (*DocumentType) PositionOfDefinition ¶ added in v0.32.0
func (t *DocumentType) PositionOfDefinition() *filepos.Position
func (*DocumentType) String ¶ added in v0.32.0
func (t *DocumentType) String() string
type ExtractLibRefs ¶ added in v0.34.0
type ExtractLibRefs interface {
FromAnnotation(template.NodeAnnotations) ([]ref.LibraryRef, error)
}
type MapItemType ¶
type MapItemType struct {
Key interface{} // usually a string
ValueType yamlmeta.Type
DefaultValue interface{}
Position *filepos.Position
}
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 (t *MapItemType) CheckType(node yamlmeta.TypeWithValues) (chk yamlmeta.TypeCheck)
func (MapItemType) GetValueType ¶
func (t MapItemType) GetValueType() yamlmeta.Type
func (MapItemType) PositionOfDefinition ¶ added in v0.32.0
func (t MapItemType) PositionOfDefinition() *filepos.Position
func (MapItemType) String ¶ added in v0.32.0
func (t MapItemType) String() string
type MapType ¶
type MapType struct {
Items []*MapItemType
Position *filepos.Position
}
func (*MapType) AssignTypeTo ¶
func (*MapType) CheckType ¶
func (m *MapType) CheckType(node yamlmeta.TypeWithValues) (chk yamlmeta.TypeCheck)
func (MapType) GetValueType ¶
func (MapType) PositionOfDefinition ¶ added in v0.32.0
type NullSchema ¶ added in v0.32.0
type NullSchema struct {
}
func (NullSchema) AssignType ¶ added in v0.32.0
func (n NullSchema) AssignType(typeable yamlmeta.Typeable) yamlmeta.TypeCheck
func (NullSchema) DefaultDataValues ¶ added in v0.32.0
func (n NullSchema) DefaultDataValues() *yamlmeta.Document
func (NullSchema) ValidateWithValues ¶ added in v0.32.0
func (n NullSchema) ValidateWithValues(valuesFilesCount int) error
type NullType ¶ added in v0.34.0
func (NullType) AssignTypeTo ¶ added in v0.34.0
func (NullType) CheckType ¶ added in v0.34.0
func (n NullType) CheckType(node yamlmeta.TypeWithValues) (chk yamlmeta.TypeCheck)
func (NullType) GetValueType ¶ added in v0.34.0
func (NullType) PositionOfDefinition ¶ added in v0.34.0
type NullableAnnotation ¶ added in v0.34.0
type NullableAnnotation struct {
// contains filtered or unexported fields
}
func NewNullableAnnotation ¶ added in v0.34.0
func NewNullableAnnotation(ann template.NodeAnnotation, valueType yamlmeta.Type, pos *filepos.Position) (*NullableAnnotation, error)
func (*NullableAnnotation) NewTypeFromAnn ¶ added in v0.34.0
func (n *NullableAnnotation) NewTypeFromAnn() yamlmeta.Type
type ScalarType ¶
func (*ScalarType) AssignTypeTo ¶
func (m *ScalarType) AssignTypeTo(typeable yamlmeta.Typeable) yamlmeta.TypeCheck
func (*ScalarType) CheckType ¶
func (m *ScalarType) CheckType(node yamlmeta.TypeWithValues) (chk yamlmeta.TypeCheck)
func (ScalarType) GetValueType ¶
func (m ScalarType) GetValueType() yamlmeta.Type
func (ScalarType) PositionOfDefinition ¶ added in v0.32.0
func (m ScalarType) PositionOfDefinition() *filepos.Position
func (ScalarType) String ¶ added in v0.32.0
func (m ScalarType) String() string
type TypeAnnotation ¶ added in v0.34.0
type TypeAnnotation struct {
// contains filtered or unexported fields
}
func NewTypeAnnotation ¶ added in v0.34.0
func NewTypeAnnotation(ann template.NodeAnnotation, pos *filepos.Position) (*TypeAnnotation, error)
func (*TypeAnnotation) IsAny ¶ added in v0.34.0
func (t *TypeAnnotation) IsAny() bool
func (*TypeAnnotation) NewTypeFromAnn ¶ added in v0.34.0
func (t *TypeAnnotation) NewTypeFromAnn() yamlmeta.Type
Click to show internal directories.
Click to hide internal directories.