mirror of
https://github.com/aykhans/movier.git
synced 2025-09-09 23:50:46 +00:00
Rewritten in go and python
This commit is contained in:
20
server/pkg/utils/validation.go
Normal file
20
server/pkg/utils/validation.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"math"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func IsValidPath(path string) bool {
|
||||
return filepath.IsAbs(path)
|
||||
}
|
||||
|
||||
func IsUint32(value int) bool {
|
||||
return value >= 0 && value <= math.MaxUint32
|
||||
}
|
||||
|
||||
func IsInt(value string) bool {
|
||||
_, err := strconv.Atoi(value)
|
||||
return err == nil
|
||||
}
|
Reference in New Issue
Block a user