This commit is contained in:
2024-11-22 12:09:50 +03:00
parent 80491ed643
commit 9ec34c6bfc
21 changed files with 57 additions and 156 deletions

View File

@@ -372,6 +372,13 @@ func urlValidartor(fl validator.FieldLevel) bool {
return err == nil
}
func chipsetValidator(fe validator.FieldLevel) bool {
fieldValue := fe.Field().String()
fieldValue = strings.ToLower(fieldValue)
return IsInSlice(fieldValue, chipsetValues)
}
// ValidateRAM checks if request contains RAM value that is positive integer divisible by divisibility passed.
// It is recommended to pass constants.RAM_DIVISIBILITY as divisility arguement
func ValidateRAM(r interfaces.RequestWithRAM, divisibility uint64) error {