Documentation
¶
Index ¶
- Variables
- func NewExporter(typ reflect.Type, opts ...ExportOption) tabular.Exporter
- func NewExporterFor[T any](opts ...ExportOption) tabular.Exporter
- func NewImporter(typ reflect.Type, opts ...ImportOption) tabular.Importer
- func NewImporterFor[T any](opts ...ImportOption) tabular.Importer
- type ExportOption
- type ImportOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrDataMustBeSlice indicates exported data must be a slice. ErrDataMustBeSlice = errors.New("data must be a slice") // ErrSheetIndexOutOfRange indicates sheet index out of range. ErrSheetIndexOutOfRange = errors.New("sheet index out of range") // ErrNoDataRowsFound indicates there are no data rows after skips. ErrNoDataRowsFound = errors.New("no data rows found") // ErrDuplicateColumnName indicates duplicate header column name. ErrDuplicateColumnName = errors.New("duplicate column name") // ErrFieldNotSettable indicates struct field is not settable during import. ErrFieldNotSettable = errors.New("field is not settable") )
Functions ¶
func NewExporter ¶
func NewExporter(typ reflect.Type, opts ...ExportOption) tabular.Exporter
NewExporter creates a new Exporter with the specified type.
func NewExporterFor ¶
func NewExporterFor[T any](opts ...ExportOption) tabular.Exporter
NewExporterFor creates a new Exporter with the specified type T.
func NewImporter ¶
func NewImporter(typ reflect.Type, opts ...ImportOption) tabular.Importer
NewImporter creates a new Importer with the specified type.
func NewImporterFor ¶
func NewImporterFor[T any](opts ...ImportOption) tabular.Importer
NewImporterFor creates a new Importer with the specified type T.
Types ¶
type ExportOption ¶
type ExportOption func(*exportOptions)
ExportOption is a function that configures ExportOptions.
func WithSheetName ¶
func WithSheetName(name string) ExportOption
WithSheetName sets the sheet name for export.
type ImportOption ¶
type ImportOption func(*importOptions)
ImportOption is a function that configures ImportOptions.
func WithImportSheetIndex ¶
func WithImportSheetIndex(index int) ImportOption
WithImportSheetIndex sets the sheet index for import.
func WithImportSheetName ¶
func WithImportSheetName(name string) ImportOption
WithImportSheetName sets the sheet name for import.
func WithSkipRows ¶
func WithSkipRows(rows int) ImportOption
WithSkipRows sets the number of rows to skip before the header row.
Click to show internal directories.
Click to hide internal directories.