rollbar-hs-0.2.0.0: Core Rollbar data types and APIs.

Copyright(c) Hardy Jones 2017
LicenseBSD3
Maintainerjones3.hardy@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Rollbar.Item

Contents

Description

Provides a data type that subsumes most of what Rollbar expects for "item"s.

See Rollbar's Data Format for more details.

Synopsis

Data helpers

These functions are probably what you want to use most of the time.

They create a Data with lots of data prefilled. You can then override what you need with record updates.

debug :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers) #

Creates Data with the level set to Debug.

info :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers) #

Creates Data with the level set to Info.

warning :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers) #

Creates Data with the level set to Warning.

error :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers) #

Creates Data with the level set to Error.

critical :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers) #

Creates Data with the level set to Critical.

Item

data Item a headers #

The thing we actually give to Rollbar.

Constructors

Item 

Fields

Instances

Eq a => Eq (Item a headers) # 

Methods

(==) :: Item a headers -> Item a headers -> Bool #

(/=) :: Item a headers -> Item a headers -> Bool #

Show a => Show (Item a headers) # 

Methods

showsPrec :: Int -> Item a headers -> ShowS #

show :: Item a headers -> String #

showList :: [Item a headers] -> ShowS #

Generic (Item a headers) # 

Associated Types

type Rep (Item a headers) :: * -> * #

Methods

from :: Item a headers -> Rep (Item a headers) x #

to :: Rep (Item a headers) x -> Item a headers #

(RemoveHeaders headers, ToJSON a) => ToJSON (Item a headers) # 

Methods

toJSON :: Item a headers -> Value #

toEncoding :: Item a headers -> Encoding #

toJSONList :: [Item a headers] -> Value #

toEncodingList :: [Item a headers] -> Encoding #

FromJSON a => FromJSON (Item a headers) # 

Methods

parseJSON :: Value -> Parser (Item a headers) #

parseJSONList :: Value -> Parser [Item a headers] #

type Rep (Item a headers) # 
type Rep (Item a headers) = D1 * (MetaData "Item" "Rollbar.Item" "rollbar-hs-0.2.0.0-1GJRCoebUqpCQl5Q7GSHSi" False) (C1 * (MetaCons "Item" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "accessToken") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * AccessToken)) (S1 * (MetaSel (Just Symbol "itemData") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Data a headers)))))

Item data

data Data body headers #

The main payload of an item. Most of this is metadata.

N.B. While it's entirely possible for you to create one of these yourself, it's usually easier to use helpers like info and error.

Constructors

Data 

Fields

Instances

Eq body => Eq (Data body headers) # 

Methods

(==) :: Data body headers -> Data body headers -> Bool #

(/=) :: Data body headers -> Data body headers -> Bool #

Show body => Show (Data body headers) # 

Methods

showsPrec :: Int -> Data body headers -> ShowS #

show :: Data body headers -> String #

showList :: [Data body headers] -> ShowS #

Generic (Data body headers) # 

Associated Types

type Rep (Data body headers) :: * -> * #

Methods

from :: Data body headers -> Rep (Data body headers) x #

to :: Rep (Data body headers) x -> Data body headers #

(RemoveHeaders headers, ToJSON body) => ToJSON (Data body headers) # 

Methods

toJSON :: Data body headers -> Value #

toEncoding :: Data body headers -> Encoding #

toJSONList :: [Data body headers] -> Value #

toEncodingList :: [Data body headers] -> Encoding #

FromJSON body => FromJSON (Data body headers) # 

Methods

parseJSON :: Value -> Parser (Data body headers) #

parseJSONList :: Value -> Parser [Data body headers] #

type Rep (Data body headers) # 
type Rep (Data body headers) = D1 * (MetaData "Data" "Rollbar.Item.Data" "rollbar-hs-0.2.0.0-1GJRCoebUqpCQl5Q7GSHSi" False) (C1 * (MetaCons "Data" PrefixI True) ((:*:) * ((:*:) * ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "body") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Body body))) (S1 * (MetaSel (Just Symbol "codeVersion") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe CodeVersion)))) ((:*:) * (S1 * (MetaSel (Just Symbol "context") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe Context))) (S1 * (MetaSel (Just Symbol "custom") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe (HashMap Text Value)))))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "environment") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Environment)) (S1 * (MetaSel (Just Symbol "fingerprint") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe Fingerprint)))) ((:*:) * (S1 * (MetaSel (Just Symbol "framework") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe Framework))) (S1 * (MetaSel (Just Symbol "language") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Hardcoded "haskell")))))) ((:*:) * ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "level") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Level)) (S1 * (MetaSel (Just Symbol "notifier") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Notifier))) ((:*:) * (S1 * (MetaSel (Just Symbol "person") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe Person))) (S1 * (MetaSel (Just Symbol "platform") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Platform)))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "request") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe (Request headers)))) (S1 * (MetaSel (Just Symbol "server") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe Server)))) ((:*:) * (S1 * (MetaSel (Just Symbol "timestamp") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe UTCTime))) ((:*:) * (S1 * (MetaSel (Just Symbol "title") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe Title))) (S1 * (MetaSel (Just Symbol "uuid") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe UUID4)))))))))

