Inital commit: skeleton of runner logic

This commit is contained in:
2022-10-16 14:57:18 -06:00
commit c21e7d5d6b
7 changed files with 1065 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
package config
import (
"fmt"
"git.ohea.xyz/golang/config"
)
type Config struct {
ServerUrl string
Id string
Secret string
Tags []string
}
func GetConfig() (config.Config[Config], bool, error) {
configData := config.Config[Config]{
Name: "cursorius",
Filename: "runner",
Config: Config{
ServerUrl: "FILL IN",
Id: "FILL IN",
Secret: "FILL IN",
Tags: []string{},
},
}
isNew, err := configData.Get()
if err != nil {
return configData, false, fmt.Errorf("Could not read config file: %v", err)
}
return configData, isNew, nil
}