File: input.go

package info (click to toggle)
textql 2.0.3-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,256 kB
  • sloc: yacc: 962; makefile: 45
file content (18 lines) | stat: -rw-r--r-- 771 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package inputs

// Input is how TextQL reads from data sources.
// To be an input, an implementor must return tabular data.
// How data is manipulated into the tabular structure is left to the implementor.
// Inputs are expected to return in a row by row fashion.
type Input interface {
	// ReadRecord should return nil on the end of data, or a single record.
	// Recoverable errors should represent themselves as empty sets.
	// Unrecoverable errors should return nil.
	ReadRecord() []string
	// Header should return metadata naming the columns in the table.
	Header() []string
	// Name should return a reasonable name for the data set, prehaps the file name.
	Name() string
	// SetName allows users of the dataset to supply their own name if needed.
	SetName(string)
}