sandwich-slack-0.1.2.0: Sandwich integration with Slack
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Sandwich.Formatters.Slack.Internal

Contents

Synopsis

Documentation

encode' :: ToJSON a => a -> Text Source #

(??) :: MonadError e m => Maybe a -> e -> m a infixl 7 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

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

Instances details
Show SlackConfig Source # 
Instance details

Defined in Test.Sandwich.Formatters.Slack.Internal.Types

data ProgressBarInfo Source #

The state of a progress bar message.

Constructors

ProgressBarInfo 

Fields

data ProgressBar Source #

An opaque type representing an existing Slack message.

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