Documentation ¶
Index ¶
- type DataParser
- type Enum
- type EnumMember
- type IModuleProvider
- type ITypeProvider
- type Import
- type InputsProvider
- type Interface
- func (i Interface) LookupMethod(name string) *Method
- func (i Interface) LookupProperty(name string) *TypedNode
- func (i Interface) LookupSignal(name string) *Signal
- func (i Interface) NoMembers() bool
- func (i Interface) NoMethods() bool
- func (i Interface) NoProperties() bool
- func (i Interface) NoSignals() bool
- func (i *Interface) ResolveAll(mod *Module) error
- type Kind
- type KindType
- type Method
- type Module
- type NamedNode
- type Schema
- func (s *Schema) GetEnum() *Enum
- func (s *Schema) GetInterface() *Interface
- func (s *Schema) GetStruct() *Struct
- func (s Schema) IsEmpty() bool
- func (s *Schema) IsEnum() bool
- func (s *Schema) IsInterface() bool
- func (s *Schema) IsStruct() bool
- func (s Schema) LookupNode(name string) *NamedNode
- func (s *Schema) ResolveAll(m *Module) error
- type Signal
- type Struct
- type System
- func (s System) LookupEnum(moduleName string, enumName string) *Enum
- func (s System) LookupInterface(moduleName string, ifaceName string) *Interface
- func (s System) LookupMethod(moduleName string, ifaceName string, methodName string) *Method
- func (s System) LookupModule(name string) *Module
- func (s System) LookupProperty(moduleName string, ifaceName string, propName string) *TypedNode
- func (s System) LookupSignal(moduleName string, ifaceName string, eventName string) *Signal
- func (s System) LookupStruct(moduleName string, structName string) *Struct
- func (s *System) ResolveAll() error
- type TypedNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataParser ¶
type DataParser struct {
// contains filtered or unexported fields
}
func NewDataParser ¶
func NewDataParser(s *System) *DataParser
func (*DataParser) LintModule ¶
func (p *DataParser) LintModule(module *Module) error
func (*DataParser) ParseFile ¶
func (p *DataParser) ParseFile(file string) error
func (*DataParser) ParseJson ¶
func (p *DataParser) ParseJson(data []byte) error
func (*DataParser) ParseYaml ¶
func (p *DataParser) ParseYaml(data []byte) error
type Enum ¶
type Enum struct { NamedNode `json:",inline" yaml:",inline"` Members []*EnumMember `json:"members" yaml:"members"` }
Enum is an enumeration.
func (*Enum) ResolveAll ¶
type EnumMember ¶
type EnumMember struct { NamedNode `json:",inline" yaml:",inline"` Value int `json:"value" yaml:"value"` }
EnumMember is a member of an enumeration.
func NewEnumMember ¶
func NewEnumMember(name string, value int) *EnumMember
NewEnumMember creates a new EnumMember.
func (*EnumMember) ResolveAll ¶
func (e *EnumMember) ResolveAll(m *Module) error
type IModuleProvider ¶
type IModuleProvider interface {
GetModule() *Module
}
type ITypeProvider ¶
type Import ¶
type InputsProvider ¶
type InputsProvider interface {
GetInputs() []*TypedNode
}
type Interface ¶
type Interface struct { NamedNode `json:",inline" yaml:",inline"` Properties []*TypedNode `json:"properties" yaml:"properties"` Methods []*Method `json:"methods" yaml:"methods"` Signals []*Signal `json:"signals" yaml:"signals"` }
func NewInterface ¶
func (Interface) LookupMethod ¶
func (Interface) LookupProperty ¶
func (Interface) LookupSignal ¶
func (Interface) NoProperties ¶
func (*Interface) ResolveAll ¶
type Kind ¶
type Kind string
Kind is an enumeration of the kinds of nodes.
const ( KindSystem Kind = "system" KindModule Kind = "module" KindImport Kind = "import" KindInterface Kind = "interface" KindProperty Kind = "property" KindMethod Kind = "method" KindInput Kind = "input" KindOutput Kind = "output" KindSignal Kind = "signal" KindStruct Kind = "struct" KindField Kind = "field" KindEnum Kind = "enum" KindMember Kind = "member" )
type Method ¶
type Method struct { NamedNode `json:",inline" yaml:",inline"` // maybe inputs and outputs should be a map of name to Parameter Inputs []*TypedNode `json:"inputs" yaml:"inputs"` Output *TypedNode `json:"output" yaml:"output"` }
func (*Method) ResolveAll ¶
type Module ¶
type Module struct { NamedNode `json:",inline" yaml:",inline"` Version string `json:"version" yaml:"version"` Imports []*Import `json:"imports" yaml:"imports"` Interfaces []*Interface `json:"interfaces" yaml:"interfaces"` Structs []*Struct `json:"structs" yaml:"structs"` Enums []*Enum `json:"enums" yaml:"enums"` }
func (Module) LookupEnum ¶
func (Module) LookupInterface ¶
func (Module) LookupNode ¶
func (Module) LookupStruct ¶
func (*Module) ResolveAll ¶
type NamedNode ¶
NamedNode is a base node with a name and a kind. { "name": "foo", "kind": "interface" }
type Schema ¶
type Schema struct { Type string `json:"type" yaml:"type"` IsArray bool `json:"array" yaml:"array"` Module *Module KindType KindType IsPrimitive bool IsSymbol bool IsResolved bool // contains filtered or unexported fields }
TypeNode is a node with type information. { type: array, items: { type: string } }
func (*Schema) GetInterface ¶
func (*Schema) IsInterface ¶
func (Schema) LookupNode ¶
Lookup returns the node with the given name inside the module
func (*Schema) ResolveAll ¶
type Signal ¶
type Signal struct { NamedNode `json:",inline" yaml:",inline"` Inputs []*TypedNode `json:"inputs" yaml:"inputs"` }
func (*Signal) ResolveAll ¶
type Struct ¶
type Struct struct { NamedNode `json:",inline" yaml:",inline"` Fields []*TypedNode `json:"fields" yaml:"fields"` }
func (*Struct) ResolveAll ¶
type System ¶
type System struct { NamedNode `json:",inline" yaml:",inline"` Modules []*Module `json:"modules" yaml:"modules"` }
func (System) LookupInterface ¶
func (System) LookupMethod ¶
func (System) LookupModule ¶
func (System) LookupProperty ¶
func (System) LookupSignal ¶
func (System) LookupStruct ¶
func (*System) ResolveAll ¶
type TypedNode ¶
type TypedNode struct { NamedNode `json:",inline" yaml:",inline"` Schema `json:",inline" yaml:",inline"` }
TypedNode is a base node with a schema type. { name: "foo", kind: "property", type: "string" }
func NewTypedNode ¶
func (*TypedNode) ResolveAll ¶
Click to show internal directories.
Click to hide internal directories.