Liking cljdoc? Tell your friends :D

com.eldrix.trud.impl.cache

Provides a simple caching mechanism for TRUD files.

This is deliberately not a generic download manager. It provides only a lightweight and synchronous cache for downloads.

Provides a simple caching mechanism for TRUD files.

This is deliberately not a generic download manager. It provides only
a lightweight and synchronous cache for downloads.
raw docstring

download-urlclj

(download-url url target)

Download a file from the URL to the target path. Parameters:

  • url : a string representation of a URL.
  • target : target (outputstream, writer or file).
Download a file from the URL to the target path.
Parameters:
 - url     : a string representation of a URL.
 - target  : target (outputstream, writer or file).
sourceraw docstring

get-archive-filecljdeprecated

(get-archive-file dir release)

Get an archive file either from the cache or downloaded from TRUD. Returns result as a java.nio.file.Path.

Get an archive file either from the cache or downloaded from TRUD.
Returns result as a `java.nio.file.Path`.
sourceraw docstring

get-release-fileclj

(get-release-file dir release)
(get-release-file
  dir
  {url :archiveFileUrl file-size :archiveFileSizeBytes :as release}
  {:keys [progress]})

Get an archive file either from the cache or downloaded from TRUD.

Get an archive file either from the cache or downloaded from TRUD.
sourceraw docstring

make-cacheclj

(make-cache dir)
(make-cache dir {:keys [progress download-fn] :or {download-fn download-url}})

Create a simple cache in the directory specified. Returns a function that can be used to download from a URL to a filename, that will use the directory as a cache. An optional validate function can be provided to check file size or checksum, for example. If progress is truthy, then progress will be printed. The resulting function will take a job (a map of :url :filename :file-size and :validate) and return a map of :cached and :f.

Create a simple cache in the directory specified.
Returns a function that can be used to download from a URL to a filename, that
will use the directory as a cache. An optional `validate` function can be
provided to check file size or checksum, for example. If `progress` is
truthy, then progress will be printed.
The resulting function will take a job (a map of :url :filename :file-size and
:validate) and return a map of :cached and :f.
sourceraw docstring

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

× close