Utilities used across pallet.
Utilities used across pallet.
(as-string arg)
Return the string value of the argument.
Return the string value of the argument.
(base64-md5 unsafe-id)
Computes the base64 encoding of the md5 of a string
Computes the base64 encoding of the md5 of a string
(classpath)
Return the classpath File's for the current clojure classloader.
Return the classpath File's for the current clojure classloader.
(classpath-jarfiles)
Returns a sequence of JarFile objects for the JAR files on classpath.
Returns a sequence of JarFile objects for the JAR files on classpath.
(classpath-urls)
Return the classpath URL's for the current clojure classloader.
Return the classpath URL's for the current clojure classloader.
(compare-and-swap! a f & args)
Compare and swap, returning old and new values
Compare and swap, returning old and new values
(compiler-exception exception)
Create a compiler exception that wraps a cause and includes source location.
Create a compiler exception that wraps a cause and includes source location.
(count-by key-fn s)
Take a sequence and a key function, and returns a map with the count of each key.
Take a sequence and a key function, and returns a map with the count of each key.
(count-values s)
Take a sequence, and returns a map with the count of each value.
Take a sequence, and returns a map with the count of each value.
(dissoc-if-empty m key)
Like clojure.core/dissoc, except it only dissoc's if the value at the keyword is nil.
Like clojure.core/dissoc, except it only dissoc's if the value at the keyword is nil.
(dissoc-keys m keys)
Like clojure.core/dissoc, except it takes a vector of keys to remove
Like clojure.core/dissoc, except it takes a vector of keys to remove
(file-for-url url)
Convert a URL to a File.
Convert a URL to a File.
(find-var-with-require sym)
(find-var-with-require ns sym)
Find the var for the given namespace and symbol. If the namespace does not exist, then it will be required. (find-var-with-require 'my.ns 'a-symbol) (find-var-with-require 'my.ns/a-symbol)
If the namespace exists, but can not be loaded, and exception is thrown. If the namespace is loaded, but the symbol is not found, then nil is returned.
Find the var for the given namespace and symbol. If the namespace does not exist, then it will be required. (find-var-with-require 'my.ns 'a-symbol) (find-var-with-require 'my.ns/a-symbol) If the namespace exists, but can not be loaded, and exception is thrown. If the namespace is loaded, but the symbol is not found, then nil is returned.
(first-line s)
Return the first line of a string.
Return the first line of a string.
(forward-to-script-lib & symbols)
Forward a script to the new script lib
Forward a script to the new script lib
(jar-file? file)
Returns true if file is a normal file with a .jar or .JAR extension.
Returns true if file is a normal file with a .jar or .JAR extension.
(local-env)
Return clojure's local environment as a map of keyword value pairs.
Return clojure's local environment as a map of keyword value pairs.
(log-multiline level-kw fmt string)
Log a multiline string in multiple log lines
Log a multiline string in multiple log lines
(macro-compiler-exception exception)
Create a compiler exception that wraps a cause and includes source location.
Create a compiler exception that wraps a cause and includes source location.
(make-user username
&
{:keys [public-key-path private-key-path passphrase password
sudo-password no-sudo]
:as options})
Creates a User record with the given username and options. Generally used
in conjunction with admin-user and pallet.api/with-admin-user, or passed
to lift
or converge
as the named :user argument.
Options:
Creates a User record with the given username and options. Generally used in conjunction with *admin-user* and pallet.api/with-admin-user, or passed to `lift` or `converge` as the named :user argument. Options: - :public-key-path - :private-key-path - :passphrase - :password - :sudo-password (defaults to :password) - :no-sudo
(map-seq m)
Given an argument, returns the argument, or nil if passed an empty map.
Given an argument, returns the argument, or nil if passed an empty map.
(map-with-keys-as-symbols m)
Produce a map that is the same as m, but with all keys are converted to symbols.
Produce a map that is the same as m, but with all keys are converted to symbols.
(maybe-assoc m k v)
'Assoc a value in an associative structure, where k is a key and v is the value to assoc. The assoc only occurs if the value is non-nil.
'Assoc a value in an associative structure, where k is a key and v is the value to assoc. The assoc only occurs if the value is non-nil.
(maybe-update-in m [& ks] f & args)
'Updates' a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created only if the update function returns a non-nil value. If the update function returns nil, the map is returned unmodified.
'Updates' a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created only if the update function returns a non-nil value. If the update function returns nil, the map is returned unmodified.
(middleware & forms)
Build a middleware processing pipeline from the specified forms. The result is a middleware.
Build a middleware processing pipeline from the specified forms. The result is a middleware.
(obfuscate pw)
Obfuscate a password, by replacing every character by an asterisk.
Obfuscate a password, by replacing every character by an asterisk.
(pipe & forms)
Build a session processing pipeline from the specified forms.
Build a session processing pipeline from the specified forms.
(pprint-lines s)
Pretty print a multiline string
Pretty print a multiline string
(quoted s)
Return the string value of the argument in quotes.
Return the string value of the argument in quotes.
(resource-properties path)
Given a resource path
, load it as a java properties file.
Returns nil if resource not found.
Given a resource `path`, load it as a java properties file. Returns nil if resource not found.
(slurp-as-byte-array file)
Read the given file as a byte array.
Read the given file as a byte array.
(total-order-merge & seqs)
Merge the seqs
sequences so that the ordering of the elements in result is
the same as the ordering of elements present in each of the specified
sequences. Throws an exception if no ordering can be found that satisfies the
ordering in all the seqs
.
Merge the `seqs` sequences so that the ordering of the elements in result is the same as the ordering of elements present in each of the specified sequences. Throws an exception if no ordering can be found that satisfies the ordering in all the `seqs`.
(with-temp-file [varname content] & body)
Create a block where varname
is a temporary File
containing content
.
Create a block where `varname` is a temporary `File` containing `content`.
(with-temporary bindings & body)
A block scope allowing multiple bindings to expressions. Each binding will
have the member function delete
called on it.
A block scope allowing multiple bindings to expressions. Each binding will have the member function `delete` called on it.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close