Documentation ¶
Overview ¶
pkg/common/starstruct/struct.go
Index ¶
- func DerefPointers(val reflect.Value) (reflect.Value, error)
- func FlattenStructFields(item interface{}, fields *[]string) ([][]string, error)
- func GenerateFieldNames(prefix string, val reflect.Value) (*[]string, error)
- func PrettyJSON(data interface{}) (string, error)
- func TableToStructs(data [][]string) ([]interface{}, error)
- func ToMap(item interface{}, includeZeroValues bool) (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DerefPointers ¶
DerefPointers takes a reflect.Value and recursively dereferences it if it's a pointer.
func FlattenStructFields ¶
FlattenStructFields parses a struct and its nested fields, if any, to a flat slice. It also updates the input fields with any new subfields found.
func GenerateFieldNames ¶
GenerateFieldNames recursively generates field names from a struct, dereferencing pointers as needed, and returns a pointer to a slice of strings.
func PrettyJSON ¶
* Print a struct as a JSON string
func TableToStructs ¶
TableToStructs converts a [][]string into a slice of structs, with the first row as headers.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.