newtype Context #

The place in the code where this item came from.

Constructors

Context Text 

newtype Framework #

The framework that is using this package. E.g. "scotty", "servant", "yesod"

Constructors

Framework Text 

newtype Title #

The title of the item.

Constructors

Title Text 

newtype UUID4 #

A unique identifier for each item.

Constructors

UUID4 UUID 

Instances

Eq UUID4 # 

Methods

(==) :: UUID4 -> UUID4 -> Bool #

(/=) :: UUID4 -> UUID4 -> Bool #

Show UUID4 # 

Methods

showsPrec :: Int -> UUID4 -> ShowS #

show :: UUID4 -> String #

showList :: [UUID4] -> ShowS #

Generic UUID4 # 

Associated Types

type Rep UUID4 :: * -> * #

Methods

from :: UUID4 -> Rep UUID4 x #

to :: Rep UUID4 x -> UUID4 #

ToJSON UUID4 # 
FromJSON UUID4 # 
type Rep UUID4 # 
type Rep UUID4 = D1 * (MetaData "UUID4" "Rollbar.Item.Data" "rollbar-hs-0.2.0.0-1GJRCoebUqpCQl5Q7GSHSi" True) (C1 * (MetaCons "UUID4" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * UUID)))

Required data

data Body arbitrary #

This is the actual data that you want to give to Rollbar. Most of the rest of Rollbar is metadata.

Constructors

Message

No stack trace, just a message and some arbitrary data.

Fields

Instances

Eq arbitrary => Eq (Body arbitrary) # 

Methods

(==) :: Body arbitrary -> Body arbitrary -> Bool #

(/=) :: Body arbitrary -> Body arbitrary -> Bool #

Show arbitrary => Show (Body arbitrary) # 

Methods

showsPrec :: Int -> Body arbitrary -> ShowS #

show :: Body arbitrary -> String #

showList :: [Body arbitrary] -> ShowS #

Generic (Body arbitrary) # 

Associated Types

type Rep (Body arbitrary) :: * -> * #

Methods

from :: Body arbitrary -> Rep (Body arbitrary) x #

to :: Rep (Body arbitrary) x -> Body arbitrary #

ToJSON arbitrary => ToJSON (Body arbitrary) # 

Methods

toJSON :: Body arbitrary -> Value #

toEncoding :: Body arbitrary -> Encoding #

toJSONList :: [Body arbitrary] -> Value #

toEncodingList :: [Body arbitrary] -> Encoding #

FromJSON arbitrary => FromJSON (Body arbitrary) # 

Methods

parseJSON :: Value -> Parser (Body arbitrary) #

parseJSONList :: Value -> Parser [Body arbitrary] #

type Rep (Body arbitrary) # 
type Rep (Body arbitrary) = D1 * (MetaData "Body" "Rollbar.Item.Body" "rollbar-hs-0.2.0.0-1GJRCoebUqpCQl5Q7GSHSi" False) (C1 * (MetaCons "Message" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "messageBody") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * MessageBody)) (S1 * (MetaSel (Just Symbol "messageData") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * arbitrary))))

newtype Environment #

Should be something meaningful to your program. E.g. "development", "production", "staging"

Constructors

Environment Text 

data Level #

Corresponds to the levels Rollbar allows in order of severity.

Constructors

Debug 
Info 
Warning 
Error 
Critical 

Instances

Bounded Level # 
Enum Level # 
Eq Level # 

Methods

(==) :: Level -> Level -> Bool #

(/=) :: Level -> Level -> Bool #

Ord Level # 

Methods

compare :: Level -> Level -> Ordering #

(<) :: Level -> Level -> Bool #

(<=) :: Level -> Level -> Bool #

(>) :: Level -> Level -> Bool #

(>=) :: Level -> Level -> Bool #

max :: Level -> Level -> Level #

min :: Level -> Level -> Level #

Show Level # 

Methods

showsPrec :: Int -> Level -> ShowS #

show :: Level -> String #

showList :: [Level] -> ShowS #

Generic Level # 

Associated Types

type Rep Level :: * -> * #

Methods

