Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapCSV2JSON ¶
func MapCSV2JSON(options C2JOptions, in, mapping []byte) ([]byte, string, error)
MapCSV2JSON converts CSV data to JSON, applying mapping rules and configurations provided via options and mappings.
Types ¶
type C2JOptions ¶
type C2JOptions struct {
// Array indicates whether the JSON output should be wrapped in an array format during the mapping process.
Array bool
// Named indicates whether the CSV header should be used for mapping column names to JSON fields.
Named bool
// OutputType specifies a custom Marshaler to be used for serializing data during the mapping process. json, yaml or toml
OutputType string
// NestedPropertyName specifies the property name to use for TOML array output (defaults to "data")
NestedPropertyName string
// separator defines the byte value used as a delimiter or boundary in certain operations within the Mapper.
Separator string
// Logger is used to log some information to console
Logger *slog.Logger
}
Click to show internal directories.
Click to hide internal directories.