|
|
|
@ -21,32 +21,33 @@ var DefaultBeegoPro = &Container{ |
|
|
|
|
TimestampFile: system.CurrentDir + "/.beegopro.timestamp", |
|
|
|
|
GoModFile: system.CurrentDir + "/go.mod", |
|
|
|
|
UserOption: UserOption{ |
|
|
|
|
Debug: false, |
|
|
|
|
ContextDebug: false, |
|
|
|
|
Dsn: "", |
|
|
|
|
Driver: "mysql", |
|
|
|
|
ProType: "default", |
|
|
|
|
ApiPrefix: "/api", |
|
|
|
|
EnableModule: nil, |
|
|
|
|
Models: make(map[string]TextModel, 0), |
|
|
|
|
GitRemotePath: "https://github.com/beego/beego-pro.git", |
|
|
|
|
Branch: "master", |
|
|
|
|
GitLocalPath: system.BeegoHome + "/beego-pro", |
|
|
|
|
EnableFormat: true, |
|
|
|
|
SourceGen: "text", |
|
|
|
|
EnableGitPull: true, |
|
|
|
|
RefreshGitTime: 24 * 3600, |
|
|
|
|
Debug: false, |
|
|
|
|
ContextDebug: false, |
|
|
|
|
Dsn: "", |
|
|
|
|
Driver: "mysql", |
|
|
|
|
ProType: "default", |
|
|
|
|
ApiPrefix: "/api", |
|
|
|
|
EnableModule: nil, |
|
|
|
|
Models: make(map[string]TextModel), |
|
|
|
|
GitRemotePath: "https://github.com/beego/beego-pro.git", |
|
|
|
|
Branch: "master", |
|
|
|
|
GitLocalPath: system.BeegoHome + "/beego-pro", |
|
|
|
|
EnableFormat: true, |
|
|
|
|
SourceGen: "text", |
|
|
|
|
EnableGitPull: true, |
|
|
|
|
Path: map[string]string{ |
|
|
|
|
"beego": ".", |
|
|
|
|
}, |
|
|
|
|
EnableGomod: true, |
|
|
|
|
EnableGomod: true, |
|
|
|
|
RefreshGitTime: 24 * 3600, |
|
|
|
|
Extend: nil, |
|
|
|
|
}, |
|
|
|
|
GenerateTime: time.Now().Format(MDateFormat), |
|
|
|
|
GenerateTimeUnix: time.Now().Unix(), |
|
|
|
|
TmplOption: TmplOption{}, |
|
|
|
|
CurPath: system.CurrentDir, |
|
|
|
|
EnableModules: make(map[string]interface{}, 0), // get the user configuration, get the enable module result
|
|
|
|
|
FunctionOnce: make(map[string]sync.Once, 0), // get the tmpl configuration, get the function once result
|
|
|
|
|
EnableModules: make(map[string]interface{}), // get the user configuration, get the enable module result
|
|
|
|
|
FunctionOnce: make(map[string]sync.Once), // get the tmpl configuration, get the function once result
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (c *Container) Run() { |
|
|
|
@ -128,7 +129,7 @@ func (c *Container) initTemplateOption() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for _, value := range c.TmplOption.Descriptor { |
|
|
|
|
if value.Once == true { |
|
|
|
|
if value.Once { |
|
|
|
|
c.FunctionOnce[value.SrcName] = sync.Once{} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|