4461875b18
- apps/dag_engine/.gitignore - apps/dag_engine/README.md - apps/dag_engine/app.md - apps/dag_engine/config.go - apps/dag_engine/dags_migrated/fn_backup.yaml - apps/dag_engine/dags_migrated/revision_viernes_finanzas.yaml - apps/dag_engine/executor.go - apps/dag_engine/frontend/package.json - apps/dag_engine/frontend/src/App.tsx - apps/dag_engine/frontend/src/components/StatusBadge.tsx - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
32 lines
833 B
Go
32 lines
833 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
)
|
|
|
|
// Config holds the runtime configuration for the DAG engine.
|
|
type Config struct {
|
|
Port int
|
|
DagsDir string
|
|
DBPath string
|
|
AutoScheduler bool
|
|
}
|
|
|
|
// DefaultConfig returns sensible defaults.
|
|
func DefaultConfig() Config {
|
|
return Config{
|
|
Port: 8090,
|
|
DagsDir: "dags",
|
|
DBPath: "dag_engine.db",
|
|
}
|
|
}
|
|
|
|
// ParseFlags populates config from CLI flags for the "server" subcommand.
|
|
func (c *Config) ParseFlags(fs *flag.FlagSet, args []string) error {
|
|
fs.IntVar(&c.Port, "port", c.Port, "HTTP server port")
|
|
fs.StringVar(&c.DagsDir, "dags-dir", c.DagsDir, "directory containing DAG YAML files")
|
|
fs.StringVar(&c.DBPath, "db", c.DBPath, "path to SQLite database")
|
|
fs.BoolVar(&c.AutoScheduler, "scheduler", c.AutoScheduler, "auto-start cron scheduler")
|
|
return fs.Parse(args)
|
|
}
|