summaryrefslogtreecommitdiffstats
path: root/model/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/utils.go')
-rw-r--r--model/utils.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/model/utils.go b/model/utils.go
index 7f612b572..090644ec6 100644
--- a/model/utils.go
+++ b/model/utils.go
@@ -11,14 +11,14 @@ import (
"fmt"
"io"
"io/ioutil"
+ "net"
"net/mail"
"net/url"
"regexp"
+ "strconv"
"strings"
"time"
- "net"
-
goi18n "github.com/nicksnyder/go-i18n/i18n"
"github.com/pborman/uuid"
)
@@ -480,3 +480,15 @@ func IsValidWebsocketUrl(rawUrl string) bool {
return true
}
+
+func IsValidTrueOrFalseString(value string) bool {
+ return value == "true" || value == "false"
+}
+
+func IsValidNumberString(value string) bool {
+ if _, err := strconv.Atoi(value); err != nil {
+ return false
+ }
+
+ return true
+}