csv

package
v3.35.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0, Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Main

type Main struct {
	idk.Main     `flag:"!embed"`
	Files        []string `help:"List of files, URLs, or directories to ingest."`
	Header       []string `help:"Optional header. If not passed, first line of each file is used."`
	IgnoreHeader bool     `short:"g" help:"Ignore header in file and use configured header. You *must* configure a header."`
	JustDoIt     bool     `` /* 142-byte string literal not displayed */
	// contains filtered or unexported fields
}

func NewMain

func NewMain() *Main

func (*Main) ValidateHeaders

func (m *Main) ValidateHeaders() ([]idk.Field, error)

ValidateHeaders is used during --dry-run to check that all headers provided at CLI or in CSV files can be parsed properly. Also returns the field structs as it would be parsed in a normal run. In the case of multiple CSV files, only returns the fields for the last file.

type Record

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

func (Record) Commit

func (r Record) Commit(ctx context.Context) error

func (Record) Data

func (r Record) Data() []interface{}

func (Record) Schema added in v3.34.0

func (r Record) Schema() interface{}

type Source

type Source struct {
	Files        chan string
	Header       []string
	IgnoreHeader bool
	JustDoIt     bool
	Log          logger.Logger
	// contains filtered or unexported fields
}

func NewSource

func NewSource() *Source

func (*Source) Close

func (s *Source) Close() error

func (*Source) Record

func (s *Source) Record() (idk.Record, error)

func (*Source) Schema

func (s *Source) Schema() []idk.Field

Jump to

Keyboard shortcuts

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