Documentation ¶
Index ¶
- Constants
- Variables
- func CombineNode(originalValue, newValue *yaml.Node) error
- func DeleteNode(pn, child *yaml.Node)
- func MergeNode(nodes ...*yaml.Node) error
- func ReplaceNode(original, replace *yaml.Node) error
- func SetStyle(ss Styles, n ...*yaml.Node)
- type Action
- type OnMissingAction
- type Style
- type Styles
Constants ¶
View Source
const ( // Invalid overlay action. Invalid = iota // Merge overlay action. Merge // Replace overlay action. Replace // Delete overlay action. Delete // Combine overlay action. Combine )
View Source
const ( // Ignore onMissing action. Ignore = iota // Inject onMissing action. Inject )
View Source
const ( // ValueMarker is a format marker for the previous value. ValueMarker = `%v` // LineCommentMarker is a format marker for the previous line comment. LineCommentMarker = `%l` // HeadCommentMarker is a format marker for the previous head comment. HeadCommentMarker = `%h` // FootCommentMarker is a format marker for the previous foot comment. FootCommentMarker = `%f` // KeyMarker is a format marker for the previous key name. KeyMarker = `%k` )
Variables ¶
View Source
var ( // ErrMergeMustBeOfSameKind occurs when attempting to merge two different types. ErrMergeMustBeOfSameKind = errors.New("both values must be of same type to use 'merge' action") // ErrMergeUnsupportedType occurs when an unsupported YAML type is attempted to be merged. ErrMergeUnsupportedType = errors.New("not a supported yaml type for merging") )
View Source
var ErrCombineOnlyForScalars = errors.New("combine action can only be used on scalar values")
ErrCombineOnlyForScalars occurs when a non-scalar is attempted to be combined with a scalar value.
View Source
var ErrInvalidAction = errors.New("invalid overlay action")
ErrInvalidAction occurs when user passes a action that is not one of merge, replace, delete, combine.
Functions ¶
func CombineNode ¶
func CombineNode(originalValue, newValue *yaml.Node) error
func DeleteNode ¶
func DeleteNode(pn, child *yaml.Node)
func ReplaceNode ¶
func ReplaceNode(original, replace *yaml.Node) error
Types ¶
type OnMissingAction ¶
type OnMissingAction int
func (OnMissingAction) MarshalYAML ¶
func (a OnMissingAction) MarshalYAML() (interface{}, error)
func (OnMissingAction) String ¶
func (a OnMissingAction) String() string
func (*OnMissingAction) UnmarshalYAML ¶
func (a *OnMissingAction) UnmarshalYAML(value *yaml.Node) error
type Style ¶
type Style uint
const ( // TaggedStyle chooses YAML Tag style for rendering. TaggedStyle Style = 1 << iota // DoubleQuotedStyle chooses YAML Double Quoted style for rendering. DoubleQuotedStyle // SingleQuotedStyle chooses YAML Single Quoted style for rendering. SingleQuotedStyle // LiteralStyle chooses use YAML Literal style for rendering. LiteralStyle // FoldedStyle chooses use YAML Folded style for rendering. FoldedStyle // FlowStyle chooses YAML Flow style for rendering. FlowStyle // NormalStyle chooses YAML Normal style for rendering. NormalStyle )
Click to show internal directories.
Click to hide internal directories.