Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data SourceType
- data LeapSource = LeapSource {
- sourceType :: SourceType
- source :: String
- type LeapSources = [LeapSource]
- parseLeapSource :: String -> Maybe LeapSource
- mayRetrieveList :: LeapSource -> IO (Maybe LeapSecondList)
- parseFileMaybe :: Day -> String -> Maybe LeapSecondList
- leapSources :: LeapSources
- sourceLeapData :: LeapSources -> IO LeapSecondList
Documentation
data SourceType Source #
A support type for deperating out the protocol over which to retrieve data.
data LeapSource Source #
A leap second list location tagged with a protocol for retrieving it.
type LeapSources = [LeapSource] Source #
LeapSources is a list of strings, specifying URIs the program can potentially access up-to-date leap-second.lists from. Each source begins with a protocol: For local sources "file://" followed by a path to the local file. For remote source sources "https://" prefixed URIs.
parseLeapSource :: String -> Maybe LeapSource Source #
Convert a string source to a LeapSource
mayRetrieveList :: LeapSource -> IO (Maybe LeapSecondList) Source #
Given a LeapSource, perform the actual aquasition and parsing
parseFileMaybe :: Day -> String -> Maybe LeapSecondList Source #
Parse a leap second list file, failing if it is expired.
leapSources :: LeapSources Source #
A few places we should be able to download up-to-date leap-seconds.list data.
sourceLeapData :: LeapSources -> IO LeapSecondList Source #
Aquire leap-seconds files and parse them, Trying the provided list of sources in order from local, to secure remote (HTTPS), until an up-to-date source is aquired or all options are exausted.
Currently only local and HTTPS has been implimented.