orbis/cmd/orbis/root.go
kjuulh ed2e15a3dd
All checks were successful
continuous-integration/drone/push Build is passing
add basic scheduler
2025-01-06 22:25:31 +01:00

31 lines
582 B
Go

package main
import (
"fmt"
"git.front.kjuulh.io/kjuulh/orbis/internal/app"
"github.com/spf13/cobra"
)
func newRoot(app *app.App) *cobra.Command {
logger := app.Logger()
cmd := &cobra.Command{
Use: "orbis",
Short: "Orbis is a data workflow scheduler for all your batch and real-time needs",
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
logger.Info("starting orbis")
if err := app.Scheduler().Execute(ctx); err != nil {
return fmt.Errorf("scheduler failed with error: %w", err)
}
return nil
},
}
return cmd
}