This repository has been archived by the owner on Feb 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
interface.go
79 lines (73 loc) · 1.58 KB
/
interface.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package slackgw
import (
"net/http"
"github.com/nlopes/slack"
)
const (
AccountsChangedEvent int64 = 1 << (iota + 1)
AckErrorEvent
BotAddedEvent
BotChangedEvent
ChannelCreatedEvent
ChannelHistoryChangedEvent
ChannelInfoEvent
ChannelJoinedEvent
ChannelRenameEvent
CommandsChangedEvent
ConnectedEvent
ConnectingEvent
ConnectionErrorEvent
DNDUpdatedEvent
DisconnectedEvent
EmailDomainChangedEvent
EmojiChangedEvent
FileCommentAddedEvent
FileCommentDeletedEvent
FileCommentEditedEvent
GroupCreatedEvent
GroupRenameEvent
HelloEvent
IMCreatedEvent
InvalidAuthEvent
ManualPresenceChangeEvent
MessageEvent
MessageTooLongEvent
OutgoingErrorEvent
PinAddedEvent
PinRemovedEvent
PrefChangeEvent
PresenceChangeEvent
ReactionAddedEvent
ReactionRemovedEvent
ReconnectUrlEvent
StarAddedEvent
StarRemovedEvent
TeamDomainChangeEvent
TeamJoinEvent
TeamMigrationStartedEvent
TeamPrefChangeEvent
TeamRenameEvent
UnmarshallingErrorEvent
UserChangeEvent
UserTypingEvent
MaxEvent
)
type SlackClient interface {
NewRTM() *slack.RTM
AuthTest() (*slack.AuthTestResponse, error)
PostMessage(string, string, slack.PostMessageParameters) (string, string, error)
}
type SlackRTMClient interface {
Disconnect() error
}
type Server struct {
*http.ServeMux
AuthHeader string // if non empty, authorize
AuthToken string // XXX temporary. do not rely on this being here
bus chan *Message
done chan struct{}
slack SlackClient // For testing purposes, we use an interface here
rtm *slack.RTM
rtmhandler SlackRTMHandler // Handles mesages
slackuser string
}