Documentation ¶
Index ¶
- Variables
- func BuildTypeName(t reflect.Type) string
- func ExpandPath(p string) string
- func InvokeMethod(target interface{}, name string, args ...interface{}) ([]reflect.Value, error)
- func IsPrimitiveValue(v reflect.Value) bool
- func JsonMergeStruct(dest, src interface{})
- func ReflectRecursive(v reflect.Value, visitor visitorFunc) error
- func SanitizeString(s string) string
- func StringSlicesEqual(l, r []string) bool
- func StringSlicesEqualIgnoreOrder(l, r []string) bool
- func YamlMarshal(o interface{}) ([]byte, error)
- func YamlToJson(yamlBytes []byte) ([]byte, error)
- func YamlUnmarshal(yamlBytes []byte, dest interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var SkipReflection = errors.New("skip this value")
Functions ¶
func BuildTypeName ¶
func ExpandPath ¶
ExpandPath replaces common path aliases: ~ -> $HOME
func InvokeMethod ¶
InvokeMethod calls the specified method by reflection
func IsPrimitiveValue ¶
IsPrimitiveValue returns true if passed a value of primitive type: int, bool, etc Note that string (like []byte) is not treated as a primitive type
func JsonMergeStruct ¶
func JsonMergeStruct(dest, src interface{})
JsonMergeStruct merges src into dest It uses a JSON marshal & unmarshal, so only fields that are JSON-visible will be copied
func ReflectRecursive ¶
ReflectRecursive calls visitor with v and every recursive sub-value, skipping subtrees if SkipReflection is returned
func SanitizeString ¶
func StringSlicesEqual ¶
func YamlMarshal ¶
func YamlToJson ¶
func YamlUnmarshal ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.