-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlicense.go
More file actions
48 lines (39 loc) · 900 Bytes
/
license.go
File metadata and controls
48 lines (39 loc) · 900 Bytes
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package license
import (
"time"
)
type LicenseInfo struct {
IsLe5le bool
AppExpiration time.Time
UserLimit int64
DBDiskLimitG int64
DBDiskLimit int64
CollectionLimit int64
DocumentLimit int64
Access uint16
UpdateExpiration time.Time
}
func GetSecretKey() string {
return "your-secret#le5le.com"
}
func DecryptLicense(license, secret string) (info LicenseInfo) {
info.AppExpiration = time.Now().AddDate(100, 0, 0)
info.UserLimit = 100000000
info.DBDiskLimitG = 100000000
info.CollectionLimit = 100000000
info.DocumentLimit = 100000000
info.Access = 255
info.UpdateExpiration = info.AppExpiration
return
}
// Mk 生成key
func Mk(nums string) string {
return nums
}
func Encode(key, text string) string {
return text
}
// Dc 解码
func Dc(key, text string) string {
return text
}