Documentation
¶
Index ¶
- type Client
- type Option
- type Pool
- func (p *Pool) AuthTestContext(ctx context.Context) (response *slack.AuthTestResponse, err error)
- func (p *Pool) GetConversationHistoryContext(ctx context.Context, params *slack.GetConversationHistoryParameters) (*slack.GetConversationHistoryResponse, error)
- func (p *Pool) GetConversationInfoContext(ctx context.Context, input *slack.GetConversationInfoInput) (*slack.Channel, error)
- func (p *Pool) GetConversationRepliesContext(ctx context.Context, params *slack.GetConversationRepliesParameters) (msgs []slack.Message, hasMore bool, nextCursor string, err error)
- func (p *Pool) GetConversationsContext(ctx context.Context, params *slack.GetConversationsParameters) (channels []slack.Channel, nextCursor string, err error)
- func (p *Pool) GetEmojiContext(ctx context.Context) (map[string]string, error)
- func (p *Pool) GetFileContext(ctx context.Context, downloadURL string, writer io.Writer) error
- func (p *Pool) GetFileInfoContext(ctx context.Context, fileID string, count int, page int) (*slack.File, []slack.Comment, *slack.Paging, error)
- func (p *Pool) GetStarredContext(ctx context.Context, params slack.StarsParameters) ([]slack.StarredItem, *slack.Paging, error)
- func (p *Pool) GetUserInfoContext(ctx context.Context, user string) (*slack.User, error)
- func (w *Pool) GetUserProfileContext(ctx context.Context, params *slack.GetUserProfileParameters) (*slack.UserProfile, error)
- func (p *Pool) GetUsersContext(ctx context.Context, options ...slack.GetUsersOption) ([]slack.User, error)
- func (p *Pool) GetUsersInConversationContext(ctx context.Context, params *slack.GetUsersInConversationParameters) ([]string, string, error)
- func (p *Pool) GetUsersPaginated(options ...slack.GetUsersOption) slack.UserPagination
- func (p *Pool) ListBookmarks(channelID string) ([]slack.Bookmark, error)
- func (p *Pool) SearchFilesContext(ctx context.Context, query string, params slack.SearchParameters) (*slack.SearchFiles, error)
- func (p *Pool) SearchMessagesContext(ctx context.Context, query string, params slack.SearchParameters) (*slack.SearchMessages, error)
- type Slack
- type SlackClienter
- type SlackEdge
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Slack
// contains filtered or unexported fields
}
func New ¶
New creates a new Client instance. It checks if workspace provider is valid, and checks if it's an enterprise workspace. If it is, it creates an edge client.
func Wrap ¶
Wrap wraps a Slack client and returns a Client that implements the SlackClienter interface. This is useful for testing purposes.
func (*Client) AuthTestContext ¶
AuthTestContext returns the cached workspace information that was captured on initialisation.
func (*Client) Client ¶
Client returns an underlying slack.Client
type Option ¶
type Option func(*options)
func WithEnterprise ¶
WithEnterprise sets the enterprise flag. Setting the flag to true forces the use of the edge client, even if the workspace is not an enterprise workspace.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool is a pool of Slack clients that can be used to make API calls. Zero value is not usable, must be initialised with NewPool.
func NewPool ¶
NewPool wraps the slack.Client with the edge client, so that the edge client can be used as a fallback.
func (*Pool) AuthTestContext ¶
func (*Pool) GetConversationHistoryContext ¶
func (p *Pool) GetConversationHistoryContext(ctx context.Context, params *slack.GetConversationHistoryParameters) (*slack.GetConversationHistoryResponse, error)
func (*Pool) GetConversationInfoContext ¶
func (*Pool) GetConversationRepliesContext ¶
func (*Pool) GetConversationsContext ¶
func (*Pool) GetEmojiContext ¶
func (*Pool) GetFileContext ¶
func (*Pool) GetFileInfoContext ¶
func (*Pool) GetStarredContext ¶
func (p *Pool) GetStarredContext(ctx context.Context, params slack.StarsParameters) ([]slack.StarredItem, *slack.Paging, error)
func (*Pool) GetUserInfoContext ¶
func (*Pool) GetUserProfileContext ¶
func (w *Pool) GetUserProfileContext(ctx context.Context, params *slack.GetUserProfileParameters) (*slack.UserProfile, error)
func (*Pool) GetUsersContext ¶
func (*Pool) GetUsersInConversationContext ¶
func (*Pool) GetUsersPaginated ¶
func (p *Pool) GetUsersPaginated(options ...slack.GetUsersOption) slack.UserPagination
func (*Pool) ListBookmarks ¶
func (*Pool) SearchFilesContext ¶
func (p *Pool) SearchFilesContext(ctx context.Context, query string, params slack.SearchParameters) (*slack.SearchFiles, error)
func (*Pool) SearchMessagesContext ¶
func (p *Pool) SearchMessagesContext(ctx context.Context, query string, params slack.SearchParameters) (*slack.SearchMessages, error)
type Slack ¶
type Slack interface {
AuthTestContext(ctx context.Context) (response *slack.AuthTestResponse, err error)
GetConversationHistoryContext(ctx context.Context, params *slack.GetConversationHistoryParameters) (*slack.GetConversationHistoryResponse, error)
GetConversationInfoContext(ctx context.Context, input *slack.GetConversationInfoInput) (*slack.Channel, error)
GetConversationRepliesContext(ctx context.Context, params *slack.GetConversationRepliesParameters) (msgs []slack.Message, hasMore bool, nextCursor string, err error)
GetConversationsContext(ctx context.Context, params *slack.GetConversationsParameters) (channels []slack.Channel, nextCursor string, err error)
GetEmojiContext(ctx context.Context) (map[string]string, error)
GetFileContext(ctx context.Context, downloadURL string, writer io.Writer) error
GetFileInfoContext(ctx context.Context, fileID string, count int, page int) (*slack.File, []slack.Comment, *slack.Paging, error)
GetStarredContext(ctx context.Context, params slack.StarsParameters) ([]slack.StarredItem, *slack.Paging, error)
GetUserInfoContext(ctx context.Context, user string) (*slack.User, error)
GetUsersContext(ctx context.Context, options ...slack.GetUsersOption) ([]slack.User, error)
GetUsersInConversationContext(ctx context.Context, params *slack.GetUsersInConversationParameters) ([]string, string, error)
GetUsersPaginated(options ...slack.GetUsersOption) slack.UserPagination
ListBookmarks(channelID string) ([]slack.Bookmark, error)
SearchFilesContext(ctx context.Context, query string, params slack.SearchParameters) (*slack.SearchFiles, error)
SearchMessagesContext(ctx context.Context, query string, params slack.SearchParameters) (*slack.SearchMessages, error)
GetUserProfileContext(ctx context.Context, params *slack.GetUserProfileParameters) (*slack.UserProfile, error)
}
Slack is an interface that defines the methods that a Slack client should provide.
type SlackClienter ¶
SlackClienter is an extended interface that includes Client method that returns the underlying slack.Client instance.
type SlackEdge ¶
type SlackEdge interface {
SlackClienter
Edge() (*edge.Client, bool)
GetConversationsContextEx(ctx context.Context, params *slack.GetConversationsParameters, onlyMy bool) (channels []slack.Channel, nextCursor string, err error)
}
SlackEdge is an extended interface that includes Edge methods.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mock_client is a generated GoMock package.
|
Package mock_client is a generated GoMock package. |