from :: Level -> Rep Level x #

to :: Rep Level x -> Level #

ToJSON Level # 
FromJSON Level # 
type Rep Level # 
type Rep Level = D1 * (MetaData "Level" "Rollbar.Item.Level" "rollbar-hs-0.2.0.0-1GJRCoebUqpCQl5Q7GSHSi" False) ((:+:) * ((:+:) * (C1 * (MetaCons "Debug" PrefixI False) (U1 *)) (C1 * (MetaCons "Info" PrefixI False) (U1 *))) ((:+:) * (C1 * (MetaCons "Warning" PrefixI False) (U1 *)) ((:+:) * (C1 * (MetaCons "Error" PrefixI False) (U1 *)) (C1 * (MetaCons "Critical" PrefixI False) (U1 *)))))

Optional data

data CodeVersion #

Rollbar supports different ways to say what version the code is.

Constructors

SemVer Text

Good ole SemVer. It's Text because who knows if you actually got it right...

Number Int

Plain integers.

SHA Text

Should be a Git SHA.

data Hardcoded (symbol :: Symbol) #

This is basically Proxy with the variable restricted to Symbol. It's mostly useful so a value can be insert into a JSON blob easily.

Constructors

Hardcoded 

Instances

Eq (Hardcoded symbol) # 

Methods

(==) :: Hardcoded symbol -> Hardcoded symbol -> Bool #

(/=) :: Hardcoded symbol -> Hardcoded symbol -> Bool #

Show (Hardcoded symbol) # 

Methods

showsPrec :: Int -> Hardcoded symbol -> ShowS #

show :: Hardcoded symbol -> String #

showList :: [Hardcoded symbol] -> ShowS #

Generic (Hardcoded symbol) # 

Associated Types

type Rep (Hardcoded symbol) :: * -> * #

Methods

from :: Hardcoded symbol -> Rep (Hardcoded symbol) x #

to :: Rep (Hardcoded symbol) x -> Hardcoded symbol #

KnownSymbol symbol => ToJSON (Hardcoded symbol) # 

Methods

toJSON :: Hardcoded symbol -> Value #

toEncoding :: Hardcoded symbol -> Encoding #

toJSONList :: [Hardcoded symbol] -> Value #

toEncodingList :: [Hardcoded symbol] -> Encoding #

KnownSymbol symbol => FromJSON (Hardcoded symbol) # 

Methods

parseJSON :: Value -> Parser (Hardcoded symbol) #

parseJSONList :: Value -> Parser [Hardcoded symbol] #

type Rep (Hardcoded symbol) # 
type Rep (Hardcoded symbol) = D1 * (MetaData "Hardcoded" "Rollbar.Item.Hardcoded" "rollbar-hs-0.2.0.0-1GJRCoebUqpCQl5Q7GSHSi" False) (C1 * (MetaCons "Hardcoded" PrefixI False) (U1 *))

newtype MissingHeaders (headers :: [Symbol]) #

The request headers with some missing

This is useful for removing sensitive information like the Authorization header.

Instances

Eq (MissingHeaders headers) # 

Methods

(==) :: MissingHeaders headers -> MissingHeaders headers -> Bool #

(/=) :: MissingHeaders headers -> MissingHeaders headers -> Bool #

Show (MissingHeaders headers) # 

Methods

showsPrec :: Int -> MissingHeaders headers -> ShowS #

show :: MissingHeaders headers -> String #

showList :: [MissingHeaders headers] -> ShowS #

RemoveHeaders headers => ToJSON (MissingHeaders headers) # 
FromJSON (MissingHeaders headers) # 

data Person #

The affected user.

The Email and Username associated with the latest Id will overwrite any previous.

Constructors

Person 

Instances

newtype Email #

The user's email.

Constructors

Email Text 

newtype Id #

The user's identifier. This uniquely identifies a Person to Rollbar.

Constructors

Id Text 

Instances

Eq Id # 

Methods

(==) :: Id -> Id -> Bool #

(/=) :: Id -> Id -> Bool #

Show Id # 

Methods

showsPrec :: Int -> Id -> ShowS #

show :: Id -> String #

showList :: [Id] -> ShowS #

IsString Id # 

Methods

fromString :: String -> Id #

ToJSON Id # 
FromJSON Id # 

newtype Get #

The query string parameters as a more useful data structure.

Constructors

Get Query 

Instances

Eq Get # 

Methods

(==) :: Get -> Get -> Bool #

(/=) :: Get -> Get -> Bool #

Show Get # 

Methods

showsPrec :: Int -> Get -> ShowS #

show :: Get -> String #

showList :: [Get] -> ShowS #

Generic Get # 

Associated Types

