File: interface.go

package info (click to toggle)
golang-github-jszwec-csvutil 1.7.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 396 kB
  • sloc: makefile: 2
file content (29 lines) | stat: -rw-r--r-- 747 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package csvutil

// Reader provides the interface for reading a single CSV record.
//
// If there is no data left to be read, Read returns (nil, io.EOF).
//
// It is implemented by csv.Reader.
type Reader interface {
	Read() ([]string, error)
}

// Writer provides the interface for writing a single CSV record.
//
// It is implemented by csv.Writer.
type Writer interface {
	Write([]string) error
}

// Unmarshaler is the interface implemented by types that can unmarshal
// a single record's field description of themselves.
type Unmarshaler interface {
	UnmarshalCSV([]byte) error
}

// Marshaler is the interface implemented by types that can marshal themselves
// into valid string.
type Marshaler interface {
	MarshalCSV() ([]byte, error)
}