Versions in this module Expand all Collapse all v0 v0.2.0 May 9, 2024 v0.1.1 Nov 16, 2022 Changes in this version + var ErrUnknownSchemaType = errors.New("unknown schema type") + func IsValidType(s string) bool + type ASTNode struct + Children []ASTNode + Comment string + InheritedFrom string + IsKeyShortcut bool + Key string + Rules *RuleASTNodes + SchemaType string + TokenType TokenType + Value string + func (c *ASTNode) ObjectProperty(k string) *ASTNode + func (c *ASTNode) Unshift(n ASTNode) + type ASTNodes struct + func (m *ASTNodes) Delete(k string) + func (m *ASTNodes) Each(fn eachASTNodesFunc) error + func (m *ASTNodes) EachSafe(fn eachSafeASTNodesFunc) + func (m *ASTNodes) Filter(fn filterASTNodesFunc) + func (m *ASTNodes) Find(fn findASTNodesFunc) (ASTNodesItem, bool) + func (m *ASTNodes) Get(k string) (ASTNode, bool) + func (m *ASTNodes) GetValue(k string) ASTNode + func (m *ASTNodes) Has(k string) bool + func (m *ASTNodes) Len() int + func (m *ASTNodes) Map(fn mapASTNodesFunc) error + func (m *ASTNodes) MarshalJSON() ([]byte, error) + func (m *ASTNodes) Set(k string, v ASTNode) + func (m *ASTNodes) Update(k string, fn func(v ASTNode) ASTNode) + type ASTNodesItem struct + Key string + Value ASTNode + type Document interface + Check func() error + Content func() bytes.Bytes + Len func() (uint, error) + NextLexeme func() (lexeme.LexEvent, error) + type Rule interface + Check func() error + GetAST func() (ASTNode, error) + Len func() (uint, error) + type RuleASTNode struct + Comment string + Items []RuleASTNode + Properties *RuleASTNodes + Source RuleASTNodeSource + TokenType TokenType + Value string + type RuleASTNodeSource int + const RuleASTNodeSourceGenerated + const RuleASTNodeSourceManual + const RuleASTNodeSourceUnknown + type RuleASTNodes struct + func MakeRuleASTNodes(capacity int) *RuleASTNodes + func NewRuleASTNodes(data map[string]RuleASTNode, order []string) *RuleASTNodes + func (m *RuleASTNodes) Delete(k string) + func (m *RuleASTNodes) Each(fn eachRuleASTNodesFunc) error + func (m *RuleASTNodes) EachSafe(fn eachSafeRuleASTNodesFunc) + func (m *RuleASTNodes) Filter(fn filterRuleASTNodesFunc) + func (m *RuleASTNodes) Find(fn findRuleASTNodesFunc) (RuleASTNodesItem, bool) + func (m *RuleASTNodes) Get(k string) (RuleASTNode, bool) + func (m *RuleASTNodes) GetValue(k string) RuleASTNode + func (m *RuleASTNodes) Has(k string) bool + func (m *RuleASTNodes) Len() int + func (m *RuleASTNodes) Map(fn mapRuleASTNodesFunc) error + func (m *RuleASTNodes) MarshalJSON() ([]byte, error) + func (m *RuleASTNodes) Set(k string, v RuleASTNode) + func (m *RuleASTNodes) Update(k string, fn func(v RuleASTNode) RuleASTNode) + type RuleASTNodesItem struct + Key string + Value RuleASTNode + type Schema interface + AddRule func(name string, schema Rule) error + AddType func(name string, schema Schema) error + Check func() error + Example func() ([]byte, error) + GetAST func() (ASTNode, error) + Len func() (uint, error) + UsedUserTypes func() ([]string, error) + type SchemaType string + const SchemaTypeAny + const SchemaTypeArray + const SchemaTypeBoolean + const SchemaTypeComment + const SchemaTypeDate + const SchemaTypeDateTime + const SchemaTypeDecimal + const SchemaTypeEmail + const SchemaTypeEnum + const SchemaTypeFloat + const SchemaTypeInteger + const SchemaTypeMixed + const SchemaTypeNull + const SchemaTypeObject + const SchemaTypeString + const SchemaTypeURI + const SchemaTypeUUID + const SchemaTypeUndefined + func GuessSchemaType(b []byte) (SchemaType, error) + func (t SchemaType) IsEqualSoft(x SchemaType) bool + func (t SchemaType) IsOneOf(tt ...SchemaType) bool + func (t SchemaType) IsScalar() bool + func (t SchemaType) ToTokenType() string + type TokenType = string + const TokenTypeArray + const TokenTypeBoolean + const TokenTypeNull + const TokenTypeNumber + const TokenTypeObject + const TokenTypeShortcut + const TokenTypeString