Persist server configuration to config file

This commit is contained in:
2023-02-25 01:24:22 -07:00
parent a41c12d20c
commit 3fef157f6a
7 changed files with 110 additions and 53 deletions
+28
View File
@@ -0,0 +1,28 @@
package settings
import "git.ohea.xyz/golang/config"
type CursoriusServer struct {
Name string
Url string
Token string
}
type Config struct {
Servers []CursoriusServer
}
func GetConfig() (config.Config[Config], error) {
conf := config.Config[Config]{
Name: "cursorius",
Filename: "tui",
Config: Config{},
}
_, err := conf.Get()
if err != nil {
return config.Config[Config]{}, err
}
return conf, nil
}