Documentation ¶
Index ¶
- Variables
- func CSVFileSplitter(src string, delim rune, comment rune) iter.Iter[[]string]
- func CSVGenerator(sep string, callback func(iter int) (string, bool)) string
- func CSVToStruct[R any](src iter.Iter[[]string], dateTimeFormat string) iter.Iter[R]
- func Flatten(elems iter.Iter[[]string], sep string) iter.Iter[string]
- func StructToCSV[R any](elems iter.Iter[R], addHeaders bool, timeDateFormat string) iter.Iter[[]string]
Constants ¶
This section is empty.
Variables ¶
View Source
var MalformedCSVFile, IsMalformedCSVFile = customerr.ErrorFactory(
"The CSV file cannot be converted to the requested struct.",
)
Functions ¶
func CSVFileSplitter ¶
func CSVToStruct ¶
TODO - finish comment TODO - rename timeDate to dateTime (idiot) Only basic types are supported through the CSV interface (which mirrors the limitations of a CSV file). For things like arrays and maps JSON is far more expressive and less error prone. Supported types:
- All integer types (int,int8,int16,int32,int64)
- All unsigned integer types (uint,uint8,uint16,uint32,uint64)
- All float types (float32,float64)
- Strings
- Booleans
- TimeDate formats
The CSV file **MUST** have headers. Without this the structs fields cannot be set properly. If any columns are missing or there are blank values the corresponding values in the structs that are generated will be zero-value initialized.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.