added basic ws commands

This commit is contained in:
zomo
2026-01-07 00:16:15 -06:00
parent a6d932a560
commit e01bd2eb9b
4 changed files with 107 additions and 36 deletions

View File

@@ -27,6 +27,7 @@ type Config struct {
ClientSecret string
RedirectURI string
SQliteDB string
WSAuthorization string
}
func (c *Config) def() {
@@ -51,6 +52,9 @@ func (c *Config) loadEnv() error {
if str, found := os.LookupEnv("SQLITE_DB"); found {
c.SQliteDB = strings.TrimSpace(str)
}
if str, found := os.LookupEnv("WS_AUTHORIZATION"); found {
c.WSAuthorization = strings.TrimSpace(str)
}
return nil
}
@@ -65,6 +69,9 @@ func (c *Config) verify() error {
if c.RedirectURI == "" {
return errors.New("unable to load a configured Redirect URI")
}
if c.WSAuthorization == "" {
return errors.New("unable to load a configured WS Authorization code")
}
return nil
}