Liking cljdoc? Tell your friends :D

com.eldrix.trud.core


downloadclj

(download {:keys [api-key cache-dir items] :as opts})
source

download-releaseclj

(download-release dir release)
(download-release dir release config)

Get an archive file either from the cache or downloaded from TRUD. In most circumstances, using get-latest is more appropriate. Parameters:

  • cache-dir : cache directory
  • release : release information from TRUD, as returned by get-releases.
  • config : configuration, including: |- :progress - boolean, to print download progress or not Returns result as a java.nio.file.Path
Get an archive file either from the cache or downloaded from TRUD.
In most circumstances, using `get-latest` is more appropriate.
Parameters:
- cache-dir : cache directory
- release   : release information from TRUD, as returned by `get-releases`.
- config    : configuration, including:
              |- :progress  - boolean, to print download progress or not
Returns result as a `java.nio.file.Path`
sourceraw docstring

get-latestclj

(get-latest config item-identifier)
(get-latest {:keys [api-key cache-dir progress]} item-identifier existing-date)

Returns the latest release of the specified item, if existing is outdated. Currently only uses release date and does not use archive timestamp.

Parameters:

  • config : a configuration map containing: - api-key : your NHS Digital TRUD api key - cache-dir : where to download and cache distributions - progress : whether to print progress or not
  • item-identifier : the TRUD API item identifier you want.
  • existing-date : (optional) existing date of this item you have

Result is the data from the source TRUD API with except that dates are parsed into java LocalDates to simplify sorting and comparison and the following keys are added:

  • :needsUpdate? : indicates if your current version (existing-date) is outdated.
  • :archiveFile : a java.io.File to the downloaded distribution, if an update is required
  • :archiveFilePath : a java.nio.files.Path to the downloaded distribution, if an update is required.
Returns the latest release of the specified item, if existing is outdated.
Currently only uses release date and does not use archive timestamp.

Parameters:
- config : a configuration map containing:
           - api-key        : your NHS Digital TRUD api key
           - cache-dir      : where to download and cache distributions
           - progress       : whether to print progress or not
- item-identifier : the TRUD API item identifier you want.
- existing-date   : (optional) existing date of this item you have

Result is the data from the source [TRUD API](https://isd.digital.nhs.uk/trud3/user/guest/group/0/api)
with except that dates are parsed into java LocalDates to simplify sorting and
comparison and the following keys are added:

- :needsUpdate?     : indicates if your current version (`existing-date`) is
                      outdated.
- :archiveFile      : a `java.io.File` to the downloaded distribution, if an
                      update is required
- :archiveFilePath  : a `java.nio.files.Path` to the downloaded
                      distribution, if an update is required.
sourceraw docstring

get-releasesclj

(get-releases api-key item-identifier)

Returns a sequence of structured metadata about each release of the distribution files. Data are returned as-is from the source API, except that dates are parsed and the item-identifier is included using the key 'itemIdentifier'.

Returns a sequence of structured metadata about each release of the
distribution files. Data are returned as-is from the source API, except that
dates are parsed and the item-identifier is included using the key
'itemIdentifier'.
sourceraw docstring

unzipclj

Unzip a zip archive to the directory specified. Parameters:

  • in : path of zip file
  • out : path of the directory to which files will be extracted.

If no out path is specified, a temporary directory will be created. The out directory will be created if it doesn't exist.

Unzip a zip archive to the directory specified.
Parameters:
- in  : path of zip file
- out : path of the directory to which files will be extracted.

If no `out` path is specified, a temporary directory will be created.
The out directory will be created if it doesn't exist.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close