-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
64 lines (58 loc) · 1.79 KB
/
types.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
53
54
55
56
57
58
59
60
61
62
63
64
package slacktranslatorbot
// struct for Google Translate API response
type GoogleTranslateAPIResponse struct {
Data struct {
Translations []struct {
TranslatedText string `json:"translatedText"`
} `json:"translations"`
} `json:"data"`
}
// struct for runtime environment variables
type envVars struct {
APIKey string
APIBaseURL string
APIPath string
VerifyToken string
}
// struct for forming a slack request
type slackRequest struct {
Token string `schema:"token"`
TeamID string `schema:"team_id"`
TeamDomain string `schema:"team_domain"`
ChannelID string `schema:"channel_id"`
ServiceID string `schema:"service_id"`
ChannelName string `schema:"channel_name"`
Timestamp string `schema:"timestamp"`
UserID string `schema:"user_id"`
UserName string `schema:"user_name"`
Text string `schema:"text"`
TriggerWord string `schema:"trigger_word"`
}
// structs for slack inbound webhook message
type Payload struct {
Channel string `json:"channel"`
Username string `json:"username"`
Text string `json:"text"`
ResponseType string `json:"response_type"`
Icon_emoji string `json:"icon_emoji"`
Unfurl_links bool `json:"unfurl_links"`
Attachments []Attachment `json:"attachments"`
}
type Attachment struct {
Fallback string `json:"fallback"`
Pretext string `json:"pretext"`
Color string `json:"color"`
AuthorName string `json:"author_name"`
AuthorLink string `json:"author_link"`
AuthorIcon string `json:"author_icon"`
Title string `json:"title"`
TitleLink string `json:"title_link"`
Text string `json:"text"`
Fields []Field `json:"fields"`
}
type Field struct {
Title string `json:"title"`
Value string `json:"value"`
Short bool `json:"short"`
}
// EOF