Documentation
¶
Overview ¶
Package guac contains a client for the Slack Web and Real Time APIs in Go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeString ¶
DecodeString performs limited URL decoding as per Slack encoding standards
func EncodeString ¶
EncodeString performs limited URL encoding as per Slack encoding standards
Types ¶
type ChannelInfo ¶
type ChannelInfo struct {
ID string `json:"id"`
Name string `json:"name"`
IsMember bool `json:"is_member"`
}
ChannelInfo represents a channel or group's info.
type MessageEvent ¶
type MessageEvent struct {
Type string `json:"type"`
ID uint64 `json:"id"`
Channel string `json:"channel"`
User string `json:"user"`
Text string `json:"text"`
}
MessageEvent is a chat message sent to a user or channel.
type PingPongEvent ¶
PingPongEvent is a ping and also the reciprocal pong.
type RealTimeClient ¶
type RealTimeClient interface {
WebClient
ID() string
Name() string
Close()
Ping() error
Receive() (interface{}, error)
}
RealTimeClient is a client of the Slack RealTime API.
type UserChangeEvent ¶
UserChangeEvent is a notification that something about a user has changed. Currently only username changes are supported.
type WebClient ¶
type WebClient interface {
RealTime() (RealTimeClient, error)
UsersList() ([]UserInfo, error)
ChannelsList() ([]ChannelInfo, error)
GroupsList() ([]ChannelInfo, error)
IMOpen(user string) (string, error)
PostMessage(channel string, text string) error
PostSnippet(channel string, content string, filename string, filetype string, title string, initialComment string) error
}
WebClient is an interface to the Slack Web API.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package realtime contains a websocket dialer and connection for sending and receiving JSON as raw bytes from the Slack API.
|
Package realtime contains a websocket dialer and connection for sending and receiving JSON as raw bytes from the Slack API. |
|
Package web contains request formatting and response parsing for Slack Web API calls.
|
Package web contains request formatting and response parsing for Slack Web API calls. |
Click to show internal directories.
Click to hide internal directories.