25 lines
478 B
Go
25 lines
478 B
Go
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
|
|
}
|