Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNonKeyedSetter = errors.New("mutator does not understand keyed lists")
ErrNonKeyedSetter occurs when a setter that doesn't understand keyed lists is called against a keyed list.
Functions ¶
Types ¶
type Setter ¶
type Setter interface {
// SetValue takes the object that needs mutating and the key of the
// field on that object that should be mutated. It is up to the
// implementor to actually mutate the object.
SetValue(obj map[string]interface{}, key string) error
// KeyedListOkay returns whether this setter can handle keyed lists.
// If it can't, an attempt to mutate a keyed-list-type field will
// result in an error.
KeyedListOkay() bool
// KeyedListValue is the value that will be assigned to the
// targeted keyed list entry. Unlike SetValue(), this does
// not do mutation directly.
KeyedListValue() (map[string]interface{}, error)
}
Setter tells the mutate function what to do once we have found the node that needs mutating.
func NewDefaultSetter ¶
func NewDefaultSetter(value interface{}) Setter
Click to show internal directories.
Click to hide internal directories.