Liking cljdoc? Tell your friends :D

puppetlabs.puppetdb.utils


add-tar-entryclj

(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
sourceraw docstring

assoc-if-existsclj

(assoc-if-exists m & ks)

Assoc only if the key is already present

Assoc only if the key is already present
sourceraw docstring

assoc-whencljmacro

(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.
sourceraw docstring

await-ref-stateclj

(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.
sourceraw docstring

await-scheduler-shutdownclj

(await-scheduler-shutdown s wait-time)
source

base-url->strclj

(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.
sourceraw docstring

base-url->str-no-pathclj

(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.
sourceraw docstring

base-url->str-with-prefixclj

(base-url->str-with-prefix {:keys [protocol host port prefix] :as _base-url})
source

base-url-schemaclj

source

byte-array-classclj

source

call-unless-shutting-downclj

(call-unless-shutting-down what shutting-down? shutdown-context f)
source

cmd-params->json-strclj

(cmd-params->json-str {:strs [command version certname payload]})
source

cmd-url-paramsclj

(cmd-url-params {:keys [command version certname producer-timestamp timeout]})
source

collapse-seqclj

(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.
sourceraw docstring

compression-file-extension-schemaclj

source

content-encoding->file-extensionclj

(content-encoding->file-extension encoding)
source

content-encodings->file-extensionsclj

source

describe-bad-base-urlclj

(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" ...}.
sourceraw docstring

digit?clj

(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
sourceraw docstring

env-config-for-db-ulongclj

(env-config-for-db-ulong name default)
source

exceptional-shutdown-requestorclj

(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.
sourceraw docstring

export-root-dirclj

source

flush-and-exitclj

(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).
sourceraw docstring

HasSocketChannelcljprotocol

get-socket-channelclj

(get-socket-channel this)

Returns the associated socket channel.

Returns the associated socket channel.
source

known-error?clj

(known-error? ex)
source

kwd->strclj

(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"
sourceraw docstring

leaf-error?clj

(leaf-error? ex)
source

match-any-ofclj

(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.
sourceraw docstring

metrics-base-urlclj

(metrics-base-url host port & [version])
source

nil-on-failurecljmacro

(nil-on-failure & body)

Executes body and if an exception is thrown, returns nil

Executes `body` and if an exception is thrown, returns nil
sourceraw docstring

noisy-futurecljmacro

(noisy-future & body)
source

optional-key?clj

(optional-key? x)
source

pdb-cmd-base-urlclj

(pdb-cmd-base-url host port & [version protocol])
source

(print-err & args)
source

println-errclj

(println-err & args)

Redirects output to standard error before invoking println

Redirects output to standard error before invoking println
sourceraw docstring

read-json-contentclj

(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.
sourceraw docstring

regex-quoteclj

(regex-quote s)
source

request-scheduler-shutdownclj

(request-scheduler-shutdown s interrupt-in-flight-tasks?)
source

response->channelclj

(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.
sourceraw docstring

scheduleclj

(schedule s f delay)
source

schedule-at-fixed-rateclj

(schedule-at-fixed-rate s f initial-delay period)
source

schedule-with-fixed-delayclj

(schedule-with-fixed-delay s f initial-delay delay)
source

schedulerclj

(scheduler core-threads)
source

str-schemaclj

(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.
sourceraw docstring

stringify-keysclj

(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.
sourceraw docstring

strip-nil-valuesclj

(strip-nil-values m)

remove all nil-valued keys from a map

remove all nil-valued keys from a map
sourceraw docstring

supported-content-encodingsclj

source

tar-itemclj

source

throw-if-shutdown-pendingclj

(throw-if-shutdown-pending shutdown-reason)
source

throw-sink-cli-errorclj

(throw-sink-cli-error msg)
source

time-limited-seqclj

(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.
sourceraw docstring

try-process-cliclj

(try-process-cli f)
(try-process-cli f
                 &
                 {:keys [preamble postamble] :or {preamble "" postamble ""}})
source

update-matching-keysclj

(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).
sourceraw docstring

update-whenclj

(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.
sourceraw docstring

utf8clj

source

utf8-bytesclj

(utf8-bytes s)
source

utf8-lengthclj

(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
sourceraw docstring

utf8-truncateclj

(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.
sourceraw docstring

validate-cli-base-url!clj

(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.
sourceraw docstring

vector-maybeclj

(vector-maybe v)

Vectorize an argument if it's not already vector

Vectorize an argument if it's not already vector
sourceraw docstring

with-captured-throwcljmacro

(with-captured-throw & body)
source

with-fatal-error-handlercljmacro

(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.
sourceraw docstring

with-log-mdccljmacro

(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.
sourceraw docstring

with-monitored-executioncljmacro

(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).
sourceraw docstring

with-noisy-failurecljmacro

(with-noisy-failure & body)
source

with-nonfatal-exceptions-suppressedcljmacro

(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.
sourceraw docstring

with-shutdown-request-on-fatal-errorcljmacro

(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 ...).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close