Documentation
¶
Index ¶
- func ColorizeAndPrint(bytes []byte, writer io.Writer) error
- func DebugNode(value *yaml.Node)
- func KindString(kind yaml.Kind) string
- type DataNavigator
- type Encoder
- type NavigationStrategy
- func DeleteNavigationStrategy(pathElementToDelete interface{}) NavigationStrategy
- func FilterMatchingNodesNavigationStrategy(value string) NavigationStrategy
- func ReadNavigationStrategy(deeplyTraverseArrays bool) NavigationStrategy
- func UpdateNavigationStrategy(updateCommand UpdateCommand, autoCreate bool) NavigationStrategy
- type NavigationStrategyImpl
- func (ns *NavigationStrategyImpl) AutoCreateMap(nodeContext NodeContext) bool
- func (ns *NavigationStrategyImpl) DebugVisitedNodes()
- func (ns *NavigationStrategyImpl) FollowAlias(nodeContext NodeContext) bool
- func (ns *NavigationStrategyImpl) GetPathParser() PathParser
- func (ns *NavigationStrategyImpl) GetVisitedNodes() []*NodeContext
- func (ns *NavigationStrategyImpl) ShouldDeeplyTraverse(nodeContext NodeContext) bool
- func (ns *NavigationStrategyImpl) ShouldTraverse(nodeContext NodeContext, nodeKey string) bool
- func (ns *NavigationStrategyImpl) Visit(nodeContext NodeContext) error
- type NodeContext
- type PathParser
- type UpdateCommand
- type ValueParser
- type YqLib
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KindString ¶
Types ¶
type DataNavigator ¶
type DataNavigator interface {
}
func NewDataNavigator ¶
func NewDataNavigator(NavigationStrategy NavigationStrategy) DataNavigator
type Encoder ¶
func NewJsonEncoder ¶
type NavigationStrategy ¶
type NavigationStrategy interface {
// node key is the string value of the last element in the path stack
// we use it to match against the pathExpression in head.
}
func DeleteNavigationStrategy ¶
func DeleteNavigationStrategy(pathElementToDelete interface{}) NavigationStrategy
func FilterMatchingNodesNavigationStrategy ¶
func FilterMatchingNodesNavigationStrategy(value string) NavigationStrategy
func ReadNavigationStrategy ¶
func ReadNavigationStrategy(deeplyTraverseArrays bool) NavigationStrategy
func UpdateNavigationStrategy ¶
func UpdateNavigationStrategy(updateCommand UpdateCommand, autoCreate bool) NavigationStrategy
type NavigationStrategyImpl ¶
type NavigationStrategyImpl struct {
// contains filtered or unexported fields
}
func (*NavigationStrategyImpl) AutoCreateMap ¶
func (ns *NavigationStrategyImpl) AutoCreateMap(nodeContext NodeContext) bool
func (*NavigationStrategyImpl) DebugVisitedNodes ¶
func (ns *NavigationStrategyImpl) DebugVisitedNodes()
func (*NavigationStrategyImpl) FollowAlias ¶
func (ns *NavigationStrategyImpl) FollowAlias(nodeContext NodeContext) bool
func (*NavigationStrategyImpl) GetPathParser ¶
func (ns *NavigationStrategyImpl) GetPathParser() PathParser
func (*NavigationStrategyImpl) GetVisitedNodes ¶
func (ns *NavigationStrategyImpl) GetVisitedNodes() []*NodeContext
func (*NavigationStrategyImpl) ShouldDeeplyTraverse ¶
func (ns *NavigationStrategyImpl) ShouldDeeplyTraverse(nodeContext NodeContext) bool
func (*NavigationStrategyImpl) ShouldTraverse ¶
func (ns *NavigationStrategyImpl) ShouldTraverse(nodeContext NodeContext, nodeKey string) bool
func (*NavigationStrategyImpl) Visit ¶
func (ns *NavigationStrategyImpl) Visit(nodeContext NodeContext) error
type NodeContext ¶
type NodeContext struct {
Node *yaml.Node
Head interface{}
Tail []interface{}
PathStack []interface{}
}
func NewNodeContext ¶
func NewNodeContext(node *yaml.Node, head interface{}, tail []interface{}, pathStack []interface{}) NodeContext
type PathParser ¶
type PathParser interface {
ParsePath(path string) []interface{}
MatchesNextPathElement(nodeContext NodeContext, nodeKey string) bool
IsPathExpression(pathElement string) bool
}
func NewPathParser ¶
func NewPathParser() PathParser
type UpdateCommand ¶
type ValueParser ¶
func NewValueParser ¶
func NewValueParser() ValueParser
type YqLib ¶
type YqLib interface {
Get(rootNode *yaml.Node, path string, deeplyTraverseArrays bool) ([]*NodeContext, error)
Update(rootNode *yaml.Node, updateCommand UpdateCommand, autoCreate bool) error
New(path string) yaml.Node
PathStackToString(pathStack []interface{}) string
MergePathStackToString(pathStack []interface{}, appendArrays bool) string
}
Click to show internal directories.
Click to hide internal directories.