Safe Haskell | None |
---|---|
Language | Haskell2010 |
Network.ScrapeChanges.Domain
- type CronScheduleString = String
- type Url = String
- type HttpBody = ByteString
- type Scraper = HttpBody -> Text
- type Text = Text
- data MailAddr = MailAddr {}
- mailAddrName :: Lens' MailAddr (Maybe Text)
- mailAddr :: Lens' MailAddr String
- data Mail = Mail {}
- mailTo :: Lens' Mail (NonEmpty MailAddr)
- mailSubject :: Lens' Mail Text
- mailFrom :: Lens' Mail MailAddr
- mailBody :: Lens' Mail Text
- data CallbackConfig
- = MailConfig Mail
- | OtherConfig (Text -> IO ())
- _OtherConfig :: Prism' CallbackConfig (Text -> IO ())
- _MailConfig :: Prism' CallbackConfig Mail
- data ScrapeConfig = ScrapeConfig {}
- scrapeInfoUrl :: Lens' ScrapeConfig String
- scrapeInfoCallbackConfig :: Lens' ScrapeConfig CallbackConfig
- data ScrapeResult
- data ScrapeSchedule = ScrapeSchedule {}
- scrapeScheduleScraper :: Lens' ScrapeSchedule Scraper
- scrapeScheduleCron :: Lens' ScrapeSchedule CronScheduleString
- scrapeScheduleConfig :: Lens' ScrapeSchedule ScrapeConfig
- data ValidationError
- type ScrapeValidation t = AccValidation [ValidationError] t
Documentation
type CronScheduleString = String Source #
String encoded in the standard cron format
type HttpBody = ByteString Source #
Body of the HTTP request
Mail address for provided MailConfig
Constructors
MailAddr | |
Constructors
data CallbackConfig Source #
Constructors
MailConfig Mail | Send a mail when there's changed data at your scrape target. This needs sendmail to be configured correctly on the host your program runs. |
OtherConfig (Text -> IO ()) | Just execute the provided function when there's changed data at your scrape target. |
Instances
_OtherConfig :: Prism' CallbackConfig (Text -> IO ()) Source #
data ScrapeConfig Source #
Constructors
ScrapeConfig | |
Fields
|
Instances
data ScrapeResult Source #
Constructors
CallbackCalled | Signals that the last execution of the provided |
CallbackNotCalled | Signals that the last execution of the provided |
Instances
data ScrapeSchedule Source #
Constructors
ScrapeSchedule | |
data ValidationError Source #
Constructors
UrlNotAbsolute | |
UrlProtocolInvalid | |
MailConfigInvalidMailFromAddr String | |
MailConfigInvalidMailToAddr String | |
CronScheduleInvalid String |
Instances
type ScrapeValidation t = AccValidation [ValidationError] t Source #