package config import ( "fmt" "git.ohea.xyz/golang/config" ) type Webhook struct { Secret string } type Job struct { URL string Webhook Webhook Cron *string } type Runner struct { Secret string } type Config struct { Address string Port int Jobs map[string]Job Runners map[string]Runner } func GetConfig() (config.Config[Config], error) { configData := config.Config[Config]{ Name: "cursorius", Filename: "server", Config: Config{ Address: "127.0.0.1", Port: 45420, Jobs: make(map[string]Job), Runners: make(map[string]Runner), }, } _, err := configData.Get() if err != nil { return configData, fmt.Errorf("Could not read config file: %v", err) } return configData, nil }