reader

package
v0.0.0-...-34b02ed Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadFormatError

type BadFormatError struct {
	ResourceID string
	Err        error
}

func (*BadFormatError) Error

func (e *BadFormatError) Error() string

func (*BadFormatError) Unwrap

func (e *BadFormatError) Unwrap() error

type CsvReader

type CsvReader struct {
	// contains filtered or unexported fields
}

func NewCsvReader

func NewCsvReader(
	logger *slog.Logger,
	resource batch.ResourceReader,
) *CsvReader

func (*CsvReader) Close

func (r *CsvReader) Close(ctx context.Context) error

func (*CsvReader) Open

func (r *CsvReader) Open(ctx context.Context) error

func (*CsvReader) Read

func (r *CsvReader) Read(_ context.Context, record any) error

func (*CsvReader) WithSkipNonExist

func (r *CsvReader) WithSkipNonExist(skip bool) *CsvReader

func (*CsvReader) WithTransformers

func (r *CsvReader) WithTransformers(transformers map[string]tfer.FieldTransformer) *CsvReader

func (*CsvReader) WithTrimSpace

func (r *CsvReader) WithTrimSpace(trim bool) *CsvReader

type JSONReader

type JSONReader struct {
	// contains filtered or unexported fields
}

func NewJSONReader

func NewJSONReader(
	logger *slog.Logger,
	resource batch.ResourceReader,
	recordExtractor transformer.RecordExtractor,
) *JSONReader

func (*JSONReader) Close

func (r *JSONReader) Close(ctx context.Context) error

func (*JSONReader) Open

func (r *JSONReader) Open(ctx context.Context) error

func (*JSONReader) Read

func (r *JSONReader) Read(ctx context.Context, record any) error

Jump to

Keyboard shortcuts

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