forked from chxfantasy/cmgen
/
structure.go
32 lines (28 loc) · 969 Bytes
/
structure.go
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
30
31
32
package amgen
type ModelGenerator struct {
ConfigName string `yaml:"-"`
FileName string `yaml:"-"`
PackageName string `yaml:"packageName,omitempty"`
DbName string `yaml:"dbName,omitempty"`
Models []Model `yaml:"models,omitempty"`
Raw string `yaml:"raw,omitempty"`
}
type Model struct {
Name string `yaml:"name,omitempty"`
CollectionName string `yaml:"collectionName,omitempty"`
CRUD bool `yaml:"CRUD,omitempty"`
Types []string `yaml:"types,omitempty"`
States []string `yaml:"states,omitempty"`
Fields []Field `yaml:"fields,omitempty"`
Indexes []Index `yaml:"indexes,omitempty"`
}
type Index struct {
Name []string `yaml:"name,omitempty"`
Unique bool `yaml:"unique,omitempty"`
}
type Field struct {
Name string `yaml:"name,omitempty"`
Type string `yaml:"type,omitempty"`
Valid string `yaml:"valid,omitempty"`
Anonymous bool `yaml:"anonymous,omitempty"`
}