-
Notifications
You must be signed in to change notification settings - Fork 4
/
decl.go
30 lines (24 loc) · 947 Bytes
/
decl.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Package friendmail is an extension which provides ability to send email to friend
package friendmail
import (
"github.com/dchest/captcha"
"github.com/ottemo/commerce/env"
"sync"
"time"
)
// Package global constants
const (
ConstCollectionNameFriendMail = "friend_mail"
ConstConfigPathFriendMail = "general.friendmail"
ConstConfigPathFriendMailEmailTemplate = "general.friendmail.template"
ConstConfigPathFriendMailEmailSubject = "general.friendmail.subject"
ConstErrorModule = "friendmail"
ConstErrorLevel = env.ConstErrorLevelActor
ConstMaxCaptchaItems = 100000 // captcha maximum amount (to prevent memory leaks)
ConstCaptchaLifeTime = 300 // seconds generated captcha works (5 min)
)
var (
captchaValuesMutex sync.RWMutex // synchronization on captchaValues variable
captchaValues map[string]time.Time // global variable to track generated captcha codes
captchaStore captcha.Store
)