Documentation
¶
Index ¶
- type Block
- type Call
- type CallEnd
- type CallResponse
- type Channel
- type ChannelArchiveRequest
- type ChannelListRequest
- type ChannelListResponse
- type ChannelResponse
- type ChannelSetTopicRequest
- type Client
- type ClientImpl
- type ConversationInvite
- type CreateChannelRequest
- type GenericResponse
- type HttpClientInterface
- type PostMessageRequest
- type Request
- type ResponseMetadata
- type User
- type UsersListRequest
- type UsersListResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Call ¶ added in v0.2.9
type Call struct { // Return-only Id string `json:"id"` // Required for requests ExternalUniqueId string `json:"external_unique_id"` JoinUrl string `json:"join_url"` // Optional StartTimeUnix int64 `json:"date_start"` DesktopAppJoinUrl string `json:"desktop_app_join_url"` ExternalDisplayId string `json:"external_display_id"` Title string `json:"title"` }
Call is used for calls.add requests, and also part of the CallResponse.
type CallEnd ¶ added in v0.2.9
type CallEnd struct {
Id string `json:"id"`
}
calls.end Request. Uses GenericResponse.
type CallResponse ¶ added in v0.2.9
type ChannelArchiveRequest ¶
type ChannelArchiveRequest struct {
ChannelId string `json:"channel"`
}
conversations.archive request. Uses GenericResponse.
func (ChannelArchiveRequest) URL ¶
func (r ChannelArchiveRequest) URL() string
func (ChannelArchiveRequest) Verb ¶
func (r ChannelArchiveRequest) Verb() string
type ChannelListRequest ¶
type ChannelListRequest struct {
Cursor string
}
conversations.List request. Uses ChannelListResponse.
func (ChannelListRequest) URL ¶
func (r ChannelListRequest) URL() string
func (ChannelListRequest) Verb ¶
func (r ChannelListRequest) Verb() string
type ChannelListResponse ¶
type ChannelListResponse struct { Ok bool `json:"ok"` Channels []Channel `json:"channels"` Metadata ResponseMetadata `json:"response_metadata"` Warning string `json:"warning"` Error string `json:"error"` }
type ChannelResponse ¶
type ChannelSetTopicRequest ¶ added in v0.9.0
type ChannelSetTopicRequest struct { ChannelId string `json:"channel"` Topic string `json:"topic"` }
conversations.setTopic request. Uses GenericResponse.
func (ChannelSetTopicRequest) URL ¶ added in v0.9.0
func (r ChannelSetTopicRequest) URL() string
func (ChannelSetTopicRequest) Verb ¶ added in v0.9.0
func (r ChannelSetTopicRequest) Verb() string
type Client ¶ added in v0.9.0
type Client interface { // Execute makes an HTTP request with the given Request, // and populates resp with the JSON response. // Returns the raw response text, and an error (nil on success). Execute(req Request, resp interface{}) (string, error) }
func NewClientWithHttpClient ¶ added in v0.9.0
func NewClientWithHttpClient(httpClient HttpClientInterface, token string) Client
type ClientImpl ¶ added in v0.9.0
type ClientImpl struct {
// contains filtered or unexported fields
}
type ConversationInvite ¶
conversations.invite request. Uses ChannelResponse.
func (ConversationInvite) URL ¶
func (r ConversationInvite) URL() string
func (ConversationInvite) Verb ¶
func (r ConversationInvite) Verb() string
type CreateChannelRequest ¶
type CreateChannelRequest struct {
Name string `json:"name"`
}
conversations.create request. Uses ChannelResponse.
func (CreateChannelRequest) URL ¶
func (r CreateChannelRequest) URL() string
func (CreateChannelRequest) Verb ¶
func (r CreateChannelRequest) Verb() string
type GenericResponse ¶
type GenericResponse struct { Ok bool `json:"ok"` Warning string `json:"warning"` Error string `json:"error"` }
GenericResponse represents a generic response for methods that don't return more specific information.
type HttpClientInterface ¶ added in v0.9.0
HTTPClient interface, this is implemented by http.Client
type PostMessageRequest ¶
type PostMessageRequest struct { ChannelId string `json:"channel"` Text string `json:"text"` Blocks []Block `json:"blocks"` }
chat.postMessage request. Uses GenericResponse.
func (PostMessageRequest) URL ¶
func (r PostMessageRequest) URL() string
func (PostMessageRequest) Verb ¶
func (r PostMessageRequest) Verb() string
type ResponseMetadata ¶
type ResponseMetadata struct { // NextCursor is used by paginating methods. NextCursor string `json:"next_cursor"` }
type UsersListRequest ¶
type UsersListRequest struct { // These don't encode to JSON, since this isn't a POST request. Cursor string Limit string }
users.list request. Uses UsersListResponse.
func (UsersListRequest) URL ¶
func (r UsersListRequest) URL() string
func (UsersListRequest) Verb ¶
func (r UsersListRequest) Verb() string
type UsersListResponse ¶
type UsersListResponse struct { Ok bool `json:"ok"` Members []User `json:"members"` Metadata ResponseMetadata `json:"response_metadata"` Error string `json:"error"` ErrorDetail string `json:"detail"` }