cached-json-file-0.1.0: Locally cache a json file obtained by http
Safe HaskellNone
LanguageHaskell2010

System.Cached.JSON

Synopsis

Documentation

getCachedJSON Source #

Arguments

:: (FromJSON a, ToJSON a) 
=> String

program name

-> FilePath

filename

-> String

json url

-> NominalDiffTime

cache duration (minutes)

-> IO a 

If the local cached json file is new enough then use it, otherwise refresh from the remote url.

getCachedJSONQuery Source #

Arguments

:: (FromJSON a, ToJSON a) 
=> String

program name

-> FilePath

filename

-> IO a

http query

-> NominalDiffTime

cache duration (minutes)

-> IO a 

Similar to getCachedJSON but takes an IO procedure that fetches the remote json data.

lookupKey :: FromJSON a => Text -> Object -> Maybe a #

Look up key in object