Documentation ¶
Index ¶
- func ColorizeAndPrint(bytes []byte, writer io.Writer) error
- func DebugNode(value *yaml.Node)
- func KindString(kind yaml.Kind) string
- type ArrayMergeStrategy
- type CommentsMergeStrategy
- type DataNavigator
- type Encoder
- type NavigationStrategy
- func DeleteNavigationStrategy(pathElementToDelete interface{}) NavigationStrategy
- func FilterMatchingNodesNavigationStrategy(value string) NavigationStrategy
- func MergeNavigationStrategy(updateCommand UpdateCommand, autoCreate bool) NavigationStrategy
- func ReadForMergeNavigationStrategy(arrayMergeStrategy ArrayMergeStrategy) NavigationStrategy
- func ReadNavigationStrategy() 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) ShouldOnlyDeeplyVisitLeaves(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 ArrayMergeStrategy ¶
type ArrayMergeStrategy uint32
const ( UpdateArrayMergeStrategy ArrayMergeStrategy = 1 << iota OverwriteArrayMergeStrategy AppendArrayMergeStrategy )
type CommentsMergeStrategy ¶
type CommentsMergeStrategy uint32
const ( SetWhenBlankCommentsMergeStrategy CommentsMergeStrategy = 1 << iota IgnoreCommentsMergeStrategy OverwriteCommentsMergeStrategy AppendCommentsMergeStrategy )
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. // when deeply traversing, should we visit all matching nodes, or just leaves? }
func DeleteNavigationStrategy ¶
func DeleteNavigationStrategy(pathElementToDelete interface{}) NavigationStrategy
func FilterMatchingNodesNavigationStrategy ¶
func FilterMatchingNodesNavigationStrategy(value string) NavigationStrategy
func MergeNavigationStrategy ¶
func MergeNavigationStrategy(updateCommand UpdateCommand, autoCreate bool) NavigationStrategy
func ReadForMergeNavigationStrategy ¶
func ReadForMergeNavigationStrategy(arrayMergeStrategy ArrayMergeStrategy) NavigationStrategy
func ReadNavigationStrategy ¶
func ReadNavigationStrategy() 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) ShouldOnlyDeeplyVisitLeaves ¶
func (ns *NavigationStrategyImpl) ShouldOnlyDeeplyVisitLeaves(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{} // middle nodes are nodes that match along the original path, but not a // target match of the path. This is only relevant when ShouldOnlyDeeplyVisitLeaves is false. IsMiddleNode bool }
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 ¶
type ValueParser interface {
Parse(argument string, customTag string, customStyle string, anchorName string, createAlias bool) *yaml.Node
}
func NewValueParser ¶
func NewValueParser() ValueParser
type YqLib ¶
type YqLib interface { Get(rootNode *yaml.Node, path string) ([]*NodeContext, error) GetForMerge(rootNode *yaml.Node, path string, arrayMergeStrategy ArrayMergeStrategy) ([]*NodeContext, error) Update(rootNode *yaml.Node, updateCommand UpdateCommand, autoCreate bool) error New(path string) yaml.Node PathStackToString(pathStack []interface{}) string MergePathStackToString(pathStack []interface{}, arrayMergeStrategy ArrayMergeStrategy) string }
Source Files ¶
- color_print.go
- data_navigator.go
- delete_navigation_strategy.go
- encoder.go
- filter_matching_node_navigation_strategy.go
- lib.go
- merge_navigation_strategy.go
- navigation_strategy.go
- path_parser.go
- read_for_merge_navigation_strategy.go
- read_navigation_strategy.go
- update_navigation_strategy.go
- value_parser.go
Click to show internal directories.
Click to hide internal directories.