Documentation ¶
Overview ¶
Code generated by Taskfile; DO NOT EDIT.
Index ¶
- Constants
- Variables
- func Comma(r rune) csvAdapterOption
- func Comment(r rune) csvAdapterOption
- func LazyQuotes(lazyQuotes bool) csvAdapterOption
- func NoImplicitAlias(noImplicitAlias bool) csvAdapterOption
- func ReuseRecord(reuseRecord bool) csvAdapterOption
- func TrimLeadingSpace(trimLeadingSpace bool) csvAdapterOption
- func UseCRLF(useCRLF bool) csvAdapterOption
- func WriteHeader(writeHeader bool) csvAdapterOption
- type CSVAdapter
- type ReadingError
Constants ¶
const Version = "v0.1.2"
Variables ¶
var ( ErrUnsupportedTag = fmt.Errorf("unsupported tag") ErrInvalidTag = fmt.Errorf("invalid tag") ErrorNotStruct = fmt.Errorf("not a struct") ErrReadingCSV = fmt.Errorf("error reading csv") ErrReadingCSVLines = fmt.Errorf("error reading csv lines") ErrProcessingCSVLines = fmt.Errorf("error processing csv lines") ErrFieldNotFound = fmt.Errorf("field not found in csv") ErrUnprocessableType = fmt.Errorf("unprocessable type") ErrParsingType = fmt.Errorf("error parsing type") ErrEmptyValue = fmt.Errorf("empty value") ErrAliasNotFound = fmt.Errorf("alias not found") ErrWrongNumberOfFields = fmt.Errorf("wrong number of fields") )
Errors
Functions ¶
func Comma ¶
func Comma(r rune) csvAdapterOption
Comma sets the field separator
more info: https://pkg.go.dev/encoding/csv#Reader and https://pkg.go.dev/encoding/csv#Writer
func Comment ¶
func Comment(r rune) csvAdapterOption
Comment sets the comment character
more info: https://pkg.go.dev/encoding/csv#Reader
func LazyQuotes ¶
func LazyQuotes(lazyQuotes bool) csvAdapterOption
LazyQuotes sets the lazy quotes flag
more info: https://pkg.go.dev/encoding/csv#Reader
func NoImplicitAlias ¶
func NoImplicitAlias(noImplicitAlias bool) csvAdapterOption
sets the no implicit alias flag
when set to true, field names will not be used as aliases when not specified.
func ReuseRecord ¶
func ReuseRecord(reuseRecord bool) csvAdapterOption
ReuseRecord sets the reuse record flag
more info: https://pkg.go.dev/encoding/csv#Reader
func TrimLeadingSpace ¶
func TrimLeadingSpace(trimLeadingSpace bool) csvAdapterOption
TrimLeadingSpace sets the trim leading space flag
more info: https://pkg.go.dev/encoding/csv#Reader
func UseCRLF ¶
func UseCRLF(useCRLF bool) csvAdapterOption
sets the use CRLF flag.
more info: https://pkg.go.dev/encoding/csv#Writer
func WriteHeader ¶
func WriteHeader(writeHeader bool) csvAdapterOption
sets the write header flag
when set to true, the header will be written when calling ToCSV
Types ¶
type CSVAdapter ¶
type CSVAdapter[T any] struct { // contains filtered or unexported fields }
CSVAdapter is a struct that adapts a struct to a csv file
func NewCSVAdapter ¶
func NewCSVAdapter[T any](options ...csvAdapterOption) (*CSVAdapter[T], error)
NewCSVAdapter creates a new CSVAdapter
func (CSVAdapter[T]) String ¶
func (c CSVAdapter[T]) String() string
type ReadingError ¶
func (ReadingError) Error ¶
func (r ReadingError) Error() string