Documentation
¶
Index ¶
- func NewFactory() im.AdapterFactory
- type Adapter
- func (a *Adapter) DownloadFile(ctx context.Context, msg *im.IncomingMessage) (io.ReadCloser, string, error)
- func (a *Adapter) EndStream(ctx context.Context, incoming *im.IncomingMessage, streamID string) error
- func (a *Adapter) FinalizeStream(ctx context.Context, incoming *im.IncomingMessage, streamID string, ...) error
- func (a *Adapter) HandleURLVerification(c *gin.Context) bool
- func (a *Adapter) ParseCallback(c *gin.Context) (*im.IncomingMessage, error)
- func (a *Adapter) Platform() im.Platform
- func (a *Adapter) SendReply(ctx context.Context, incoming *im.IncomingMessage, reply *im.ReplyMessage) error
- func (a *Adapter) SendStreamChunk(ctx context.Context, incoming *im.IncomingMessage, streamID string, ...) error
- func (a *Adapter) StartStream(ctx context.Context, incoming *im.IncomingMessage) (string, error)
- func (a *Adapter) UpdateStreamContent(ctx context.Context, incoming *im.IncomingMessage, streamID string, ...) error
- func (a *Adapter) VerifyCallback(c *gin.Context) error
- type LongConnClient
- type MessageHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
func NewFactory() im.AdapterFactory
NewFactory returns an im.AdapterFactory for Slack channels. Supports "webhook" (Events API) and "websocket" (Socket Mode, default).
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter implements im.Adapter and im.StreamSender for Slack. It delegates to the Slack LongConnClient for Socket Mode.
func NewAdapter ¶
func NewAdapter(client *LongConnClient, api *slack.Client) *Adapter
NewAdapter creates an adapter backed by a Slack long connection client.
func NewWebhookAdapter ¶
NewWebhookAdapter creates an adapter for Slack Events API via Webhook.
func (*Adapter) DownloadFile ¶
func (a *Adapter) DownloadFile(ctx context.Context, msg *im.IncomingMessage) (io.ReadCloser, string, error)
func (*Adapter) FinalizeStream ¶
func (*Adapter) HandleURLVerification ¶
func (*Adapter) ParseCallback ¶
func (*Adapter) SendReply ¶
func (a *Adapter) SendReply(ctx context.Context, incoming *im.IncomingMessage, reply *im.ReplyMessage) error
func (*Adapter) SendStreamChunk ¶
func (*Adapter) StartStream ¶
func (*Adapter) UpdateStreamContent ¶
type LongConnClient ¶
type LongConnClient struct {
// contains filtered or unexported fields
}
LongConnClient manages a Slack Socket Mode long connection.
func NewLongConnClient ¶
func NewLongConnClient(appToken, botToken string, handler MessageHandler) *LongConnClient
NewLongConnClient creates a Slack long connection client.
func (*LongConnClient) GetAPI ¶
func (c *LongConnClient) GetAPI() *slack.Client
GetAPI returns the underlying slack API client.
type MessageHandler ¶
type MessageHandler func(ctx context.Context, msg *im.IncomingMessage) error
MessageHandler is called when an IM message is received via long connection.
Click to show internal directories.
Click to hide internal directories.