diff options
author | jan <jan@ruken.pw> | 2016-11-13 16:57:45 (UTC) |
---|---|---|
committer | jan <jan@ruken.pw> | 2016-11-13 16:57:45 (UTC) |
commit | d00114ba6e62f2f20e2a76af9fef4c55c7e3a312 (patch) | |
tree | 4afa0e587bd7aad36158c8b206128af1783c5b64 /charakterin.go | |
parent | 96b08bfa8906e3d9b0c8f98186c6b21906685be5 (diff) |
Diffstat (limited to 'charakterin.go')
-rw-r--r-- | charakterin.go | 13 |
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 { | |||
50 | var reEmail, _ = regexp.Compile(`(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,})`) | 50 | var reEmail, _ = regexp.Compile(`(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,})`) |
51 | var reUsername, _ = regexp.Compile(`^(\w+( \w+)?)+$`) | 51 | var reUsername, _ = regexp.Compile(`^(\w+( \w+)?)+$`) |
52 | 52 | ||
53 | func 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. |
54 | func New(db *sql.DB) *Charakterin { | 67 | func New(db *sql.DB) *Charakterin { |
55 | if err := db.Ping(); err != nil { | 68 | if err := db.Ping(); err != nil { |