processor

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Process

func Process(t *table.Table, p Processor) (vt *validation.Table, err error)

Types

type Processor

type Processor interface {
	// called for every cell first in order
	Cell(
		collector validation.Collector,
		col table.ColumnName,
		content string,
	) (
		cleanedContent string, valid bool, err error,
	)
	// called after all cells of all rows were processed
	Row(
		collector validation.Collector,
		row table.Row,
	) (valid bool, err error)
	// called in the very end
	Table(
		collector validation.Collector,
		tableValidation *validation.Table,
		table *table.Table,
	) (valid bool, err error)
}

Processor is an interface, that allows you to validate and transform table data typically from a csv file.

Jump to

Keyboard shortcuts

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