summaryrefslogtreecommitdiff
path: root/domain.go
diff options
context:
space:
mode:
Diffstat (limited to 'domain.go')
-rw-r--r--domain.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/domain.go b/domain.go
index b897bbb..c7b5102 100644
--- a/domain.go
+++ b/domain.go
@@ -3,6 +3,7 @@ package main
import (
"log"
"net"
+ "strings"
)
func (vD VirtualDomain) DomainExists() bool {
@@ -44,3 +45,13 @@ func (vD VirtualDomain) ValidateDomain() bool {
}
return true
}
+
+func GetDomain(email string) string {
+ fragments := strings.Split(email, "@")
+ return fragments[len(fragments)-1]
+}
+
+func (vD VirtualDomain) GetPrimaryKey() int64 {
+ Db.Find(&vD)
+ return vD.Id
+}