Liking cljdoc? Tell your friends :D

urlocal.impl.cache

This namespace is not part of the public API of urlocal and may change without notice.

This namespace is not part of the public API of urlocal and may change
without notice.
raw docstring

base64-encodeclj

(base64-encode x)

Returns a BASE64 encoded representation (a String) of the UTF-8 String representation of x, or nil if x is nil

Returns a BASE64 encoded representation (a String) of the UTF-8 String
representation of x, or nil if x is nil
sourceraw docstring

cache-check-interval-secs-aclj

source

cache-dir-aclj

source

cache-hit!clj

(cache-hit! url metadata-file metadata)

Handles a cache hit, by updating the :last-checked-at metadata.

Throws on IO errors.

Handles a cache hit, by updating the :last-checked-at metadata.

Throws on IO errors.
sourceraw docstring

cache-key->cache-fileclj

(cache-key->cache-file cache-key)
(cache-key->cache-file cache-key extension)

Returns a File for the given cache-key (a String), optionally with the given extension. Return nil if cache-key is blank.

Returns a File for the given cache-key (a String), optionally with the given
extension.  Return nil if cache-key is blank.
sourceraw docstring

cache-miss!clj

(cache-miss! url opts)
(cache-miss! url
             already-redirected?
             {:keys [follow-redirects?] :or {follow-redirects? false} :as opts})

Handles a cache miss, by downloading the content for the given url and caching it locally, and also capturing metadata from the response for the purposes of cache management.

Throws on IO errors or unexpected HTTP status code responses.

Handles a cache miss, by downloading the content for the given url and
caching it locally, and also capturing metadata from the response for the
purposes of cache management.

Throws on IO errors or unexpected HTTP status code responses.
sourceraw docstring

check-cache!clj

(check-cache! url {:keys [request-headers] :as opts})

Handles a potential cache hit, by determining whether the cached content needs to be checked for staleness via an ETag request, or whether it can simply be served directly.

Throws on IO errors or unexpected HTTP status code responses.

Handles a potential cache hit, by determining whether the cached content
needs to be checked for staleness via an ETag request, or whether it can
simply be served directly.

Throws on IO errors or unexpected HTTP status code responses.
sourceraw docstring

http-getclj

(http-get url)
(http-get url
          {:keys [connect-timeout read-timeout follow-redirects?
                  request-headers]
           :or {connect-timeout 1000
                read-timeout 1000
                follow-redirects? false
                request-headers {"User-Agent" "com.github.pmonks/urlocal"}}})

Perform an HTTP get request for the given URL, using the given options, returning an HTTPUrlConnection object.

Throws on IO errors.

Perform an HTTP get request for the given URL, using the given options,
returning an HTTPUrlConnection object.

Throws on IO errors.
sourceraw docstring

prep-cache!clj

(prep-cache! url opts)

Ensures the cache is populated for the given url.

Ensures the cache is populated for the given url.
sourceraw docstring

remove-cache-entry!clj

(remove-cache-entry! url)

Removes the cache entry for a single URL, if it exists. Returns nil.

Throws on IO errors.

Removes the cache entry for a single URL, if it exists. Returns nil.

Throws on IO errors.
sourceraw docstring

seconds-sincecljmultimethod

(seconds-since inst)

Returns how many seconds have passed since inst (a Date or Temporal), or Long/MAX_VALUE if inst is nil.

Returns how many seconds have passed since inst (a Date or Temporal), or
Long/MAX_VALUE if inst is nil.
sourceraw docstring

url->content-fileclj

(url->content-file url)

Returns a content file for the given url, or nil if the url is nil.

Returns a content file for the given url, or nil if the url is nil.
sourceraw docstring

url->metadata-fileclj

(url->metadata-file url)

Returns a metadata file for the given url, or nil if the url is nil.

Returns a metadata file for the given url, or nil if the url is nil.
sourceraw docstring

write-metadata!clj

(write-metadata! url conn)

Writes out a metadata file for the given url, using the open connection for that url.

Note: does nothing if the connection did not return an ETag - this ensures that future requests to the same URL will always be treated as a cache miss.

Writes out a metadata file for the given url, using the open connection for
that url.

Note: does nothing if the connection did not return an ETag - this ensures
that future requests to the same URL will always be treated as a cache miss.
sourceraw docstring

write-metadata-file!clj

(write-metadata-file! f m)

Writes the metadata m to the file f, overwriting it if it already exists.

Writes the metadata m to the file f, overwriting it if it already exists.
sourceraw docstring

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

× close