This commit is contained in:
@@ -1,9 +1,20 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
paas "proxmoxaas-common-lib"
|
||||
)
|
||||
|
||||
func ParseGroupname(groupname string) (Groupname, error) {
|
||||
return paas.ParseGroupname(groupname)
|
||||
}
|
||||
|
||||
func ParseUsername(username string) (Username, error) {
|
||||
return paas.ParseUsername(username)
|
||||
}
|
||||
|
||||
// RequireAll ensures that EVERY non-excluded exported field in the struct is non-zero.
|
||||
func RequireAll(v any, excludes ...string) bool {
|
||||
val := reflect.ValueOf(v)
|
||||
@@ -53,3 +64,7 @@ func AtLeastOne(v any, excludes ...string) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (token PVEAPIToken) ToString() string {
|
||||
return fmt.Sprintf(`%s@%s!%s`, token.User, token.Realm, token.ID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user