35 lines
648 B
Go
35 lines
648 B
Go
package config
|
|
|
|
import (
|
|
"fmt"
|
|
"git.ohea.xyz/golang/config"
|
|
)
|
|
|
|
type Config struct {
|
|
ServerUrl string
|
|
Id string
|
|
WorkingDir 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",
|
|
WorkingDir: "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
|
|
}
|