Documentation ¶
Index ¶
- type SetFn
- type TrackableSetter
- func (s TrackableSetter) SetEntry(name, value, tag string) SetFn
- func (s TrackableSetter) SetEntryIfEmpty(key, value, tag string) SetFn
- func (s TrackableSetter) SetScalar(value string) SetFn
- func (s TrackableSetter) SetScalarIfEmpty(value string) SetFn
- func (s *TrackableSetter) WithMutationTracker(callback func(key, value, tag string, node *yaml.RNode)) *TrackableSetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SetFn ¶ added in v0.6.0
SetFn is a function that accepts an RNode to possibly modify.
type TrackableSetter ¶ added in v0.11.0
type TrackableSetter struct {
// contains filtered or unexported fields
}
func (TrackableSetter) SetEntry ¶ added in v0.11.0
func (s TrackableSetter) SetEntry(name, value, tag string) SetFn
SetEntry returns a SetFn to set a field or a map entry to a value. It can be used with an empty name to set both a value and a tag on a scalar node. When setting only a value on a scalar node, use SetScalar instead. If a mutation tracker has been registered, the tracker will be invoked each time an entry is set.
func (TrackableSetter) SetEntryIfEmpty ¶ added in v0.12.0
func (s TrackableSetter) SetEntryIfEmpty(key, value, tag string) SetFn
SetEntryIfEmpty returns a SetFn to set a field or a map entry to a value only if it isn't already set. It can be used with an empty name to set both a value and a tag on a scalar node. When setting only a value on a scalar node, use SetScalar instead. If a mutation tracker has been registered, the tracker will be invoked each time an entry is actually set.
func (TrackableSetter) SetScalar ¶ added in v0.11.0
func (s TrackableSetter) SetScalar(value string) SetFn
SetScalar returns a SetFn to set a scalar value. if a mutation tracker has been registered, the tracker will be invoked each time a scalar is set
func (TrackableSetter) SetScalarIfEmpty ¶ added in v0.12.0
func (s TrackableSetter) SetScalarIfEmpty(value string) SetFn
SetScalarIfEmpty returns a SetFn to set a scalar value only if it isn't already set. If a mutation tracker has been registered, the tracker will be invoked each time a scalar is actually set.
func (*TrackableSetter) WithMutationTracker ¶ added in v0.11.0
func (s *TrackableSetter) WithMutationTracker(callback func(key, value, tag string, node *yaml.RNode)) *TrackableSetter
WithMutationTracker registers a callback which will be invoked each time a field is mutated