internal/utils: purge unused methods

This commit is contained in:
Joel Rebello 2022-07-26 11:01:51 +02:00
parent e884fddfdc
commit ddd4b423b5
No known key found for this signature in database
GPG Key ID: EDB938BE882F8078

View File

@ -1,10 +1,7 @@
package internal
import (
"errors"
"unicode"
"github.com/bmc-toolbox/bmclib/cfgresources"
)
// IsntLetterOrNumber check if the give rune is not a letter nor a number
@ -16,27 +13,6 @@ func IsRoleValid(role string) bool {
return role == "admin" || role == "user" || role == "operator"
}
func ValidateUserConfig(cfgUsers []*cfgresources.User) (err error) {
for _, cfgUser := range cfgUsers {
if cfgUser.Name == "" {
msg := "User resource expects parameter: Name."
return errors.New(msg)
}
if cfgUser.Password == "" {
msg := "User resource expects parameter: Password."
return errors.New(msg)
}
if !IsRoleValid(cfgUser.Role) {
msg := "Parameter \"Role\" is one of ['admin', 'user']. You sent " + cfgUser.Role
return errors.New(msg + "!")
}
}
return nil
}
func StringInSlice(str string, sl []string) bool {
for _, s := range sl {
if str == s {