Documentation
¶
Index ¶
- Constants
- Variables
- func GetCanonicalName(entityPtr interface{}) string
- func GetEntityTypeName(type_ reflect.Type) string
- func GetKey(entityPtr interface{}) string
- func GetMetadata(entityPtr interface{}) (map[string]string, bool)
- func GetParent(entityPtr interface{}) (interface{}, bool)
- func PrimitiveTypeName(value interface{}) string
- func ValidateRequiredFields(entityPtr interface{}) bool
- type Context
- func (self *Context) Clone(data interface{}) *Context
- func (self *Context) EmbedScriptlet(name string, scriptlet string)
- func (self *Context) FieldChild(name interface{}, data interface{}) *Context
- func (self *Context) FieldChildren() []*Context
- func (self *Context) FormatBadData() string
- func (self *Context) GetAncestor(generation int) *Context
- func (self *Context) GetCanonicalNamespace() *string
- func (self *Context) GetFieldChild(name string) (*Context, bool)
- func (self *Context) GetLocation() (int, int)
- func (self *Context) GetRequiredFieldChild(name string) (*Context, bool)
- func (self *Context) HasQuirk(quirk string) bool
- func (self *Context) ImportScriptlet(name string, path string)
- func (self *Context) Is(typeNames ...string) bool
- func (self *Context) ListChild(index int, data interface{}) *Context
- func (self *Context) MapChild(name interface{}, data interface{}) *Context
- func (self *Context) NewFunctionCall(name string, arguments []interface{}) *FunctionCall
- func (self *Context) NewImportContext(url urlpkg.URL) *Context
- func (self *Context) ReadBoolean() *bool
- func (self *Context) ReadFields(entityPtr interface{}) []string
- func (self *Context) ReadFloat() *float64
- func (self *Context) ReadInteger() *int64
- func (self *Context) ReadListItems(read Reader, process Processor) bool
- func (self *Context) ReadMapItems(read Reader, process Processor) bool
- func (self *Context) ReadSequencedListItems(read Reader, process Processor) bool
- func (self *Context) ReadString() *string
- func (self *Context) ReadStringList() *[]string
- func (self *Context) ReadStringListFixed(length int) *[]string
- func (self *Context) ReadStringMap() *map[string]interface{}
- func (self *Context) ReadStringOrStringList() *[]string
- func (self *Context) ReadStringStringMap() *map[string]string
- func (self *Context) Report(skip int, message string) bool
- func (self *Context) ReportCopyLoop(name string) bool
- func (self *Context) ReportError(err error) bool
- func (self *Context) ReportFieldMalformedSequencedList() bool
- func (self *Context) ReportFieldMissing() bool
- func (self *Context) ReportFieldReferenceNotFound(types ...reflect.Type) bool
- func (self *Context) ReportFieldUnsupported() bool
- func (self *Context) ReportFieldUnsupportedValue() bool
- func (self *Context) ReportImportIncompatible(url urlpkg.URL) bool
- func (self *Context) ReportImportLoop(url urlpkg.URL) bool
- func (self *Context) ReportInSection(skip int, message string, row int, column int) bool
- func (self *Context) ReportIncompatible(name string, target string, kind string) bool
- func (self *Context) ReportIncompatibleExtension(extension string, requiredExtensions []string) bool
- func (self *Context) ReportIncompatibleType(type_ interface{}, parentType interface{}) bool
- func (self *Context) ReportIncompatibleTypeInSet(type_ interface{}) bool
- func (self *Context) ReportInheritanceLoop(parentType interface{}) bool
- func (self *Context) ReportMapKeyReused(key string) bool
- func (self *Context) ReportMissingEntrySchema(kind string) bool
- func (self *Context) ReportNameAmbiguous(type_ reflect.Type, name string, entityPtrs ...interface{}) bool
- func (self *Context) ReportNotInRange(name string, value uint64, lower uint64, upper uint64) bool
- func (self *Context) ReportPath(skip int, message string) bool
- func (self *Context) ReportPathf(skip int, f string, arg ...interface{}) bool
- func (self *Context) ReportPrimitiveType() bool
- func (self *Context) ReportProblematic(skip int, problematic problems.Problematic) bool
- func (self *Context) ReportPropertyRequired(kind string) bool
- func (self *Context) ReportReferenceAmbiguous(kind string, entityPtr interface{}) bool
- func (self *Context) ReportReferenceNotFound(kind string, entityPtr interface{}) bool
- func (self *Context) ReportRepositoryInaccessible(repositoryName string) bool
- func (self *Context) ReportReservedMetadata() bool
- func (self *Context) ReportTypeIncomplete(parentType interface{}) bool
- func (self *Context) ReportUndeclared(kind string) bool
- func (self *Context) ReportUnknown(kind string) bool
- func (self *Context) ReportUnknownDataType(dataTypeName string) bool
- func (self *Context) ReportUnsupportedType() bool
- func (self *Context) ReportValueMalformed(kind string, reason string) bool
- func (self *Context) ReportValueWrongFormat(format string) bool
- func (self *Context) ReportValueWrongLength(kind string, length int) bool
- func (self *Context) ReportValueWrongType(requiredTypeNames ...string) bool
- func (self *Context) Reportf(skip int, f string, arg ...interface{}) bool
- func (self *Context) SequencedListChild(index int, name string, data interface{}) *Context
- func (self *Context) ValidateType(requiredTypeNames ...string) bool
- func (self *Context) ValidateUnsupportedFields(keys []string)
- type Contextual
- type EntityPtrs
- type FunctionCall
- type Grammar
- type GrammarVersion
- type GrammarVersions
- type HasMetadata
- type Hierarchical
- type Hierarchy
- func (self *Hierarchy) Add(entityPtr interface{}, parentPtr interface{}, ...) (*Hierarchy, bool)
- func (self *Hierarchy) AddChild(node *Hierarchy)
- func (self *Hierarchy) AddTo(entityPtr interface{})
- func (self *Hierarchy) AddTypeTo(field reflect.Value, type_ reflect.Type)
- func (self *Hierarchy) Find(entityPtr interface{}) (*Hierarchy, bool)
- func (self *Hierarchy) GetContext() *Context
- func (self *Hierarchy) IsCompatible(baseEntityPtr interface{}, entityPtr interface{}) bool
- func (self Hierarchy) Len() int
- func (self Hierarchy) Less(i, j int) bool
- func (self *Hierarchy) Lookup(name string, type_ reflect.Type) (*Hierarchy, bool)
- func (self *Hierarchy) Merge(node *Hierarchy, hierarchyContext HierarchyContext)
- func (self *Hierarchy) Print(indent int)
- func (self *Hierarchy) PrintChild(indent int, treePrefix terminal.TreePrefix, last bool)
- func (self *Hierarchy) PrintChildren(indent int, treePrefix terminal.TreePrefix)
- func (self *Hierarchy) Root() *Hierarchy
- func (self Hierarchy) Swap(i, j int)
- type HierarchyContext
- type HierarchyDescendants
- type ImportSpec
- type Importer
- type Inherits
- type Mappable
- type NameTransformer
- type Namespace
- func (self Namespace) Lookup(name string) (interface{}, bool)
- func (self Namespace) LookupForType(name string, type_ reflect.Type) (interface{}, bool)
- func (self Namespace) Merge(namespace Namespace, nameTransformer NameTransformer)
- func (self Namespace) Print(indent int)
- func (self Namespace) Set(name string, entityPtr interface{}) (interface{}, bool)
- type PreReadable
- type Processor
- type ReadField
- type Reader
- type Readers
- type Scriptlet
- type ScriptletNamespace
- type TypesByName
Constants ¶
View Source
const ( ReadFieldModeDefault = 0 ReadFieldModeList = 1 ReadFieldModeSequencedList = 2 ReadFieldModeItem = 3 )
Variables ¶
View Source
var PrimitiveTypeValidators = map[string]reflection.TypeValidator{ "boolean": reflection.IsBool, "integer": reflection.IsInt, "float": reflection.IsFloat, "string": reflection.IsString, "!!timestamp": reflection.IsTime, "list": reflection.IsSliceOfStruct, "map": reflection.IsMap, }
Functions ¶
func GetCanonicalName ¶
func GetCanonicalName(entityPtr interface{}) string
func GetMetadata ¶
From HasMetadata interface
func GetParent ¶
func GetParent(entityPtr interface{}) (interface{}, bool)
From Hierarchical interface
func PrimitiveTypeName ¶
func PrimitiveTypeName(value interface{}) string
func ValidateRequiredFields ¶
func ValidateRequiredFields(entityPtr interface{}) bool
From "require" tags
Types ¶
type Context ¶
type Context struct { Parent *Context Name string Path ard.Path URL urlpkg.URL Data interface{} // ARD Locator ard.Locator CanonicalNamespace *string Namespace Namespace ScriptletNamespace ScriptletNamespace Hierarchy *Hierarchy Problems *problems.Problems Quirks []string Grammar *Grammar ReadOverrides map[string]string }
func NewContext ¶
func (*Context) EmbedScriptlet ¶
func (*Context) FieldChild ¶
func (*Context) FieldChildren ¶
func (*Context) FormatBadData ¶
func (*Context) GetAncestor ¶
func (*Context) GetCanonicalNamespace ¶
func (*Context) GetLocation ¶
func (*Context) GetRequiredFieldChild ¶
func (*Context) ImportScriptlet ¶
func (*Context) NewFunctionCall ¶
func (self *Context) NewFunctionCall(name string, arguments []interface{}) *FunctionCall
func (*Context) ReadBoolean ¶
func (*Context) ReadFields ¶
From "read" tags
func (*Context) ReadInteger ¶
func (*Context) ReadListItems ¶
func (*Context) ReadMapItems ¶
func (*Context) ReadSequencedListItems ¶
func (*Context) ReadString ¶
func (*Context) ReadStringList ¶
func (*Context) ReadStringListFixed ¶
func (*Context) ReadStringMap ¶
func (*Context) ReadStringOrStringList ¶
func (*Context) ReadStringStringMap ¶
func (*Context) ReportCopyLoop ¶
func (*Context) ReportError ¶
func (*Context) ReportFieldMalformedSequencedList ¶
func (*Context) ReportFieldMissing ¶
func (*Context) ReportFieldReferenceNotFound ¶
func (*Context) ReportFieldUnsupported ¶
func (*Context) ReportFieldUnsupportedValue ¶
func (*Context) ReportImportIncompatible ¶
func (*Context) ReportInSection ¶
func (*Context) ReportIncompatible ¶
func (*Context) ReportIncompatibleExtension ¶
func (*Context) ReportIncompatibleType ¶
func (*Context) ReportIncompatibleTypeInSet ¶ added in v0.11.0
func (*Context) ReportInheritanceLoop ¶
func (*Context) ReportMapKeyReused ¶
func (*Context) ReportMissingEntrySchema ¶
func (*Context) ReportNameAmbiguous ¶
func (*Context) ReportNotInRange ¶
func (*Context) ReportPathf ¶
func (*Context) ReportPrimitiveType ¶
func (*Context) ReportProblematic ¶
func (self *Context) ReportProblematic(skip int, problematic problems.Problematic) bool
func (*Context) ReportPropertyRequired ¶
func (*Context) ReportReferenceAmbiguous ¶
func (*Context) ReportReferenceNotFound ¶
func (*Context) ReportRepositoryInaccessible ¶
func (*Context) ReportReservedMetadata ¶
func (*Context) ReportTypeIncomplete ¶
func (*Context) ReportUndeclared ¶
func (*Context) ReportUnknown ¶
func (*Context) ReportUnknownDataType ¶
func (*Context) ReportUnsupportedType ¶
func (*Context) ReportValueMalformed ¶
func (*Context) ReportValueWrongFormat ¶
func (*Context) ReportValueWrongLength ¶
func (*Context) ReportValueWrongType ¶
func (*Context) SequencedListChild ¶
func (*Context) ValidateType ¶
func (*Context) ValidateUnsupportedFields ¶
type Contextual ¶
type Contextual interface {
GetContext() *Context
}
type EntityPtrs ¶
type EntityPtrs []interface{}
func (EntityPtrs) Len ¶
func (self EntityPtrs) Len() int
func (EntityPtrs) Less ¶
func (self EntityPtrs) Less(i, j int) bool
func (EntityPtrs) Swap ¶
func (self EntityPtrs) Swap(i, j int)
type FunctionCall ¶
type FunctionCall struct { Name string `json:"name" yaml:"name"` Arguments []interface{} `json:"arguments" yaml:"arguments"` URL string `json:"url,omitempty" yaml:"url,omitempty"` Row int `json:"row,omitempty" yaml:"row,omitempty"` Column int `json:"column,omitempty" yaml:"column,omitempty"` Path string `json:"path,omitempty" yaml:"path,omitempty"` }
func NewFunctionCall ¶
type Grammar ¶
type Grammar struct { Versions GrammarVersions Readers Readers }
func NewGrammar ¶
func NewGrammar() Grammar
func (*Grammar) RegisterReader ¶
type GrammarVersion ¶
type GrammarVersions ¶
type GrammarVersions map[string][]GrammarVersion
type HasMetadata ¶
type Hierarchical ¶
type Hierarchical interface {
GetParent() interface{}
}
type Hierarchy ¶
func NewHierarchy ¶
func NewHierarchy(entityPtr interface{}, hierarchyContext HierarchyContext) *Hierarchy
func (*Hierarchy) Add ¶
func (self *Hierarchy) Add(entityPtr interface{}, parentPtr interface{}, hierarchyContext HierarchyContext, descendants HierarchyDescendants) (*Hierarchy, bool)
func (*Hierarchy) GetContext ¶
func (*Hierarchy) IsCompatible ¶
func (*Hierarchy) Merge ¶
func (self *Hierarchy) Merge(node *Hierarchy, hierarchyContext HierarchyContext)
func (*Hierarchy) Print ¶
Note that the same name could be printed out twice in the hierarchy, even under the same parent! That's because we are printing the local name of the type, and types imported from other files can have the same name (though you would need a namespace_prefix to avoid a namespace error)
func (*Hierarchy) PrintChild ¶
func (self *Hierarchy) PrintChild(indent int, treePrefix terminal.TreePrefix, last bool)
func (*Hierarchy) PrintChildren ¶
func (self *Hierarchy) PrintChildren(indent int, treePrefix terminal.TreePrefix)
type HierarchyDescendants ¶
type HierarchyDescendants []interface{}
type ImportSpec ¶
type ImportSpec struct { URL url.URL NameTransformer NameTransformer Implicit bool }
type Importer ¶
type Importer interface {
GetImportSpecs() []*ImportSpec
}
type NameTransformer ¶
type Namespace ¶
func (Namespace) LookupForType ¶
func (Namespace) Merge ¶
func (self Namespace) Merge(namespace Namespace, nameTransformer NameTransformer)
type PreReadable ¶
type PreReadable interface {
PreRead()
}
type ReadField ¶
type ReadField struct { FieldName string Key string Context *Context Entity reflect.Value Reader Reader Mode int Important bool Wildcard bool }
func NewReadField ¶
type Scriptlet ¶
type ScriptletNamespace ¶
func (ScriptletNamespace) Merge ¶
func (self ScriptletNamespace) Merge(from ScriptletNamespace)
func (ScriptletNamespace) RegisterScriptlet ¶
func (self ScriptletNamespace) RegisterScriptlet(name string, scriptlet string, nativeArgumentIndexes []uint)
func (ScriptletNamespace) RegisterScriptlets ¶
type TypesByName ¶
func (TypesByName) Len ¶
func (self TypesByName) Len() int
func (TypesByName) Less ¶
func (self TypesByName) Less(i, j int) bool
func (TypesByName) Swap ¶
func (self TypesByName) Swap(i, j int)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.