-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.go
52 lines (48 loc) · 1.34 KB
/
constants.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main
const (
LogFormatHeader = "\\#%s\n"
LogFormatChat = "chat: `%s` \\[`%d`\\]\n"
LogFormatUser = "user: [%s](tg://user?id=%d) \\[`%d`\\]\n"
LogFormatUsername = "username: @%s\n"
LogFormatBio = "bio: `%s`\n"
LogFormatIsGetChat = "isGetChat: `%t`\n"
LogFormatLanguage = "language: `%s`\n"
LogFormatPremium = "premium: `%t`\n"
LogFormatIsBlocked = "blocked: `%t`\n"
LogFormatData = "data:\n`%s`\n"
LogFormatAnswer = "ID: %d\nA: %s\n"
LogFormatVersion = "version: `%s`\n"
LogFormatPlatform = "platform: `%s`\n"
LogFormatStartTime = "startTime: `%d`\n"
LogFormatValidateElapsed = "validateElapsed: `%dms`\n"
LogFormatSubmitElapsed = "submitElapsed: `%dms`\n"
LogFormatIp = "ip: `%s`\n"
LogFormatUserAgent = "userAgent: `%s`\n"
)
type LogType int8
const (
LogTypeRequested LogType = iota
LogTypeApproved
LogTypeTimeout
LogTypeWrong
LogTypeBanRegex
LogTypeValidate
)
func (t LogType) String() string {
switch t {
case LogTypeRequested:
return "REQUESTED"
case LogTypeApproved:
return "APPROVED"
case LogTypeTimeout:
return "TIMEOUT"
case LogTypeWrong:
return "WRONG"
case LogTypeBanRegex:
return "BAN_REGEX"
case LogTypeValidate:
return "VALIDATE"
default:
return "UNKNOWN"
}
}