type Rep Get :: * -> * #

Methods

from :: Get -> Rep Get x #

to :: Rep Get x -> Get #

ToJSON Get # 
FromJSON Get # 
type Rep Get # 
type Rep Get = D1 * (MetaData "Get" "Rollbar.Item.Request" "rollbar-hs-0.2.0.0-1GJRCoebUqpCQl5Q7GSHSi" True) (C1 * (MetaCons "Get" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Query)))

newtype IP #

The IP address of the client.

Constructors

IP SockAddr 

Instances

Eq IP # 

Methods

(==) :: IP -> IP -> Bool #

(/=) :: IP -> IP -> Bool #

Show IP # 

Methods

showsPrec :: Int -> IP -> ShowS #

show :: IP -> String #

showList :: [IP] -> ShowS #

Generic IP # 

Associated Types

type Rep IP :: * -> * #

Methods

from :: IP -> Rep IP x #

to :: Rep IP x -> IP #

ToJSON IP # 
FromJSON IP # 
type Rep IP # 
type Rep IP = D1 * (MetaData "IP" "Rollbar.Item.Request" "rollbar-hs-0.2.0.0-1GJRCoebUqpCQl5Q7GSHSi" True) (C1 * (MetaCons "IP" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * SockAddr)))

newtype Method #

The HTTP Verb

Constructors

Method ByteString 

Instances

Eq Method # 

Methods

(==) :: Method -> Method -> Bool #

(/=) :: Method -> Method -> Bool #

Show Method # 
Generic Method # 

Associated Types

type Rep Method :: * -> * #

Methods

from :: Method -> Rep Method x #

to :: Rep Method x -> Method #

ToJSON Method # 
FromJSON Method # 
type Rep Method # 
type Rep Method = D1 * (MetaData "Method" "Rollbar.Item.Request" "rollbar-hs-0.2.0.0-1GJRCoebUqpCQl5Q7GSHSi" True) (C1 * (MetaCons "Method" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ByteString)))

newtype MissingHeaders (headers :: [Symbol]) #

The request headers with some missing

This is useful for removing sensitive information like the Authorization header.

Instances

Eq (MissingHeaders headers) # 

Methods

(==) :: MissingHeaders headers -> MissingHeaders headers -> Bool #

(/=) :: MissingHeaders headers -> MissingHeaders headers -> Bool #

Show (MissingHeaders headers) # 

Methods

showsPrec :: Int -> MissingHeaders headers -> ShowS #

show :: MissingHeaders headers -> String #

showList :: [MissingHeaders headers] -> ShowS #

RemoveHeaders headers => ToJSON (MissingHeaders headers) # 
FromJSON (MissingHeaders headers) # 

newtype RawBody #

The raw request body as a ByteString.

Constructors

RawBody ByteString 

Instances

Eq RawBody # 

Methods

(==) :: RawBody -> RawBody -> Bool #

(/=) :: RawBody -> RawBody -> Bool #

Show RawBody # 
IsString RawBody # 

Methods

fromString :: String -> RawBody #

Generic RawBody # 

Associated Types

type Rep RawBody :: * -> * #

Methods

from :: RawBody -> Rep RawBody x #

to :: Rep RawBody x -> RawBody #

ToJSON RawBody # 
FromJSON RawBody # 
type Rep RawBody # 
type Rep RawBody = D1 * (MetaData "RawBody" "Rollbar.Item.Request" "rollbar-hs-0.2.0.0-1GJRCoebUqpCQl5Q7GSHSi" True) (C1 * (MetaCons "RawBody" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ByteString)))

newtype URL #

The URL as a slightly more useful structure.

Constructors

URL (Maybe ByteString, [Text]) 

Instances

Eq URL # 

Methods

(==) :: URL -> URL -> Bool #

(/=) :: URL -> URL -> Bool #

Show URL # 

Methods

showsPrec :: Int -> URL -> ShowS #

show :: URL -> String #

showList :: [URL] -> ShowS #

Generic URL # 

Associated Types

type Rep URL :: * -> * #

Methods

from :: URL -> Rep URL x #

to :: Rep URL x -> URL #

ToJSON URL # 
FromJSON URL # 
type Rep URL # 
type Rep URL = D1 * (MetaData "URL" "Rollbar.Item.Request" "rollbar-hs-0.2.0.0-1GJRCoebUqpCQl5Q7GSHSi" True) (C1 * (MetaCons "URL" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe ByteString, [Text]))))

data Server #

Information about the server using this package.

Constructors

Server 

Fields

newtype Branch #

The git branch the server is running on.

Constructors

Branch Text 

newtype Root #

The root directory.

Constructors

Root Text