-
Notifications
You must be signed in to change notification settings - Fork 19
/
interface.go
77 lines (66 loc) · 1.68 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
package slack
import (
"context"
"golang.org/x/oauth2"
)
// Logger is an interface for logging/tracing the client's
// execution.
//
// In particular, `Debugf` will only be called if `WithDebug`
// is provided to the constructor.
type Logger interface {
Debugf(context.Context, string, ...interface{})
Infof(context.Context, string, ...interface{})
}
const (
ParseFull = "full"
ParseNone = "none"
)
type ControlSequence interface {
Data() string
Surface() string
String() string
}
type ChannelLink struct {
ID string
Channel string
}
type UserLink struct {
ID string
Username string
}
type ExternalLink struct {
URL string
Text string
}
// DefaultSlackAPIEndpoint contains the prefix used for Slack REST API
const (
DefaultAPIEndpoint = "https://slack.com/api/"
DefaultOAuth2AuthEndpoint = "https://slack.com/oauth/authorize"
DefaultOAuth2TokenEndpoint = "https://slack.com/api/oauth.access"
)
// Oauth2Endpoint contains the Slack OAuth2 endpoint configuration
var OAuth2Endpoint = oauth2.Endpoint{
AuthURL: DefaultOAuth2AuthEndpoint,
TokenURL: DefaultOAuth2TokenEndpoint,
}
type Client struct {
auth *AuthService
bots *BotsService
channels *ChannelsService
chat *ChatService
dialog *DialogService
emoji *EmojiService
groups *GroupsService
oauth *OAuthService
reactions *ReactionsService
reminders *RemindersService
rtm *RTMService
users *UsersService
usersProfile *UsersProfileService
usergroups *UsergroupsService
usergroupsUsers *UsergroupsUsersService
debug bool
slackURL string
token string
}