Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Spec ¶
type Spec struct {
// A sequence of Token structs that indicates the new row layout.
Tokens []Token `json:"tokens"`
// CSV separator character.
Comma string `json:"comma"`
}
Spec is derived from a user-provided string pattern. It contains information about the structure of the output CSV file.
func ParsePattern ¶
ParsePattern converts user input into a Specification struct.
type Token ¶
type Token struct {
// Indicates the value type stored in a Token struct.
Type TokenType `json:"type"`
// Column number. Content of the indicated column will be substituted
// in place of this token during compilation process.
Column int `json:"column"`
// Arbitrary text that will be inserted as is during compilation process.
Text string `json:"text"`
}
Token is an union-like type. It stores either CSV column number or an arbitrary text to be inserted.
func NewColumnToken ¶
Creates a new Token containing specified column number.
func NewTextToken ¶
Creates a new Token containing specified text.
Click to show internal directories.
Click to hide internal directories.