CLeanup the User and Password checking
Added a Method in ConfigFile
This commit is contained in:
@@ -4,7 +4,10 @@
|
||||
|
||||
package main
|
||||
|
||||
import "errors"
|
||||
import (
|
||||
"errors"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// The config file
|
||||
type ConfigFile struct {
|
||||
@@ -25,6 +28,10 @@ func (c *ConfigFile) Init() {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *ConfigFile) WasProvidedUserAndPassword() bool {
|
||||
return len(strings.TrimSpace(c.User)) > 0 && len(strings.TrimSpace(c.Password)) > 0
|
||||
}
|
||||
|
||||
// Returns an App with by appID
|
||||
func (c *ConfigFile) GetAppByAppID(appID string) (*App, error) {
|
||||
for _, app := range c.Apps {
|
||||
|
||||
Reference in New Issue
Block a user