Documentation
¶
Index ¶
- type AuthTestResult
- type Channel
- type Client
- func (c *Client) AddReaction(channelID, timestamp, name string) error
- func (c *Client) ArchiveChannel(channelID string) error
- func (c *Client) AuthTest() (*AuthTestResult, error)
- func (c *Client) CreateChannel(name string, isPrivate bool) (*Channel, error)
- func (c *Client) DeleteFile(fileID string) error
- func (c *Client) DeleteMessage(channelID, timestamp string) error
- func (c *Client) DownloadFile(url, destPath string) error
- func (c *Client) EditMessage(channelID, timestamp, text string) (*Message, error)
- func (c *Client) GetChannelInfo(channelID string) (*Channel, error)
- func (c *Client) GetFileInfo(fileID string) (*File, error)
- func (c *Client) GetUserInfo(userID string) (*User, error)
- func (c *Client) GetUserPresence(userID string) (string, error)
- func (c *Client) InviteToChannel(channelID string, userIDs ...string) error
- func (c *Client) KickFromChannel(channelID, userID string) error
- func (c *Client) ListChannels(params PaginationParams) (*PaginatedResult[Channel], error)
- func (c *Client) ListFiles(params PaginationParams, channelID, userID string) (*PaginatedResult[File], error)
- func (c *Client) ListMessages(params ListMessagesParams) (*PaginatedResult[Message], error)
- func (c *Client) ListReactions(userID string, params PaginationParams) (*PaginatedResult[ReactedItem], error)
- func (c *Client) ListUsers(params PaginationParams) (*PaginatedResult[User], error)
- func (c *Client) RemoveReaction(channelID, timestamp, name string) error
- func (c *Client) SearchMessages(params SearchParams) (*SearchResult, error)
- func (c *Client) SendMessage(params SendMessageParams) (*Message, error)
- func (c *Client) SetChannelPurpose(channelID, purpose string) error
- func (c *Client) SetChannelTopic(channelID, topic string) error
- func (c *Client) UploadFile(channelID, filename, title string, reader io.Reader) (*File, error)
- type ErrorCode
- type File
- type ListMessagesParams
- type Message
- type Option
- type PaginatedResult
- type PaginationParams
- type ReactedItem
- type Reaction
- type SearchFilesResult
- type SearchParams
- type SearchResult
- type SendMessageParams
- type Service
- type SlackError
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthTestResult ¶
type Channel ¶
type Channel struct {
ID string `json:"id"`
Name string `json:"name"`
Topic string `json:"topic,omitempty"`
Purpose string `json:"purpose,omitempty"`
NumMembers int `json:"num_members"`
IsArchived bool `json:"is_archived"`
IsPrivate bool `json:"is_private"`
IsMember bool `json:"is_member"`
Created int `json:"created"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddReaction ¶
func (*Client) ArchiveChannel ¶
func (*Client) AuthTest ¶
func (c *Client) AuthTest() (*AuthTestResult, error)
func (*Client) CreateChannel ¶
func (*Client) DeleteFile ¶
func (*Client) DeleteMessage ¶
func (*Client) DownloadFile ¶
func (*Client) EditMessage ¶
func (*Client) InviteToChannel ¶
func (*Client) KickFromChannel ¶
func (*Client) ListChannels ¶
func (c *Client) ListChannels(params PaginationParams) (*PaginatedResult[Channel], error)
func (*Client) ListFiles ¶
func (c *Client) ListFiles(params PaginationParams, channelID, userID string) (*PaginatedResult[File], error)
func (*Client) ListMessages ¶
func (c *Client) ListMessages(params ListMessagesParams) (*PaginatedResult[Message], error)
func (*Client) ListReactions ¶
func (c *Client) ListReactions(userID string, params PaginationParams) (*PaginatedResult[ReactedItem], error)
func (*Client) ListUsers ¶
func (c *Client) ListUsers(params PaginationParams) (*PaginatedResult[User], error)
func (*Client) RemoveReaction ¶
func (*Client) SearchMessages ¶
func (c *Client) SearchMessages(params SearchParams) (*SearchResult, error)
func (*Client) SendMessage ¶
func (c *Client) SendMessage(params SendMessageParams) (*Message, error)
func (*Client) SetChannelPurpose ¶
func (*Client) SetChannelTopic ¶
type File ¶
type File struct {
ID string `json:"id"`
Name string `json:"name"`
Title string `json:"title"`
Mimetype string `json:"mimetype"`
Filetype string `json:"filetype"`
Size int `json:"size"`
User string `json:"user"`
Created int64 `json:"created"`
URLPrivate string `json:"url_private"`
Permalink string `json:"permalink"`
}
type ListMessagesParams ¶
type PaginatedResult ¶
type PaginationParams ¶
func (PaginationParams) EffectiveLimit ¶
func (p PaginationParams) EffectiveLimit() int
type ReactedItem ¶
type SearchFilesResult ¶
type SearchParams ¶
type SearchParams struct {
Query string
Sort string
SortDir string
Pagination PaginationParams
}
type SearchResult ¶
type SendMessageParams ¶
type Service ¶
type Service interface {
AuthTest() (*AuthTestResult, error)
ListChannels(params PaginationParams) (*PaginatedResult[Channel], error)
GetChannelInfo(channelID string) (*Channel, error)
CreateChannel(name string, isPrivate bool) (*Channel, error)
ArchiveChannel(channelID string) error
InviteToChannel(channelID string, userIDs ...string) error
KickFromChannel(channelID, userID string) error
SetChannelTopic(channelID, topic string) error
SetChannelPurpose(channelID, purpose string) error
ListMessages(params ListMessagesParams) (*PaginatedResult[Message], error)
SendMessage(params SendMessageParams) (*Message, error)
EditMessage(channelID, timestamp, text string) (*Message, error)
DeleteMessage(channelID, timestamp string) error
SearchMessages(params SearchParams) (*SearchResult, error)
ListUsers(params PaginationParams) (*PaginatedResult[User], error)
GetUserInfo(userID string) (*User, error)
GetUserPresence(userID string) (string, error)
AddReaction(channelID, timestamp, name string) error
RemoveReaction(channelID, timestamp, name string) error
ListReactions(userID string, params PaginationParams) (*PaginatedResult[ReactedItem], error)
ListFiles(params PaginationParams, channelID, userID string) (*PaginatedResult[File], error)
GetFileInfo(fileID string) (*File, error)
UploadFile(channelID, filename, title string, reader io.Reader) (*File, error)
DownloadFile(url, destPath string) error
DeleteFile(fileID string) error
}
Service defines the interface for all Slack API operations. *Client satisfies this interface.
type SlackError ¶
type SlackError struct {
Code ErrorCode `json:"code"`
Message string `json:"message"`
Detail string `json:"detail,omitempty"`
Err error `json:"-"`
}
func (*SlackError) Error ¶
func (e *SlackError) Error() string
func (*SlackError) Unwrap ¶
func (e *SlackError) Unwrap() error
type User ¶
type User struct {
ID string `json:"id"`
Name string `json:"name"`
RealName string `json:"real_name"`
Email string `json:"email,omitempty"`
IsAdmin bool `json:"is_admin"`
IsBot bool `json:"is_bot"`
Deleted bool `json:"deleted"`
TZ string `json:"tz,omitempty"`
Presence string `json:"presence,omitempty"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.