added adding and editing of availabilities

This commit is contained in:
z1glr
2025-01-18 13:25:12 +00:00
parent e37310b774
commit e17c9db90c
24 changed files with 737 additions and 163 deletions

View File

@@ -50,10 +50,10 @@ func (config ConfigStruct) SignJWT(val any) (string, error) {
return t.SignedString([]byte(config.ClientSession.JwtSignature))
}
func loadConfig() ConfigStruct {
func LoadConfig() ConfigStruct {
Config := ConfigYaml{}
yamlFile, err := os.ReadFile("config.yaml")
yamlFile, err := os.ReadFile(CONFIG_PATH)
if err != nil {
panic(fmt.Sprintf("Error opening config-file: %q", err))
}
@@ -91,5 +91,5 @@ func loadConfig() ConfigStruct {
}
func init() {
Config = loadConfig()
Config = LoadConfig()
}

View File

@@ -13,13 +13,8 @@ var CONFIG_PATH = "config.yaml"
type ConfigYaml struct {
LogLevel string `yaml:"log_level"`
Database struct {
Host string `yaml:"host"`
User string `yaml:"user"`
Password string `yaml:"password"`
Database string `yaml:"database"`
} `yaml:"database"`
Server struct {
Database string `yaml:"database"`
Server struct {
Port int `yaml:"port"`
} `yaml:"server"`
ClientSession struct {