-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathschema.go
16 lines (15 loc) · 1.6 KB
/
schema.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package sif
// Schema is a mapping from column names to column definitions within a Row.
type Schema interface {
Equals(otherSchema Schema) error // Equals return true iff this Schema is identical to otherSchema
Clone() Schema // Clone() returns a deep copy of this Schema
NumColumns() int // NumColumns returns the number of columns in this Schema.
NumFixedWidthColumns() int // NumFixedWidthColumns returns the number of fixed-length columns in this Schema.
NumVariableWidthColumns() int // NumVariableWidthColumns returns the number of variable-length columns in this Schema.
GetColumn(colName string) (col Column, err error) // GetColumn returns the Column associated with colName, or an error if none exists
HasColumn(colName string) bool // HasColumn returns true iff colName corresponds to a Column in this Schema
ColumnNames() []string // ColumnNames returns a list of Column names in this Schema, in the order they were created
ColumnTypes() []ColumnType // ColumnTypes returns a list of Column types in this Schema, in the order they were created
ColumnAccessors() []ColumnAccessor // ColumnAccessors returns a list of ColumnAccessors in this Schema, in the order they were created
ForEachColumn(fn func(name string, col Column) error) error // ForEachColumn runs a function for each Column in this Schema
}