Documentation ¶
Index ¶
- func DeepCopyYAML(x yaml.MapSlice) yaml.MapSlice
- func DeepCopyYAMLValue(x interface{}) interface{}
- func Marshal(o interface{}) ([]byte, error)
- func NestedBool(obj yaml.MapSlice, fields ...string) (bool, bool, error)
- func NestedFieldCopy(obj yaml.MapSlice, fields ...string) (interface{}, bool, error)
- func NestedFieldNoCopy(obj yaml.MapSlice, fields ...string) (interface{}, bool, error)
- func NestedFloat64(obj yaml.MapSlice, fields ...string) (float64, bool, error)
- func NestedInt64(obj yaml.MapSlice, fields ...string) (int64, bool, error)
- func NestedMap(obj yaml.MapSlice, fields ...string) (yaml.MapSlice, bool, error)
- func NestedSlice(obj yaml.MapSlice, fields ...string) ([]interface{}, bool, error)
- func NestedString(obj yaml.MapSlice, fields ...string) (string, bool, error)
- func NestedStringMap(obj yaml.MapSlice, fields ...string) (map[string]string, bool, error)
- func NestedStringSlice(obj yaml.MapSlice, fields ...string) ([]string, bool, error)
- func RemoveNestedField(obj *yaml.MapSlice, fields ...string)
- func SetNestedField(obj *yaml.MapSlice, value interface{}, fields ...string) error
- func SetNestedMap(obj *yaml.MapSlice, value yaml.MapSlice, fields ...string) error
- func SetNestedSlice(obj *yaml.MapSlice, value []interface{}, fields ...string) error
- func SetNestedStringMap(obj *yaml.MapSlice, value map[string]string, fields ...string) error
- func SetNestedStringSlice(obj *yaml.MapSlice, value []string, fields ...string) error
- func ToJSON(data []byte) ([]byte, error)
- func ToString(v interface{}) string
- func Unmarshal(b []byte, i interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeepCopyYAML ¶
func DeepCopyYAML(x yaml.MapSlice) yaml.MapSlice
DeepCopyYAML deep copies the passed value, assuming it is a valid JSON representation i.e. only contains types produced by json.Unmarshal() and also int64. bool, int64, float64, string, []interface{}, map[string]interface{}, json.Number and nil
func DeepCopyYAMLValue ¶
func DeepCopyYAMLValue(x interface{}) interface{}
DeepCopyYAMLValue deep copies the passed value, assuming it is a valid JSON representation i.e. only contains types produced by json.Unmarshal() and also int64. bool, int64, float64, string, []interface{}, map[string]interface{}, json.Number and nil
func NestedBool ¶
NestedBool returns the bool value of a nested field. Returns false if value is not found and an error if not a bool.
func NestedFieldCopy ¶
NestedFieldCopy returns a deep copy of the value of a nested field. Returns false if the value is missing. No error is returned for a nil field.
Note: fields passed to this function are treated as keys within the passed object; no array/slice syntax is supported.
func NestedFieldNoCopy ¶
NestedFieldNoCopy returns a reference to a nested field. Returns false if value is not found and an error if unable to traverse obj.
Note: fields passed to this function are treated as keys within the passed object; no array/slice syntax is supported.
func NestedFloat64 ¶
NestedFloat64 returns the float64 value of a nested field. Returns false if value is not found and an error if not a float64.
func NestedInt64 ¶
NestedInt64 returns the int64 value of a nested field. Returns false if value is not found and an error if not an int64.
func NestedMap ¶
NestedMap returns a deep copy of yaml.MapSlice value of a nested field. Returns false if value is not found and an error if not a yaml.MapSlice.
func NestedSlice ¶
NestedSlice returns a deep copy of []interface{} value of a nested field. Returns false if value is not found and an error if not a []interface{}.
func NestedString ¶
NestedString returns the string value of a nested field. Returns false if value is not found and an error if not a string.
func NestedStringMap ¶
NestedStringMap returns a copy of map[string]string value of a nested field. Returns false if value is not found and an error if not a yaml.MapSlice or contains non-string values in the map.
func NestedStringSlice ¶
NestedStringSlice returns a copy of []string value of a nested field. Returns false if value is not found and an error if not a []interface{} or contains non-string items in the slice.
func RemoveNestedField ¶
func RemoveNestedField(obj *yaml.MapSlice, fields ...string)
RemoveNestedField removes the nested field from the obj.
func SetNestedField ¶
SetNestedField sets the value of a nested field to a deep copy of the value provided. Returns an error if value cannot be set because one of the nesting levels is not a yaml.MapSlice.
func SetNestedMap ¶
SetNestedMap sets the yaml.MapSlice value of a nested field. Returns an error if value cannot be set because one of the nesting levels is not a yaml.MapSlice.
func SetNestedSlice ¶
SetNestedSlice sets the slice value of a nested field. Returns an error if value cannot be set because one of the nesting levels is not a yaml.MapSlice.
func SetNestedStringMap ¶
SetNestedStringMap sets the map[string]string value of a nested field. Returns an error if value cannot be set because one of the nesting levels is not a yaml.MapSlice.
func SetNestedStringSlice ¶
SetNestedStringSlice sets the string slice value of a nested field. Returns an error if value cannot be set because one of the nesting levels is not a yaml.MapSlice.
Types ¶
This section is empty.