added basic ws commands
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user