/
config.go
49 lines (39 loc) · 859 Bytes
/
config.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package gen
import (
"encoding/json"
"fmt"
)
// Config presents Gen configurations.
type Config struct {
//Host api request address
Host string
//Dir the folder path of the generated doc.go
Dir string
//BasePath url request prefix
BasePath string
//WebFrame such as http,gin
WebFrame string
//Cover auto cover generation
Cover bool
//Router auto gen router info
Router bool
}
// FileGenConfig file creation configuration
type FileGenConfig struct {
dir string
subDir string
filename string
templateName string
category string
templateFile string
builtinTemplate string
data any
}
func (c *Config) fmtString() {
marshal, _ := json.Marshal(c)
fmt.Println(string(marshal))
}
func (c *FileGenConfig) fmtString() {
marshal, _ := json.Marshal(c)
fmt.Println(string(marshal))
}