(add-tar-entry tar-writer {:keys [file-suffix contents]})Inputs: [tar-writer {:keys [file-suffix contents]} :- tar-item]
Writes the given tar-item to tar-writer using
export-root-directory as the base directory for contents
Inputs: [tar-writer {:keys [file-suffix contents]} :- tar-item]
Writes the given `tar-item` to `tar-writer` using
export-root-directory as the base directory for contents(assoc-if-exists m & ks)Assoc only if the key is already present
Assoc only if the key is already present
(assoc-when map key val & kvs)Assocs the provided values with the corresponding keys if and only if the key is not already present in map.
Assocs the provided values with the corresponding keys if and only if the key is not already present in map.
(await-ref-state ref pred)(await-ref-state ref pred timeout-ms timeout-val)Waits until (pred @ref) is true and returns val, unless that takes longer than timeout-ms, in which case, returns timeout-val.
Waits until (pred @ref) is true and returns val, unless that takes longer than timeout-ms, in which case, returns timeout-val.
(base-url->str {:keys [protocol host port prefix version] :as _base-url})Inputs: [{:keys [protocol host port prefix version], :as _base-url} :- base-url-schema] Returns: s/Str
Converts the `base-url' map to an ASCII URL. May throw MalformedURLException or URISyntaxException.
Inputs: [{:keys [protocol host port prefix version], :as _base-url} :- base-url-schema]
Returns: s/Str
Converts the `base-url' map to an ASCII URL. May throw
MalformedURLException or URISyntaxException.(base-url->str-no-path {:keys [protocol host port] :as _base-url})Inputs: [{:keys [protocol host port], :as _base-url} :- base-url-schema] Returns: s/Str
Converts the `base-url' map to an ASCII URL minus the path element. This can be used to build a full URL when you have an absolute path.
Inputs: [{:keys [protocol host port], :as _base-url} :- base-url-schema]
Returns: s/Str
Converts the `base-url' map to an ASCII URL minus the path element. This can
be used to build a full URL when you have an absolute path.(base-url->str-with-prefix {:keys [protocol host port prefix] :as _base-url})(call-unless-shutting-down what shutting-down? shutdown-context f)(cmd-url-params {:keys [command version certname producer-timestamp timeout]})(collapse-seq split-pred collapse-fn rows)Lazily consumes and collapses the seq rows. Uses split-pred to chunk the seq,
passes in each chunk to collapse-fn. Each result of collapse-fn is an item in
the return lazy-seq.
Lazily consumes and collapses the seq `rows`. Uses `split-pred` to chunk the seq, passes in each chunk to `collapse-fn`. Each result of `collapse-fn` is an item in the return lazy-seq.
(describe-bad-base-url base-url)If a problem is detected with base-url, returns a string
describing the issue. For example {:host "x:y" ...}.
If a problem is detected with `base-url`, returns a string
describing the issue. For example {:host "x:y" ...}.(digit? c)Inputs: [c :- Character] Returns: s/Bool
Return true if the character is a digit
Inputs: [c :- Character] Returns: s/Bool Return true if the character is a digit
(exceptional-shutdown-requestor request-shutdown messages status)Returns a function that when called with one Throwable argument, calls request-shutdown (as defined by Trapperkeeper) to request a shutdown with the given messages and status.
Returns a function that when called with one Throwable argument, calls request-shutdown (as defined by Trapperkeeper) to request a shutdown with the given messages and status.
(flush-and-exit status)Attempts to flush out and err, reporting any failures to err, if possible, and then invokes (System/exit status).
Attempts to flush *out* and *err*, reporting any failures to *err*, if possible, and then invokes (System/exit status).
(get-socket-channel this)Returns the associated socket channel.
Returns the associated socket channel.
(kwd->str kwd)Inputs: [kwd :- s/Keyword]
Convert a keyword to a string. This is different from name in
that it will preserve the entire keyword, i.e. :foo/bar ->
"foo/bar", where name would be just "bar"
Inputs: [kwd :- s/Keyword] Convert a keyword to a string. This is different from `name` in that it will preserve the entire keyword, i.e. :foo/bar -> "foo/bar", where name would be just "bar"
(match-any-of strings)Given a collection of strings and characters, construct a regex string suitable for passing to re-pattern that consists of a capturing group which matches any member of the collection.
Given a collection of strings and characters, construct a regex string suitable for passing to re-pattern that consists of a capturing group which matches any member of the collection.
(nil-on-failure & body)Executes body and if an exception is thrown, returns nil
Executes `body` and if an exception is thrown, returns nil
(println-err & args)Redirects output to standard error before invoking println
Redirects output to standard error before invoking println
(read-json-content reader)(read-json-content reader keywordize-keys?)Utility function for our cli tools. For reading json content from a tar-reader.
Utility function for our cli tools. For reading json content from a tar-reader.
(response->channel response)Returns the socket channel (i.e. something that can be registered with a Selector) associated with a jetty response object.
Returns the socket channel (i.e. something that can be registered with a Selector) associated with a jetty response object.
(str-schema kwd-schema)Function for converting a schema with keyword keys to to one with string keys. Doesn't walk the map so nested schema won't work.
Function for converting a schema with keyword keys to to one with string keys. Doesn't walk the map so nested schema won't work.
(stringify-keys m)Recursively transforms all map keys from keywords to strings. This improves on clojure.walk/stringify-keys by supporting the conversion of hyphenated keywords to strings instead of trying to resolve them in a namespace first.
Recursively transforms all map keys from keywords to strings. This improves on clojure.walk/stringify-keys by supporting the conversion of hyphenated keywords to strings instead of trying to resolve them in a namespace first.
(strip-nil-values m)remove all nil-valued keys from a map
remove all nil-valued keys from a map
(time-limited-seq coll deadline-ns on-timeout)Returns a new sequence of the items in coll that will call on-timeout (which must return something seq-ish if it doesn't throw) if the timeout is reached while consuming the collection. Does nothing given an ##Inf timeout. The timeout is with respect to the ephemeral-now-ns timeline.
Returns a new sequence of the items in coll that will call on-timeout (which must return something seq-ish if it doesn't throw) if the timeout is reached while consuming the collection. Does nothing given an ##Inf timeout. The timeout is with respect to the ephemeral-now-ns timeline.
(try-process-cli f)(try-process-cli f
&
{:keys [preamble postamble] :or {preamble "" postamble ""}})(update-matching-keys m pred f & _)Returns the map resulting from an (update m k f & args) for every key k in m satisfying (pred k).
Returns the map resulting from an (update m k f & args) for every key k in m satisfying (pred k).
(update-when m ks f & args)Acts as update-in if ks refers to a value, otherwise returns m.
Acts as update-in if ks refers to a value, otherwise returns m.
(utf8-length s)Return the length in bytes of the given string when encoded in UTF-8
Return the length in bytes of the given string when encoded in UTF-8
(utf8-truncate s max-bytes)Truncate the given string such that its UTF-8 representation is at most
max-bytes long. Note that the returned string may be empty.
Truncate the given string such that its UTF-8 representation is at most `max-bytes` long. Note that the returned string may be empty.
(validate-cli-base-url! {:keys [base-url] :as options})Validates the base-url and throws an exception appropriate for kitchensink/cli! on error.
Validates the base-url and throws an exception appropriate for kitchensink/cli! on error.
(vector-maybe v)Vectorize an argument if it's not already vector
Vectorize an argument if it's not already vector
(with-fatal-error-handler handle & body)Calls (handler ex) instead of throwing if the body throws a fatal error, which is any Throwable other than Exception, AssertionError, or ThreadDeath.
Calls (handler ex) instead of throwing if the body throws a fatal error, which is any Throwable other than Exception, AssertionError, or ThreadDeath.
(with-log-mdc alternating-kvs & body)Establishes the MDC contexts given by the alternating-kvs key value pairs during the execution of the body, and ensures that the original values (if any) are always restored before returning. The keys associated with any nil values will be removed via MDC/remove.
Establishes the MDC contexts given by the alternating-kvs key value pairs during the execution of the body, and ensures that the original values (if any) are always restored before returning. The keys associated with any nil values will be removed via MDC/remove.
(with-monitored-execution initiate-shutdown & body)Executes body while logging any exceptions and printing them to err. Calls (initiate-shutdown ex) as a side effect for any fatal errors (see with-shutdown-request-on-fatal-error).
Executes body while logging any exceptions and printing them to *err*. Calls (initiate-shutdown ex) as a side effect for any fatal errors (see with-shutdown-request-on-fatal-error).
(with-nonfatal-exceptions-suppressed & body)Suppresses all Throwables that are not Errors, and suppresses one type of Error: AssertionError.
Suppresses all Throwables that are not Errors, and suppresses one type of Error: AssertionError.
(with-shutdown-request-on-fatal-error initiate-shutdown & body)Calls (initiate-shutdown ex) as a side effect if the body throws a fatal error (see with-fatal-error-handler). Any exceptions thrown by initiate-shutdown will be suppressed by (.addSuppressed ex ...).
Calls (initiate-shutdown ex) as a side effect if the body throws a fatal error (see with-fatal-error-handler). Any exceptions thrown by initiate-shutdown will be suppressed by (.addSuppressed ex ...).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |