json2table

package
v6.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertJSONToTable

func ConvertJSONToTable(columnPathMappingPrefix string, columnPathMapping map[string]string, sourceData interface{}) ([]map[string]interface{}, error)

ConvertJSONToTable extracts data from a JSON or struct object using specified paths.

columnPathMappingPrefix: Points to a specific location in the JSON or struct object from where extraction should begin. If left empty, extraction will start from the root of the object.

columnPathMapping: A map where each key represents the desired column name in the output table, and each value represents a gabs path to extract the data within the given JSON or struct.

sourceData: JSON or struct from which data extraction should take place.

Returns a slice of maps. Each map represents a row in the table, with each key-value pair in the map being equivalent to a column name and its value.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL