Documentation ¶
Index ¶
- func Walk(v Visitor, node Node)
- type AliasNode
- type AnchorNode
- type ArrayNode
- type ArrayNodeIter
- type BoolNode
- type DirectiveNode
- type Document
- type File
- type FloatNode
- type InfinityNode
- type IntegerNode
- type LiteralNode
- type MapNode
- type MapNodeIter
- type MappingNode
- type MappingValueNode
- type MergeKeyNode
- type NanNode
- type Node
- type NodeType
- type NullNode
- type ScalarNode
- type SequenceNode
- type StringNode
- type TagNode
- type Visitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AliasNode ¶
AliasNode type of alias node
type AnchorNode ¶
AnchorNode type of anchor node
func (*AnchorNode) GetToken ¶
func (n *AnchorNode) GetToken() *token.Token
GetToken returns token instance
type ArrayNode ¶
type ArrayNode interface {
ArrayRange() *ArrayNodeIter
}
ArrayNode interface of SequenceNode
type ArrayNodeIter ¶
type ArrayNodeIter struct {
// contains filtered or unexported fields
}
ArrayNodeIter is an iterator for ranging over a ArrayNode
func (*ArrayNodeIter) Next ¶
func (m *ArrayNodeIter) Next() bool
Next advances the array iterator and reports whether there is another entry. It returns false when the iterator is exhausted.
func (*ArrayNodeIter) Value ¶
func (m *ArrayNodeIter) Value() Node
Value returns the value of the iterator's current array entry.
type BoolNode ¶
type BoolNode struct { ScalarNode Token *token.Token Value bool }
BoolNode type of boolean node
type DirectiveNode ¶
DirectiveNode type of directive node
func (*DirectiveNode) GetToken ¶
func (n *DirectiveNode) GetToken() *token.Token
GetToken returns token instance
type Document ¶
type Document struct { Start *token.Token // position of DocumentHeader ( `---` ) End *token.Token // position of DocumentEnd ( `...` ) Body Node }
Document type of Document
type FloatNode ¶
type FloatNode struct { ScalarNode Token *token.Token Precision int Value float64 }
FloatNode type of float node
type InfinityNode ¶
type InfinityNode struct { ScalarNode Token *token.Token Value float64 }
InfinityNode type of infinity node
func (*InfinityNode) GetToken ¶
func (n *InfinityNode) GetToken() *token.Token
GetToken returns token instance
func (*InfinityNode) GetValue ¶
func (n *InfinityNode) GetValue() interface{}
GetValue returns math.Inf(0) or math.Inf(-1)
type IntegerNode ¶
type IntegerNode struct { ScalarNode Token *token.Token Value interface{} // int64 or uint64 value }
IntegerNode type of integer node
func (*IntegerNode) GetToken ¶
func (n *IntegerNode) GetToken() *token.Token
GetToken returns token instance
func (*IntegerNode) GetValue ¶
func (n *IntegerNode) GetValue() interface{}
GetValue returns int64 value
type LiteralNode ¶
type LiteralNode struct { ScalarNode Start *token.Token Value *StringNode }
LiteralNode type of literal node
func (*LiteralNode) GetToken ¶
func (n *LiteralNode) GetToken() *token.Token
GetToken returns token instance
func (*LiteralNode) GetValue ¶
func (n *LiteralNode) GetValue() interface{}
GetValue returns string value
type MapNode ¶
type MapNode interface {
MapRange() *MapNodeIter
}
MapNode interface of MappingValueNode / MappingNode
type MapNodeIter ¶
type MapNodeIter struct {
// contains filtered or unexported fields
}
MapNodeIter is an iterator for ranging over a MapNode
func (*MapNodeIter) Key ¶
func (m *MapNodeIter) Key() Node
Key returns the key of the iterator's current map node entry.
func (*MapNodeIter) Next ¶
func (m *MapNodeIter) Next() bool
Next advances the map iterator and reports whether there is another entry. It returns false when the iterator is exhausted.
func (*MapNodeIter) Value ¶
func (m *MapNodeIter) Value() Node
Value returns the value of the iterator's current map node entry.
type MappingNode ¶
type MappingNode struct { Start *token.Token End *token.Token IsFlowStyle bool Values []*MappingValueNode }
MappingNode type of mapping node
func Mapping ¶
func Mapping(tk *token.Token, isFlowStyle bool) *MappingNode
Mapping create node for map
func (*MappingNode) GetToken ¶
func (n *MappingNode) GetToken() *token.Token
GetToken returns token instance
func (*MappingNode) MapRange ¶
func (n *MappingNode) MapRange() *MapNodeIter
MapRange implements MapNode protocol
type MappingValueNode ¶
MappingValueNode type of mapping value
func (*MappingValueNode) GetToken ¶
func (n *MappingValueNode) GetToken() *token.Token
GetToken returns token instance
func (*MappingValueNode) MapRange ¶
func (n *MappingValueNode) MapRange() *MapNodeIter
MapRange implements MapNode protocol
func (*MappingValueNode) String ¶
func (n *MappingValueNode) String() string
String mapping value to text
func (*MappingValueNode) Type ¶
func (n *MappingValueNode) Type() NodeType
Type returns MappingValueType
type MergeKeyNode ¶
type MergeKeyNode struct { ScalarNode Token *token.Token }
MergeKeyNode type of merge key node
func (*MergeKeyNode) GetToken ¶
func (n *MergeKeyNode) GetToken() *token.Token
GetToken returns token instance
func (*MergeKeyNode) GetValue ¶
func (n *MergeKeyNode) GetValue() interface{}
GetValue returns '<<' value
type NanNode ¶
type NanNode struct { ScalarNode Token *token.Token }
NanNode type of nan node
type Node ¶
type Node interface { // String node to text String() string // GetToken returns token instance GetToken() *token.Token // Type returns type of node Type() NodeType }
Node type of node
type NodeType ¶
type NodeType int
NodeType type identifier of node
const ( // UnknownNodeType type identifier for default UnknownNodeType NodeType = iota // DocumentType type identifier for document node DocumentType // NullType type identifier for null node NullType // BoolType type identifier for boolean node BoolType // IntegerType type identifier for integer node IntegerType // FloatType type identifier for float node FloatType // InfinityType type identifier for infinity node InfinityType // NanType type identifier for nan node NanType // StringType type identifier for string node StringType // MergeKeyType type identifier for merge key node MergeKeyType // LiteralType type identifier for literal node LiteralType // MappingType type identifier for mapping node MappingType // MappingValueType type identifier for mapping value node MappingValueType // SequenceType type identifier for sequence node SequenceType // AnchorType type identifier for anchor node AnchorType // AliasType type identifier for alias node AliasType // DirectiveType type identifier for directive node DirectiveType // TagType type identifier for tag node TagType )
type NullNode ¶
type NullNode struct { ScalarNode Token *token.Token }
NullNode type of null node
type ScalarNode ¶
type ScalarNode interface { Node GetValue() interface{} }
ScalarNode type for scalar node
type SequenceNode ¶
SequenceNode type of sequence node
func Sequence ¶
func Sequence(tk *token.Token, isFlowStyle bool) *SequenceNode
Sequence create node for sequence
func (*SequenceNode) ArrayRange ¶
func (n *SequenceNode) ArrayRange() *ArrayNodeIter
ArrayRange implements ArrayNode protocol
func (*SequenceNode) GetToken ¶
func (n *SequenceNode) GetToken() *token.Token
GetToken returns token instance
type StringNode ¶
type StringNode struct { ScalarNode Token *token.Token Value string }
StringNode type of string node
func (*StringNode) GetToken ¶
func (n *StringNode) GetToken() *token.Token
GetToken returns token instance
func (*StringNode) GetValue ¶
func (n *StringNode) GetValue() interface{}
GetValue returns string value
func (*StringNode) String ¶
func (n *StringNode) String() string
String string value to text with quote if required