Documentation ¶
Index ¶
- func NewSlackWebhookMessage(msg string) *slack.WebhookMessage
- type BotService
- func (s *BotService) Check(ctx context.Context) error
- func (s *BotService) GetService() *services.Services
- func (s *BotService) Handle(method, path string, handler gin.HandlerFunc)
- func (s *BotService) Run() error
- func (s *BotService) SetLogger(logger *logger.Logger)
- func (s *BotService) SetService(services *services.Services)
- func (s *BotService) Stop(ctx context.Context) error
- type Client
- func (cli *Client) GetUserInfoWithTokenExpirationCheck(channel string, storeFn StoreNewTokenFunc, options ...slack.MsgOption) (slackUser *slack.User, err error)
- func (cli *Client) SendMessageWithTokenExpirationCheck(channel string, storeFn StoreNewTokenFunc, options ...slack.MsgOption) (channelID string, msgTimestamp string, respText string, err error)
- type HttpClient
- type StoreNewTokenFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSlackWebhookMessage ¶
func NewSlackWebhookMessage(msg string) *slack.WebhookMessage
Types ¶
type BotService ¶ added in v0.14.1
type BotService struct {
// contains filtered or unexported fields
}
func NewBotService ¶ added in v0.14.1
func NewBotService(slackConfig configs.SectionSlack) *BotService
func (*BotService) GetService ¶ added in v0.14.1
func (s *BotService) GetService() *services.Services
func (*BotService) Handle ¶ added in v0.14.1
func (s *BotService) Handle(method, path string, handler gin.HandlerFunc)
func (*BotService) Run ¶ added in v0.14.1
func (s *BotService) Run() error
func (*BotService) SetLogger ¶ added in v0.14.1
func (s *BotService) SetLogger(logger *logger.Logger)
func (*BotService) SetService ¶ added in v0.14.1
func (s *BotService) SetService(services *services.Services)
type Client ¶
func NewSlackCli ¶
func NewSlackCli(httpCli HttpClient, clientID, clientSecret, refreshToken, accessToken string) *Client
func (*Client) GetUserInfoWithTokenExpirationCheck ¶ added in v0.24.1
func (cli *Client) GetUserInfoWithTokenExpirationCheck(channel string, storeFn StoreNewTokenFunc, options ...slack.MsgOption) (slackUser *slack.User, err error)
GetUserInfoWithTokenExpirationCheck will checks if the error is "token_expired" error, if so, will get new token and try again.
func (*Client) SendMessageWithTokenExpirationCheck ¶
func (cli *Client) SendMessageWithTokenExpirationCheck(channel string, storeFn StoreNewTokenFunc, options ...slack.MsgOption) (channelID string, msgTimestamp string, respText string, err error)
SendMessageWithTokenExpirationCheck will checks if the error is "token_expired" error, if so, will get new token and try again.
type StoreNewTokenFunc ¶
Click to show internal directories.
Click to hide internal directories.