Switch to gorm for activity logging
This commit is contained in:
@@ -2,9 +2,12 @@ package system
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var ipTrimRegex = regexp.MustCompile(`(:\d*)?$`)
|
||||
|
||||
const characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
|
||||
|
||||
// RandomString generates a random string of alpha-numeric characters using a
|
||||
@@ -18,3 +21,9 @@ func RandomString(n int) string {
|
||||
}
|
||||
return b.String()
|
||||
}
|
||||
|
||||
// TrimIPSuffix removes the internal port value from an IP address to ensure we're only
|
||||
// ever working directly with the IP address.
|
||||
func TrimIPSuffix(s string) string {
|
||||
return ipTrimRegex.ReplaceAllString(s, "")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user