|
1 | 1 | package client |
2 | 2 |
|
| 3 | +import ( |
| 4 | + "text/template" |
| 5 | + |
| 6 | + "github.com/antonmedv/expr/vm" |
| 7 | +) |
| 8 | + |
3 | 9 | type Column struct { |
4 | | - Name string `json:"name,omitempty" yaml:"name,omitempty"` |
5 | | - Description *string `json:"description,omitempty" yaml:"description,omitempty"` |
6 | | - Type string `json:"type,omitempty" yaml:"type,omitempty"` |
7 | | - Key bool `json:"key,omitempty" yaml:"pk,omitempty"` |
8 | | - Unique bool `json:"unique,omitempty" yaml:"unique,omitempty"` |
9 | | - NotNull bool `json:"notnull,omitempty" yaml:"notnull,omitempty"` |
| 10 | + Name string `json:"name,omitempty" yaml:"name,omitempty"` |
| 11 | + Description *string `json:"description,omitempty" yaml:"description,omitempty"` |
| 12 | + Type string `json:"type,omitempty" yaml:"type,omitempty"` |
| 13 | + Key bool `json:"key,omitempty" yaml:"pk,omitempty"` |
| 14 | + Unique bool `json:"unique,omitempty" yaml:"unique,omitempty"` |
| 15 | + NotNull bool `json:"notnull,omitempty" yaml:"notnull,omitempty"` |
| 16 | + Transform *string `json:"transform,omitempty" yaml:"transform,omitempty"` |
| 17 | + Template *template.Template `json:"-" yaml:"-"` |
10 | 18 | } |
11 | 19 | type Spec struct { |
12 | | - File string `json:"file,omitempty" yaml:"file,omitempty"` |
13 | | - Format string `json:"format,omitempty" yaml:"format,omitempty"` |
14 | | - Table string `json:"table,omitempty" yaml:"table,omitempty"` |
15 | | - Columns []Column `json:"columns,omitempty" yaml:"columns,omitempty"` |
16 | | - Separator *string `json:"separator,omitempty" yaml:"separator,omitempty"` // CSV only |
17 | | - Sheet *string `json:"sheet,omitempty" yaml:"sheet,omitempty"` // XLSX only |
| 20 | + File string `json:"file,omitempty" yaml:"file,omitempty"` |
| 21 | + Format string `json:"format,omitempty" yaml:"format,omitempty"` |
| 22 | + Table string `json:"table,omitempty" yaml:"table,omitempty"` |
| 23 | + Filter *string `json:"filter,omitempty" yaml:"filter,omitempty"` |
| 24 | + Evaluator *vm.Program `json:"-,omitempty" yaml:"-,omitempty"` |
| 25 | + Columns []*Column `json:"columns,omitempty" yaml:"columns,omitempty"` |
| 26 | + Separator *string `json:"separator,omitempty" yaml:"separator,omitempty"` // CSV only |
| 27 | + Sheets []string `json:"sheets,omitempty" yaml:"sheets,omitempty"` // XLSX only |
18 | 28 | } |
0 commit comments