Documentation ¶
Index ¶
Constants ¶
View Source
const CSV = ls.LS + "csv/"
Variables ¶
This section is empty.
Functions ¶
func Import ¶
func Import(attributeID AttributeSpec, terms []TermSpec, startRow, nRows int, input [][]string) (*ls.Layer, error)
Import a CSV schema. The CSV file is organized as columns, one column for base attribute names, and other columns for overlays. CSV does not support nested attributes. Returns an array of Layer objects
Types ¶
type AttributeSpec ¶
type AttributeSpec struct { // The 0-based column containing term data TermCol int `json:"column"` // If nonempty, this template is used to build the term contents // with {{.term}}, {{.data}}, and {{.row}} in template context. {{.term}} gives // the Term, and {{.data}} gives the value of the term in the // current cell. TermTemplate string `json:"template"` // If evaluates to a nonempty string, the attribute is an array whose elements are of this type ArrayTypeTemplate string `json:"arrayTypeTemplate"` ArrayIDTemplate string `json:"arrayIdTemplate"` }
type ErrColIndexOutOfBounds ¶
func (ErrColIndexOutOfBounds) Error ¶
func (e ErrColIndexOutOfBounds) Error() string
type ErrInvalidID ¶
type ErrInvalidID struct {
Row int
}
func (ErrInvalidID) Error ¶
func (e ErrInvalidID) Error() string
type ImportSpec ¶
type TermSpec ¶
type TermSpec struct { // The term Term string `json:"term"` // The 0-based column containing term data TermCol int `json:"column"` // If nonempty, this template is used to build the term contents // with {{.term}}, {{.data}}, and {{.row}} in template context. {{.term}} gives // the Term, and {{.data}} gives the value of the term in the // current cell. TermTemplate string `json:"template"` // Is property an array Array bool `json:"array"` // Array separator character ArraySeparator string `json:"separator"` }
Click to show internal directories.
Click to hide internal directories.