aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--charakterin.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/charakterin.go b/charakterin.go
index 413d698..525b329 100644
--- a/charakterin.go
+++ b/charakterin.go
@@ -50,6 +50,19 @@ type Charakterin struct {
50var reEmail, _ = regexp.Compile(`(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,})`) 50var reEmail, _ = regexp.Compile(`(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,})`)
51var reUsername, _ = regexp.Compile(`^(\w+( \w+)?)+$`) 51var reUsername, _ = regexp.Compile(`^(\w+( \w+)?)+$`)
52 52
53func GetRendererFunctions() map[string]interface{} {
54 m := make(map[string]interface{})
55
56 m["isSameUser"] = func(u1 *User, u2 *User) bool {
57 if u1 == nil || u2 == nil {
58 return false
59 }
60
61 return u1.ID == u2.ID
62 }
63 return m
64}
65
53// New erstellt eine neue Instanz von Charakterin. 66// New erstellt eine neue Instanz von Charakterin.
54func New(db *sql.DB) *Charakterin { 67func New(db *sql.DB) *Charakterin {
55 if err := db.Ping(); err != nil { 68 if err := db.Ping(); err != nil {