Documentation
¶
Index ¶
- Constants
- Variables
- type AST_NODETYPE
- type JsonArrayNode
- type JsonBooleanNode
- type JsonCollectionNode
- type JsonExtendedStringWIthVariableNode
- func (node *JsonExtendedStringWIthVariableNode) GetNodeType() AST_NODETYPE
- func (node *JsonExtendedStringWIthVariableNode) GetValue() string
- func (node *JsonExtendedStringWIthVariableNode) ShouldOmitEmpty() bool
- func (node *JsonExtendedStringWIthVariableNode) String() string
- func (node *JsonExtendedStringWIthVariableNode) Visit(visitor JsonVisitor) error
- type JsonExtendedVariableNode
- type JsonKeyValuePairNode
- type JsonNode
- type JsonNullNode
- type JsonNumberNode
- type JsonObjectNode
- func (node *JsonObjectNode) Append(kvNode *JsonKeyValuePairNode)
- func (node *JsonObjectNode) GetNodeType() AST_NODETYPE
- func (node *JsonObjectNode) Length() int
- func (node *JsonObjectNode) ShouldOmitEmpty() bool
- func (node *JsonObjectNode) String() string
- func (node *JsonObjectNode) Visit(visitor JsonVisitor) error
- type JsonStringNode
- func (node *JsonStringNode) GetNodeType() AST_NODETYPE
- func (node *JsonStringNode) GetValue() string
- func (node *JsonStringNode) ShouldOmitEmpty() bool
- func (node *JsonStringNode) String() string
- func (node *JsonStringNode) ToArrayNode() (*JsonArrayNode, error)
- func (node *JsonStringNode) Visit(visitor JsonVisitor) error
- type JsonStringValueNode
- type JsonVisitor
- type JsonextAST
- func (i *JsonextAST) CreateNewASTNode(t AST_NODETYPE, value interface{}) error
- func (i *JsonextAST) CreateNewNodeForArrayObject(owner *JsonArrayNode, t AST_NODETYPE, value interface{}) error
- func (i *JsonextAST) CreateNewNodeForObject(owner *JsonObjectNode, t AST_NODETYPE, value interface{}) error
- func (i *JsonextAST) CreateRootNode(t AST_NODETYPE, value interface{}) error
- func (i *JsonextAST) CreateValueNodeForKVPairs(owner *JsonKeyValuePairNode, t AST_NODETYPE, value interface{}) error
- func (i *JsonextAST) EncloseLatestElements() error
- func (i *JsonextAST) FinlizeKVPair() error
- func (i *JsonextAST) GetAST() JsonNode
- func (i *JsonextAST) HasComplete() bool
- func (i *JsonextAST) HasOpenElement() bool
- func (i *JsonextAST) StoreFinlizedItemToOwner(itemToFinalize JsonNode) error
- func (i *JsonextAST) TopElementType() (AST_NODETYPE, error)
- type MarshalerFunc
- type NodeVisitor
- type UnmarshalerFunc
Constants ¶
View Source
const ( AST_STATE_INIT astState = iota AST_STATE_INTERMIDIEATE AST_STATE_FINISHED )
Variables ¶
View Source
var ( ErrorASTComplete = errors.New("cannot create new ast node when the ast has finished") ErrorASTStackInvalidElement = errors.New("ast trace stack will only contain: kv, array, object, no primitive values") ErrorASTUnexpectedElement = errors.New("unexecpted stack element type") ErrorASTUnexpectedOwnerElement = errors.New("unexecpted stack owner element type") ErrorASTStackEmpty = errors.New("unexecpted stack empty") ErrorASTEncloseElementType = errors.New("enclose element type must be array or object") ErrorASTIncorrectNodeType = errors.New("incorrect node type") ErrorASTKeyValuePairNotStringAsKey = errors.New("object key should be string") )
Functions ¶
This section is empty.
Types ¶
type AST_NODETYPE ¶
type AST_NODETYPE byte
const ( AST_NODE_TYPE_BOUNDARY AST_NODETYPE = 200 AST_ARRAY AST_NODETYPE = 201 AST_OBJECT AST_NODETYPE = 202 AST_KVPAIR AST_NODETYPE = 203 AST_VARIABLE AST_NODETYPE = 204 AST_STRING_VARIABLE AST_NODETYPE = 205 AST_STRING AST_NODETYPE = 206 AST_NUMBER AST_NODETYPE = 207 AST_BOOLEAN AST_NODETYPE = 208 AST_NULL AST_NODETYPE = 209 AST_NODE_UNDEFINED AST_NODETYPE = 210 )
func ConvertTokenTypeToNodeType ¶ added in v0.4.0
func ConvertTokenTypeToNodeType(t token.TokenType) AST_NODETYPE
func (AST_NODETYPE) Byte ¶ added in v0.3.2
func (a AST_NODETYPE) Byte() byte
type JsonArrayNode ¶
type JsonArrayNode struct {
Value []JsonNode
}
func (*JsonArrayNode) Append ¶
func (node *JsonArrayNode) Append(n JsonNode)
func (*JsonArrayNode) GetNodeType ¶
func (node *JsonArrayNode) GetNodeType() AST_NODETYPE
func (*JsonArrayNode) Length ¶ added in v0.3.0
func (node *JsonArrayNode) Length() int
func (*JsonArrayNode) ShouldOmitEmpty ¶ added in v0.4.0
func (node *JsonArrayNode) ShouldOmitEmpty() bool
func (*JsonArrayNode) String ¶ added in v0.4.0
func (node *JsonArrayNode) String() string
func (*JsonArrayNode) Visit ¶
func (node *JsonArrayNode) Visit(visitor JsonVisitor) error
type JsonBooleanNode ¶
type JsonBooleanNode struct {
Value bool
}
func (*JsonBooleanNode) GetNodeType ¶
func (node *JsonBooleanNode) GetNodeType() AST_NODETYPE
func (*JsonBooleanNode) ShouldOmitEmpty ¶ added in v0.4.0
func (node *JsonBooleanNode) ShouldOmitEmpty() bool
func (*JsonBooleanNode) String ¶ added in v0.4.0
func (node *JsonBooleanNode) String() string
func (*JsonBooleanNode) Visit ¶
func (node *JsonBooleanNode) Visit(visitor JsonVisitor) error
type JsonCollectionNode ¶ added in v0.3.0
type JsonExtendedStringWIthVariableNode ¶
type JsonExtendedStringWIthVariableNode struct {
JsonStringNode
Variables map[string][]byte
}
func (*JsonExtendedStringWIthVariableNode) GetNodeType ¶
func (node *JsonExtendedStringWIthVariableNode) GetNodeType() AST_NODETYPE
func (*JsonExtendedStringWIthVariableNode) GetValue ¶ added in v0.3.0
func (node *JsonExtendedStringWIthVariableNode) GetValue() string
func (*JsonExtendedStringWIthVariableNode) ShouldOmitEmpty ¶ added in v0.4.0
func (node *JsonExtendedStringWIthVariableNode) ShouldOmitEmpty() bool
func (*JsonExtendedStringWIthVariableNode) String ¶ added in v0.4.0
func (node *JsonExtendedStringWIthVariableNode) String() string
func (*JsonExtendedStringWIthVariableNode) Visit ¶
func (node *JsonExtendedStringWIthVariableNode) Visit(visitor JsonVisitor) error
type JsonExtendedVariableNode ¶
func (*JsonExtendedVariableNode) GetNodeType ¶
func (node *JsonExtendedVariableNode) GetNodeType() AST_NODETYPE
func (*JsonExtendedVariableNode) ShouldOmitEmpty ¶ added in v0.4.0
func (node *JsonExtendedVariableNode) ShouldOmitEmpty() bool
func (*JsonExtendedVariableNode) String ¶ added in v0.4.0
func (node *JsonExtendedVariableNode) String() string
func (*JsonExtendedVariableNode) Visit ¶
func (node *JsonExtendedVariableNode) Visit(visitor JsonVisitor) error
type JsonKeyValuePairNode ¶
type JsonKeyValuePairNode struct {
Key JsonStringValueNode
Value JsonNode
}
func (*JsonKeyValuePairNode) GetNodeType ¶
func (node *JsonKeyValuePairNode) GetNodeType() AST_NODETYPE
func (*JsonKeyValuePairNode) IsFilled ¶
func (node *JsonKeyValuePairNode) IsFilled() bool
func (*JsonKeyValuePairNode) ShouldOmitEmpty ¶ added in v0.4.0
func (node *JsonKeyValuePairNode) ShouldOmitEmpty() bool
func (*JsonKeyValuePairNode) String ¶ added in v0.4.0
func (node *JsonKeyValuePairNode) String() string
func (*JsonKeyValuePairNode) Visit ¶
func (node *JsonKeyValuePairNode) Visit(visitor JsonVisitor) error
type JsonNode ¶
type JsonNode interface {
GetNodeType() AST_NODETYPE
Visit(visitor JsonVisitor) error
String() string
ShouldOmitEmpty() bool
}
func NodeFactory ¶ added in v0.4.0
func NodeFactory(t AST_NODETYPE, value interface{}) (JsonNode, error)
type JsonNullNode ¶
type JsonNullNode struct {
Value interface{}
}
func (*JsonNullNode) GetNodeType ¶
func (node *JsonNullNode) GetNodeType() AST_NODETYPE
func (*JsonNullNode) ShouldOmitEmpty ¶ added in v0.4.0
func (node *JsonNullNode) ShouldOmitEmpty() bool
func (*JsonNullNode) String ¶ added in v0.4.0
func (node *JsonNullNode) String() string
func (*JsonNullNode) Visit ¶
func (node *JsonNullNode) Visit(visitor JsonVisitor) error
type JsonNumberNode ¶
type JsonNumberNode struct {
Value float64
}
func (*JsonNumberNode) GetNodeType ¶
func (node *JsonNumberNode) GetNodeType() AST_NODETYPE
func (*JsonNumberNode) ShouldOmitEmpty ¶ added in v0.4.0
func (node *JsonNumberNode) ShouldOmitEmpty() bool
func (*JsonNumberNode) String ¶ added in v0.4.0
func (node *JsonNumberNode) String() string
func (*JsonNumberNode) Visit ¶
func (node *JsonNumberNode) Visit(visitor JsonVisitor) error
type JsonObjectNode ¶
type JsonObjectNode struct {
Value []*JsonKeyValuePairNode
}
func (*JsonObjectNode) Append ¶
func (node *JsonObjectNode) Append(kvNode *JsonKeyValuePairNode)
func (*JsonObjectNode) GetNodeType ¶
func (node *JsonObjectNode) GetNodeType() AST_NODETYPE
func (*JsonObjectNode) Length ¶ added in v0.3.0
func (node *JsonObjectNode) Length() int
func (*JsonObjectNode) ShouldOmitEmpty ¶ added in v0.4.0
func (node *JsonObjectNode) ShouldOmitEmpty() bool
func (*JsonObjectNode) String ¶ added in v0.4.0
func (node *JsonObjectNode) String() string
func (*JsonObjectNode) Visit ¶
func (node *JsonObjectNode) Visit(visitor JsonVisitor) error
type JsonStringNode ¶
type JsonStringNode struct {
Value []byte
}
func (*JsonStringNode) GetNodeType ¶
func (node *JsonStringNode) GetNodeType() AST_NODETYPE
func (*JsonStringNode) GetValue ¶ added in v0.3.0
func (node *JsonStringNode) GetValue() string
func (*JsonStringNode) ShouldOmitEmpty ¶ added in v0.4.0
func (node *JsonStringNode) ShouldOmitEmpty() bool
func (*JsonStringNode) String ¶ added in v0.4.0
func (node *JsonStringNode) String() string
func (*JsonStringNode) ToArrayNode ¶ added in v0.3.0
func (node *JsonStringNode) ToArrayNode() (*JsonArrayNode, error)
func (*JsonStringNode) Visit ¶
func (node *JsonStringNode) Visit(visitor JsonVisitor) error
type JsonStringValueNode ¶ added in v0.3.0
type JsonVisitor ¶
type JsonVisitor interface {
VisitStringNode(node *JsonStringNode) error
VisitNumberNode(node *JsonNumberNode) error
VisitBooleanNode(node *JsonBooleanNode) error
VisitNullNode(node *JsonNullNode) error
VisitArrayNode(node *JsonArrayNode) error
VisitKeyValuePairNode(node *JsonKeyValuePairNode) error
VisitObjectNode(node *JsonObjectNode) error
VisitVariableNode(node *JsonExtendedVariableNode) error
VisitStringWithVariableNode(node *JsonExtendedStringWIthVariableNode) error
}
type JsonextAST ¶ added in v0.3.2
type JsonextAST struct {
// contains filtered or unexported fields
}
func NewJsonextAST ¶ added in v0.3.2
func NewJsonextAST() *JsonextAST
func (*JsonextAST) CreateNewASTNode ¶ added in v0.3.2
func (i *JsonextAST) CreateNewASTNode(t AST_NODETYPE, value interface{}) error
func (*JsonextAST) CreateNewNodeForArrayObject ¶ added in v0.3.2
func (i *JsonextAST) CreateNewNodeForArrayObject(owner *JsonArrayNode, t AST_NODETYPE, value interface{}) error
func (*JsonextAST) CreateNewNodeForObject ¶ added in v0.3.2
func (i *JsonextAST) CreateNewNodeForObject(owner *JsonObjectNode, t AST_NODETYPE, value interface{}) error
func (*JsonextAST) CreateRootNode ¶ added in v0.3.2
func (i *JsonextAST) CreateRootNode(t AST_NODETYPE, value interface{}) error
func (*JsonextAST) CreateValueNodeForKVPairs ¶ added in v0.3.2
func (i *JsonextAST) CreateValueNodeForKVPairs(owner *JsonKeyValuePairNode, t AST_NODETYPE, value interface{}) error
func (*JsonextAST) EncloseLatestElements ¶ added in v0.3.2
func (i *JsonextAST) EncloseLatestElements() error
func (*JsonextAST) FinlizeKVPair ¶ added in v0.3.2
func (i *JsonextAST) FinlizeKVPair() error
2 reason to finalise, enclose of kv pair due to `,`, enclose of kv pair due to `}` {"1":2,"3":4}
func (*JsonextAST) GetAST ¶ added in v0.3.2
func (i *JsonextAST) GetAST() JsonNode
func (*JsonextAST) HasComplete ¶ added in v0.3.2
func (i *JsonextAST) HasComplete() bool
func (*JsonextAST) HasOpenElement ¶ added in v0.3.2
func (i *JsonextAST) HasOpenElement() bool
func (*JsonextAST) StoreFinlizedItemToOwner ¶ added in v0.3.2
func (i *JsonextAST) StoreFinlizedItemToOwner(itemToFinalize JsonNode) error
func (*JsonextAST) TopElementType ¶ added in v0.3.2
func (i *JsonextAST) TopElementType() (AST_NODETYPE, error)
type MarshalerFunc ¶ added in v0.4.0
type NodeVisitor ¶ added in v0.4.0
type NodeVisitor interface {
VisitStringNode(node *JsonStringNode) error
VisitNumberNode(node *JsonNumberNode) error
VisitBooleanNode(node *JsonBooleanNode) error
VisitNullNode(node *JsonNullNode) error
VisitArrayNode(node *JsonArrayNode) error
VisitKeyValuePairNode(node *JsonKeyValuePairNode) error
VisitObjectNode(node *JsonObjectNode) error
VisitVariableNode(node *JsonExtendedVariableNode) error
VisitStringWithVariableNode(node *JsonExtendedStringWIthVariableNode) error
}
type UnmarshalerFunc ¶ added in v0.4.0
Click to show internal directories.
Click to hide internal directories.