| Copyright | (c) 2020 Tom McLaughlin |
|---|---|
| License | MIT |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Web.Slack.ProgressBar
Description
This is a simple library for creating and updating Slack messages that contain progress bars. It can be used to display the progress of a long-running task in a Slack channel, for example as part of CI tooling.
See app/Main.hs in the repo for example code, or README.md on GitHub for an animated GIF.
Synopsis
- createProgressBar :: SlackConfig -> ChannelName -> ProgressBarInfo -> IO (Either Text ProgressBar)
- updateProgressBar :: SlackConfig -> ProgressBar -> ProgressBarInfo -> IO (Either Text ())
- data ProgressBarInfo = ProgressBarInfo {}
- data ProgressBarAttachment = ProgressBarAttachment {}
- data ProgressBar
- type ChannelName = Text
- newtype SlackConfig = SlackConfig {}
Documentation
createProgressBar :: SlackConfig -> ChannelName -> ProgressBarInfo -> IO (Either Text ProgressBar) Source #
Create a progress bar message on the given channel.
Returns a ProgressBar which can be used to update the message by calling updateProgressBar.
updateProgressBar :: SlackConfig -> ProgressBar -> ProgressBarInfo -> IO (Either Text ()) Source #
Update an existing progress bar.
data ProgressBarInfo Source #
The state of a progress bar message.
Constructors
| ProgressBarInfo | |
Fields
| |
data ProgressBarAttachment Source #
A Slack attachment.
Constructors
| ProgressBarAttachment | |
Fields
| |
Instances
| ToJSON ProgressBarAttachment Source # | |
Defined in Web.Slack.ProgressBar Methods toJSON :: ProgressBarAttachment -> Value # toEncoding :: ProgressBarAttachment -> Encoding # toJSONList :: [ProgressBarAttachment] -> Value # toEncodingList :: [ProgressBarAttachment] -> Encoding # | |
data ProgressBar Source #
An opaque type representing an existing Slack message.
type ChannelName = Text Source #
newtype SlackConfig Source #
Configuration options needed to connect to the Slack API
Constructors
| SlackConfig | |
Fields
| |
Instances
| Show SlackConfig Source # | |
Defined in Web.Slack.ProgressBar Methods showsPrec :: Int -> SlackConfig -> ShowS # show :: SlackConfig -> String # showList :: [SlackConfig] -> ShowS # | |