Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Test.Sandwich.Formatters.Slack.Internal
Contents
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
Constructors
SlackConfig | |
Fields
|
Instances
Show SlackConfig Source # | |
Defined in Test.Sandwich.Formatters.Slack.Internal.Types Methods showsPrec :: Int -> SlackConfig -> ShowS # show :: SlackConfig -> String # showList :: [SlackConfig] -> ShowS # |
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 Test.Sandwich.Formatters.Slack.Internal.Types Methods toJSON :: ProgressBarAttachment -> Value # toEncoding :: ProgressBarAttachment -> Encoding # toJSONList :: [ProgressBarAttachment] -> Value # toEncodingList :: [ProgressBarAttachment] -> Encoding # |
data ProgressBar Source #
An opaque type representing an existing Slack message.
Constructors
ProgressBar | |
Fields |
data SlackFormatterShowCallStacks Source #
Constructors
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 #