summaryrefslogtreecommitdiff
path: root/utilities/utilities.go
diff options
context:
space:
mode:
authorWill Hawkins <[email protected]>2022-05-04 10:45:06 -0400
committerWill Hawkins <[email protected]>2022-05-04 10:45:06 -0400
commitfa647c6645f74e3c0e6fded658f5f8b5882b0e01 (patch)
tree1ebcf05ba04fb655fa119a4d9e62dfd8b3261a05 /utilities/utilities.go
parent3b385cec76f9c23a400cf748d2fba326c456ae3d (diff)
Fully support self-signed certificates (and add debug levels)
Two unrelated changes: 1. Add full support for self-signed HTTPS certificates on the server 2. Add support for multiple log levels: So far we only use one, but adding support for additional levels will help us tier the levels to filter out excessive messages.
Diffstat (limited to 'utilities/utilities.go')
-rw-r--r--utilities/utilities.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/utilities/utilities.go b/utilities/utilities.go
index 46d5766..b8e416c 100644
--- a/utilities/utilities.go
+++ b/utilities/utilities.go
@@ -22,6 +22,8 @@ import (
"os"
"reflect"
"time"
+
+ "github.com/network-quality/goresponsiveness/constants"
)
func IsInterfaceNil(ifc interface{}) bool {
@@ -121,3 +123,24 @@ func SeekForAppend(file *os.File) (err error) {
_, err = file.Seek(0, 2)
return
}
+
+func IsDebug(level constants.DebugLevel) bool {
+ if level <= constants.Debug {
+ return true
+ }
+ return false
+}
+
+func IsWarn(level constants.DebugLevel) bool {
+ if level <= constants.Warn {
+ return true
+ }
+ return false
+}
+
+func IsError(level constants.DebugLevel) bool {
+ if level <= constants.Error {
+ return true
+ }
+ return false
+}