c2j

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
}

Jump to

Keyboard shortcuts

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