wip: alpha version
This commit is contained in:
24
internal/cmd/execute.go
Normal file
24
internal/cmd/execute.go
Normal file
@ -0,0 +1,24 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/loveuer/nfflow/internal/api"
|
||||
"github.com/loveuer/nfflow/internal/controller"
|
||||
"github.com/loveuer/nfflow/internal/database"
|
||||
"github.com/loveuer/nfflow/internal/model"
|
||||
"github.com/loveuer/nfflow/internal/opt"
|
||||
)
|
||||
|
||||
func Execute(ctx context.Context) error {
|
||||
opt.MustInitConfig()
|
||||
|
||||
database.MustInitClient()
|
||||
model.MustInit(database.DB)
|
||||
controller.Init(database.DB, database.Cache)
|
||||
|
||||
api.MustStart(ctx)
|
||||
|
||||
<-ctx.Done()
|
||||
|
||||
return nil
|
||||
}
|
11
internal/cmd/init.go
Normal file
11
internal/cmd/init.go
Normal file
@ -0,0 +1,11 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"github.com/loveuer/nfflow/internal/opt"
|
||||
)
|
||||
|
||||
func init() {
|
||||
flag.StringVar(&opt.ConfigFile, "c", "etc/config.json", "config json file path")
|
||||
flag.IntVar(&opt.Debug, "debug", 0, "")
|
||||
}
|
Reference in New Issue
Block a user