aboutsummaryrefslogtreecommitdiff
path: root/errhandlers/validators.go
diff options
context:
space:
mode:
authorVidhu Kant Sharma <bokuwakanojogahoshii@yahoo.com>2022-02-17 14:51:50 +0000
committerGitHub <noreply@github.com>2022-02-17 14:51:50 +0000
commitb1ad199abaf9684b120d73acb04dddc213c87af8 (patch)
treea4c0a4650a94859eb256204dec25aa04ac8caf15 /errhandlers/validators.go
parent541c75949e862f6fd1081bc4081b08187fa7da7b (diff)
parent5c94f2f8e7026b9a4dff874edbf3b4fa3b266516 (diff)
Merge pull request #4 from MikunoNaka/user-animelist
Added all the endpoints to access user info and also update user animelist
Diffstat (limited to 'errhandlers/validators.go')
-rw-r--r--errhandlers/validators.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/errhandlers/validators.go b/errhandlers/validators.go
index 6bf7a3f..1be61cb 100644
--- a/errhandlers/validators.go
+++ b/errhandlers/validators.go
@@ -122,3 +122,27 @@ func IsValidListStatus(status string) bool {
}
return false
}
+
+// Checks if given anime score is valid
+func IsValidScore(score int) bool {
+ if score >= 0 && score <= 10 {
+ return true
+ }
+ return false
+}
+
+// Checks if given anime priority is valid
+func IsValidPriority(priority int) bool {
+ if priority >= 0 && priority <= 2 {
+ return true
+ }
+ return false
+}
+
+// Checks if given rewatch value is valid
+func IsValidRewatchValue(r int) bool {
+ if r >= 0 && r <= 5 {
+ return true
+ }
+ return false
+}