Documentation ¶
Index ¶
- Constants
- func EscapeMessage(s string) string
- type Attachment
- type InstantMessenger
- type Message
- type NoSuchUserError
- type Response
- type TeamDirectory
- type User
- type WebAPI
- func (api *WebAPI) Call(method string, params url.Values) (response []byte, u *url.URL, err error)
- func (api *WebAPI) GetChannelTopic(channelID string) (string, error)
- func (api *WebAPI) ListUsers() ([]User, error)
- func (api *WebAPI) OpenIMChannel(user User) (string, error)
- func (api *WebAPI) PostMessage(channelID string, message Message) error
- func (api *WebAPI) SetChannelTopic(channelID, topic string) error
- type WebAPIError
Constants ¶
View Source
const ( ResponseTypeEphemeral responseType = iota ResponseTypeInChannel )
View Source
const SlackWebAPIEndpoint = "https://slack.com/api"
Variables ¶
This section is empty.
Functions ¶
func EscapeMessage ¶
Types ¶
type Attachment ¶
type Attachment struct { AuthorName string Title string TitleLink string Text string Markdown bool }
func (Attachment) MarshalJSON ¶ added in v1.1.1
func (a Attachment) MarshalJSON() ([]byte, error)
func (*Attachment) UnmarshalJSON ¶ added in v1.1.1
func (a *Attachment) UnmarshalJSON(data []byte) error
type InstantMessenger ¶ added in v1.1.5
type InstantMessenger struct {
// contains filtered or unexported fields
}
func NewInstantMessenger ¶ added in v1.1.5
func NewInstantMessenger(api messageSender) *InstantMessenger
func (*InstantMessenger) SendMessage ¶ added in v1.1.5
func (im *InstantMessenger) SendMessage(user User, message Message) error
type Message ¶ added in v1.1.5
type Message struct { Text string `json:"text"` Attachments []Attachment `json:"attachments,omitempty"` }
type NoSuchUserError ¶ added in v1.1.5
type NoSuchUserError struct {
Name string
}
func (NoSuchUserError) Error ¶ added in v1.1.5
func (e NoSuchUserError) Error() string
type Response ¶
type Response struct { Message ResponseType responseType `json:"response_type,omitempty"` }
func NewEphemeralResponse ¶
func NewInChannelResponse ¶
type TeamDirectory ¶ added in v1.1.5
type TeamDirectory struct {
// contains filtered or unexported fields
}
func NewTeamDirectory ¶ added in v1.1.5
func NewTeamDirectory(api userLister) *TeamDirectory
type WebAPI ¶ added in v1.0.1
type WebAPI struct { BaseURL string // contains filtered or unexported fields }
func (*WebAPI) GetChannelTopic ¶ added in v1.0.1
func (*WebAPI) OpenIMChannel ¶ added in v1.1.5
func (*WebAPI) PostMessage ¶ added in v1.1.5
func (*WebAPI) SetChannelTopic ¶ added in v1.0.1
type WebAPIError ¶ added in v1.0.1
type WebAPIError struct {
Method, URL, Response string
}
func (*WebAPIError) Error ¶ added in v1.0.1
func (e *WebAPIError) Error() string
Click to show internal directories.
Click to hide internal directories.