mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
1. fix repeat init api module
2. add custom config file flag
This commit is contained in:
@@ -74,6 +74,6 @@ func NewApi() *Api {
|
||||
api := &Api{
|
||||
app: gin.New(),
|
||||
}
|
||||
api.Init()
|
||||
// api.Init()
|
||||
return api
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ func Execute() error {
|
||||
|
||||
func init() {
|
||||
cobra.OnInitialize(initConfig)
|
||||
rootCmd.PersistentFlags().StringVar(&cfgFile, "c", "", "Use Custom Config File")
|
||||
}
|
||||
|
||||
func initConfig() {
|
||||
|
||||
@@ -2,12 +2,17 @@ module crawlab
|
||||
|
||||
go 1.16
|
||||
|
||||
require (
|
||||
github.com/apex/log v1.9.0
|
||||
github.com/crawlab-team/crawlab-core v0.6.0-beta.20211230.1200
|
||||
github.com/crawlab-team/go-trace v0.1.1
|
||||
github.com/gin-gonic/gin v1.7.1
|
||||
github.com/spf13/cobra v1.1.3
|
||||
github.com/spf13/viper v1.7.1
|
||||
go.uber.org/dig v1.10.0
|
||||
replace (
|
||||
github.com/crawlab-team/crawlab-core => /Users/chenjingyang/dev/my-job/gitee/crawlab-core
|
||||
github.com/crawlab-team/goseaweedfs => /Users/chenjingyang/dev/my-job/gitee/goseaweedfs
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/apex/log v1.9.0
|
||||
github.com/crawlab-team/crawlab-core v0.6.0-beta.20211230.1200
|
||||
github.com/crawlab-team/go-trace v0.1.1
|
||||
github.com/gin-gonic/gin v1.7.1
|
||||
github.com/spf13/cobra v1.1.3
|
||||
github.com/spf13/viper v1.7.1
|
||||
go.uber.org/dig v1.10.0
|
||||
)
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
module crawlab
|
||||
|
||||
go 1.16
|
||||
|
||||
replace (
|
||||
github.com/crawlab-team/crawlab-core => /libs/crawlab-team/crawlab-core
|
||||
github.com/crawlab-team/crawlab-vcs => /libs/crawlab-team/crawlab-vcs
|
||||
github.com/crawlab-team/crawlab-fs => /libs/crawlab-team/crawlab-fs
|
||||
github.com/crawlab-team/crawlab-db => /libs/crawlab-team/crawlab-db
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/apex/log v1.9.0
|
||||
github.com/crawlab-team/crawlab-core v0.6.0-beta.20211219.2134
|
||||
github.com/crawlab-team/go-trace v0.1.1
|
||||
github.com/gin-gonic/gin v1.7.1
|
||||
github.com/spf13/cobra v1.1.3
|
||||
github.com/spf13/viper v1.7.1
|
||||
go.uber.org/dig v1.10.0
|
||||
)
|
||||
13
backend/go.mod.remote
Normal file
13
backend/go.mod.remote
Normal file
@@ -0,0 +1,13 @@
|
||||
module crawlab
|
||||
|
||||
go 1.16
|
||||
|
||||
require (
|
||||
github.com/apex/log v1.9.0
|
||||
github.com/crawlab-team/crawlab-core v0.6.0-beta.20211230.1200
|
||||
github.com/crawlab-team/go-trace v0.1.1
|
||||
github.com/gin-gonic/gin v1.7.1
|
||||
github.com/spf13/cobra v1.1.3
|
||||
github.com/spf13/viper v1.7.1
|
||||
go.uber.org/dig v1.10.0
|
||||
)
|
||||
Reference in New Issue
Block a user