Liking cljdoc? Tell your friends :D

pallet.common.context

A hierarchical context, with callbacks on entry and exit of a context. The context is a map, with implementation scopes. Options can be used to modify the behaviour of the context, as a form of middleware.

:on-enter - the return value is merged into the context :on-exit - the return value is ignored

A hierarchical context, with callbacks on entry and exit of a context.
The context is a map, with implementation scopes.  Options can be used to
modify the behaviour of the context, as a form of middleware.

:on-enter - the return value is merged into the context
:on-exit - the return value is ignored
raw docstring

*current-context*clj

Thread specific current context

Thread specific current context
sourceraw docstring

compose-keysclj

The keys that control the behaviour of a context.

The keys that control the behaviour of a context.
sourceraw docstring

context-entriesclj

(context-entries context)

Return the context entries for a context

Return the context entries for a context
sourceraw docstring

context-entries-as-stringclj

(context-entries-as-string entries)
source

context-historycljmacro

(context-history {:keys [history-kw limit] :or {history-kw :history limit 100}})
source

current-contextclj

(current-context)

Return the current context.

Return the current context.
sourceraw docstring

formatted-contextclj

(formatted-context)
(formatted-context context)

Return the last formatted context entry for a context

Return the last formatted context entry for a context
sourceraw docstring

formatted-context-entriesclj

(formatted-context-entries)
(formatted-context-entries context)

Return the formatted context entries for a context

Return the formatted context entries for a context
sourceraw docstring

formatted-historyclj

(formatted-history context)
source

formatted-scope-entriesclj

(formatted-scope-entries)
(formatted-scope-entries context scope)

Return the formatted context entries for the given scope

Return the formatted context entries for the given scope
sourceraw docstring

in-contextcljmacro

(in-context entry options & body)

Create a scope by pushing a context entry onto the context. On exit of the body, the context is popped.

Recognised options are: scope on-enter on-exit on-exception format

Create a scope by pushing a context entry onto the context. On exit of
the body, the context is popped.

Recognised options are:
   scope on-enter on-exit on-exception format
sourceraw docstring

log-contextcljmacro

(log-context options)

Execute body, logging the current context.

Execute body, logging the current context.
sourceraw docstring

make-contextclj

(make-context &
              {:keys [scope on-enter on-exit on-exception format]
               :or {scope :pallet.common.context/default}
               :as options})

Returns a new context. Accepts optional callbacks for :on-enter and on-exit, which are called for every change in context.

Returns a new context. Accepts optional callbacks for :on-enter
and on-exit, which are called for every change in context.
sourceraw docstring

on-enterclj

(on-enter context entry)
source

on-exceptionclj

(on-exception context exception-map)
source

on-exitclj

(on-exit context entry)
source

option-keysclj

The keys that control the behaviour of a context.

The keys that control the behaviour of a context.
sourceraw docstring

optionsclj

(options context
         {:keys [scope on-enter on-exit on-exception format] :as options})

Set the options for a context. Accepts :on-enter and :on-exit callback functions.

Set the options for a context. Accepts :on-enter and :on-exit callback
functions.
sourceraw docstring

override-defaultsclj

source

override-keysclj

The keys that control the behaviour of a context.

The keys that control the behaviour of a context.
sourceraw docstring

push-entryclj

(push-entry context entry)
source

scope-context-entriesclj

(scope-context-entries scope)
(scope-context-entries context scope)

Return a sequence of context entries for the specified scope

Return a sequence of context entries for the specified scope
sourceraw docstring

scope-formatted-context-entriesclj

(scope-formatted-context-entries scope)
(scope-formatted-context-entries context scope)

Return a sequence of formatted context entries for the specified scope

Return a sequence of formatted context entries for the specified scope
sourceraw docstring

set-context-scopeclj

(set-context-scope context scope)
source

throw-mapclj

(throw-map msg {:as exception-map})

Throws a map, containing the current context on the :context scope

Throws a map, containing the current context on the :context scope
sourceraw docstring

try-contextcljmacro

(try-context options & body)

Execute body, wrapping any exceptions in an exception which includes the current context.

Execute body, wrapping any exceptions in an exception which includes the
current context.
sourceraw docstring

update-context-scopeclj

(update-context-scope context scope)

Set the context scope for entries in a context.

Set the context scope for entries in a context.
sourceraw docstring

with-contextcljmacro

(with-context entry options & body)

Wraps the body with a context, and re-throws wrapped exceptions

Wraps the body with a context, and re-throws wrapped exceptions
sourceraw docstring

with-context-historycljmacro

(with-context-history {:keys [history-kw limit] :as options} & body)

Add context to a limited history

Add context to a limited history
sourceraw docstring

with-context-loggingcljmacro

(with-context-logging & body)

Log context entries and exits

Log context entries and exits
sourceraw docstring

with-logged-contextcljmacro

(with-logged-context entry options & body)

Wraps the body with a context, and re-throws wrapped exceptions

Wraps the body with a context, and re-throws wrapped exceptions
sourceraw docstring

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

× close