chore: Adds login and user creation support to the API.

This commit is contained in:
Tera << 8 2025-01-05 20:51:06 -05:00
parent 96833b238b
commit 843cd34785
Signed by: imterah
GPG key ID: 8FA7DD57BA6CEA37
13 changed files with 683 additions and 12 deletions

30
frontend/config/config.go Normal file
View file

@ -0,0 +1,30 @@
package config
import (
"os"
"gopkg.in/yaml.v3"
)
type Config struct {
Username string `json:"username"`
RefreshToken string `json:"token"`
APIPath string `json:"api_path"`
}
func ReadAndParseConfig(configFile string) (*Config, error) {
configFileContents, err := os.ReadFile(configFile)
if err != nil {
return nil, err
}
config := &Config{}
err = yaml.Unmarshal(configFileContents, config)
if err != nil {
return nil, err
}
return config, nil
}