Versions in this module Expand all Collapse all v0 v0.2.1 Mar 10, 2023 v0.2.0 Mar 2, 2023 Changes in this version + func DecodeStringForSchema(input []byte, s Object) (string, error) + func EncodeStringForSchema(input string, s Object) ([]byte, error) + func EncodeType(v T) ([]byte, error) + type Array struct + Length int + Type Type + func (a Array) IsNumeric() bool + func (a Array) MarshalJSON() ([]byte, error) + func (a Array) Size() int + func (a Array) ToSchema() string + func (a Array) Validate(val []byte) bool + type Composite struct + Keys []string + Values []Object + func (c Composite) IsNumeric() bool + func (c Composite) MarshalJSON() ([]byte, error) + func (c Composite) ToSchema() string + func (c Composite) Validate(val []byte) bool + type Object interface + IsNumeric func() bool + ToSchema func() string + Validate func([]byte) bool + func Parse(s string) (Object, error) + type Parser struct + Scanner Scanner + func (p *Parser) Parse() (schema Object, err error) + type Scanner struct + Input string + LastWidth int + Pos int + RuneWidth int + Start int + func (s *Scanner) Emit() parse.Token + func (s *Scanner) MatchKey() int + func (s *Scanner) MatchNumber() int + func (s *Scanner) Rewind() + func (s *Scanner) SkipToBoundary(boundary boundaryFunc) int + type SchemaType interface + type TokenType int + const TOK_BRACKET_O + const TOK_BRACKET_X + const TOK_COLON + const TOK_COMMA + const TOK_CURLY_O + const TOK_CURLY_X + const TOK_EOF + const TOK_INVALID + const TOK_KEY + const TOK_NUMBER + const TOK_TYPE + func (t TokenType) ToString() string + type Type struct + Name string + func (t Type) IsNumeric() bool + func (t Type) MarshalJSON() ([]byte, error) + func (t Type) Size() int + func (t Type) ToSchema() string + func (t Type) Validate(val []byte) bool + type Unknown struct + func (u Unknown) IsNumeric() bool + func (u Unknown) ToSchema() string + func (u Unknown) Validate(_ []byte) bool