Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- postMessage :: (MonadError Text m, MonadIO m) => SlackConfig -> ChannelName -> Text -> [Value] -> Maybe [Value] -> m Value
- updateMessage :: (MonadError Text m, MonadIO m) => SlackConfig -> ChannelName -> Text -> Text -> [Value] -> Maybe [Value] -> m ()
- encode' :: ToJSON a => a -> Text
- makeSlackCall :: (MonadError Text m, MonadIO m) => SlackConfig -> String -> Value -> m Value
- (??) :: MonadError e m => Maybe a -> e -> m a
- toMarkdown :: FailureReason -> Text
- callStackToMarkdown :: SlackFormatterShowCallStacks -> CallStack -> Text
- showCallStack :: CallStack -> Text
- createProgressBar :: SlackConfig -> ChannelName -> Maybe Int64 -> ProgressBarInfo -> IO (Either Text ProgressBar)
- updateProgressBar :: SlackConfig -> Maybe Int64 -> ProgressBar -> ProgressBarInfo -> IO (Either Text ())
- getMessage :: ProgressBarInfo -> Text
- getAttachments :: ProgressBarInfo -> [Value]
- addMessageToBlocks :: Text -> Maybe [Value] -> Maybe [Value]
- truncateBlocksIfNecessary :: Maybe Int64 -> [Value] -> [Value]
- barSized :: Double -> Text
- newtype SlackConfig = SlackConfig {}
- data ProgressBarInfo = ProgressBarInfo {}
- data ProgressBarAttachment = ProgressBarAttachment {}
- data ProgressBar = ProgressBar {}
- data SlackFormatterShowCallStacks
- type ChannelName = Text
Documentation
postMessage :: (MonadError Text m, MonadIO m) => SlackConfig -> ChannelName -> Text -> [Value] -> Maybe [Value] -> m Value Source #
updateMessage :: (MonadError Text m, MonadIO m) => SlackConfig -> ChannelName -> Text -> Text -> [Value] -> Maybe [Value] -> m () Source #
makeSlackCall :: (MonadError Text m, MonadIO m) => SlackConfig -> String -> Value -> m Value Source #
(??) :: MonadError e m => Maybe a -> e -> m a infixl 7 Source #
toMarkdown :: FailureReason -> Text Source #
showCallStack :: CallStack -> Text Source #
createProgressBar :: SlackConfig -> ChannelName -> Maybe Int64 -> 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 -> Maybe Int64 -> ProgressBar -> ProgressBarInfo -> IO (Either Text ()) Source #
Update an existing progress bar.
Internal
getMessage :: ProgressBarInfo -> Text Source #
getAttachments :: ProgressBarInfo -> [Value] Source #
truncateBlocksIfNecessary :: Maybe Int64 -> [Value] -> [Value] Source #
This is kind of wasteful, because it requires encoding every block to get the lengths. It's also a little rough because it won't exactly match the length of the encoded blocks list (with brackets etc.) and doesn't take into account the rest of the message. Hopefully it's close enough to correct, but TODO find a way to do the truncating efficiently as part of encoding the message onto the wire.
newtype SlackConfig Source #
Configuration options needed to connect to the Slack API
SlackConfig | |
|
Instances
Show SlackConfig Source # | |
Defined in Test.Sandwich.Formatters.Slack.Internal.Types showsPrec :: Int -> SlackConfig -> ShowS # show :: SlackConfig -> String # showList :: [SlackConfig] -> ShowS # |
data ProgressBarInfo Source #
The state of a progress bar message.
ProgressBarInfo | |
|
data ProgressBarAttachment Source #
A Slack attachment.
ProgressBarAttachment | |
|
Instances
data ProgressBar Source #
An opaque type representing an existing Slack message.
data SlackFormatterShowCallStacks Source #
SlackFormatterNoCallStacks | Don't include callstacks in failure messages |
SlackFormatterTopNCallStackFrames Int | Include the top N stack frames |
SlackFormatterFullCallStack | Include the full callstack |
type ChannelName = Text Source #