chore: Adds login and user creation support to the API.
This commit is contained in:
parent
96833b238b
commit
843cd34785
13 changed files with 683 additions and 12 deletions
30
frontend/config/config.go
Normal file
30
frontend/config/config.go
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue