Documentation
¶
Overview ¶
Package application run the application
Package application run the application ¶
Package application run the application ¶
Package application run the application ¶
Package application run the application
Index ¶
- func ParseData(data []byte) (interface{}, error)
- func PrintTable(spec *Spec, fullData interface{}) error
- func ReadData(dataFilePath string) ([]byte, error)
- func ReadParseData(dataFilePath string) (interface{}, error)
- func ReadSpec(specFile string) ([]byte, error)
- func Run(args []string) error
- func ValidateDataFile(args []string) (string, error)
- func ValidateSpec(spec *Spec) error
- func ValidateSpecFile(specFile string) string
- type Arguments
- type Column
- type Spec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintTable ¶
PrintTable prints JSON data in tabular format based on the provided specification
func ReadParseData ¶
ReadParseData reads a data file and parses it into an interface{}
func ValidateDataFile ¶
ValidateDataFile validates the data file argument, ensuring that either a single file is provided or data is piped to stdin
func ValidateSpec ¶
ValidateSpec validates that the spec meets minimum requirements
func ValidateSpecFile ¶
ValidateSpecFile validates the spec file option Requires either the specFile parameter or JSON2TABLE_SPEC_FILE environment variable to be set
Types ¶
type Column ¶
type Column struct {
Path string `json:"path" validate:"required"`
Title string `json:"title"`
Width int
}
Column represents a column specification
type Spec ¶
type Spec struct {
DataPath string `json:"dataPath"`
Columns []Column `json:"columns" validate:"required,min=1,dive"`
}
Spec represents the specification structure
func ParseAndValidateSpec ¶
ParseAndValidateSpec parses JSON data into a Spec and validates it
func ReadParseValidateSpec ¶
ReadParseValidateSpec reads a spec file, parses it, and validates it