From c6b1e1df5a7aa8a6578e5e5a234ab0b32b2324e4 Mon Sep 17 00:00:00 2001 From: "Howard M. Lewis Ship" Date: Fri, 17 May 2024 17:56:44 -0700 Subject: [PATCH] API 0.7.0-beta-2 --- api/0.7/index.html | 2 +- api/0.7/io.pedestal.environment.html | 4 +- api/0.7/io.pedestal.http.body-params.html | 22 +++--- api/0.7/io.pedestal.http.container.html | 4 +- .../io.pedestal.http.content-negotiation.html | 4 +- api/0.7/io.pedestal.http.cors.html | 6 +- api/0.7/io.pedestal.http.csrf.html | 8 +- api/0.7/io.pedestal.http.html | 54 +++++++------- ...edestal.http.impl.servlet-interceptor.html | 16 ++-- ...l.http.impl.servlet-interceptor.specs.html | 2 +- api/0.7/io.pedestal.http.jetty.container.html | 2 +- api/0.7/io.pedestal.http.jetty.html | 8 +- api/0.7/io.pedestal.http.jetty.util.html | 6 +- api/0.7/io.pedestal.http.params.html | 6 +- api/0.7/io.pedestal.http.request.html | 4 +- api/0.7/io.pedestal.http.request.lazy.html | 14 ++-- api/0.7/io.pedestal.http.request.map.html | 2 +- ...pedestal.http.request.servlet-support.html | 4 +- .../io.pedestal.http.request.zerocopy.html | 2 +- .../io.pedestal.http.ring-middlewares.html | 32 ++++---- .../io.pedestal.http.route.definition.html | 12 +-- ....pedestal.http.route.definition.table.html | 2 +- ....pedestal.http.route.definition.terse.html | 12 +-- ...edestal.http.route.definition.verbose.html | 4 +- api/0.7/io.pedestal.http.route.html | 73 ++++++++++--------- .../io.pedestal.http.route.linear-search.html | 4 +- api/0.7/io.pedestal.http.route.map-tree.html | 6 +- api/0.7/io.pedestal.http.route.path.html | 2 +- .../io.pedestal.http.route.prefix-tree.html | 16 ++-- api/0.7/io.pedestal.http.route.router.html | 4 +- api/0.7/io.pedestal.http.route.specs.html | 2 +- api/0.7/io.pedestal.http.secure-headers.html | 18 ++--- api/0.7/io.pedestal.http.servlet.html | 4 +- api/0.7/io.pedestal.http.specs.html | 2 +- api/0.7/io.pedestal.http.sse.html | 12 +-- api/0.7/io.pedestal.http.tracing.html | 6 +- .../io.pedestal.interceptor.chain.debug.html | 4 +- api/0.7/io.pedestal.interceptor.chain.html | 29 ++++---- api/0.7/io.pedestal.interceptor.error.html | 4 +- api/0.7/io.pedestal.interceptor.helpers.html | 34 ++++----- api/0.7/io.pedestal.interceptor.html | 10 +-- api/0.7/io.pedestal.interceptor.specs.html | 2 +- api/0.7/io.pedestal.interceptor.trace.html | 4 +- api/0.7/io.pedestal.log.html | 56 +++++++------- api/0.7/io.pedestal.metrics.codahale.html | 6 +- api/0.7/io.pedestal.metrics.html | 20 ++--- api/0.7/io.pedestal.metrics.otel.html | 4 +- api/0.7/io.pedestal.metrics.spi.html | 4 +- api/0.7/io.pedestal.service-tools.dev.html | 6 +- api/0.7/io.pedestal.service-tools.war.html | 10 +-- ...o.pedestal.telemetry.otel-global-init.html | 6 +- api/0.7/io.pedestal.test.html | 12 +-- api/0.7/io.pedestal.tracing.html | 22 +++--- api/0.7/io.pedestal.tracing.spi.html | 4 +- api/0.7/io.pedestal.websocket.html | 18 +++-- api/0.7/io.pedestal.websocket.specs.html | 2 +- 56 files changed, 326 insertions(+), 312 deletions(-) diff --git a/api/0.7/index.html b/api/0.7/index.html index 05e6fad..f8a5edf 100644 --- a/api/0.7/index.html +++ b/api/0.7/index.html @@ -1,6 +1,6 @@ -io.pedestal libraries 0.7.0-beta-1

io.pedestal libraries 0.7.0-beta-1

Namespaces

io.pedestal.environment

Information about the running environment for the Pedestal application.

+io.pedestal libraries 0.7.0-beta-2

io.pedestal libraries 0.7.0-beta-2

Namespaces

io.pedestal.environment

Information about the running environment for the Pedestal application.

Public variables and functions:

io.pedestal.http.body-params

Provides interceptors and support for parsing the body of a request, generally according to the content type header. This results in new keys on the request map, depending on the type of data parsed.

io.pedestal.http.container

Deeper Pedestal<->Container integration and cooperation for HTTP handling

diff --git a/api/0.7/io.pedestal.environment.html b/api/0.7/io.pedestal.environment.html index e2d20a7..652a9e0 100644 --- a/api/0.7/io.pedestal.environment.html +++ b/api/0.7/io.pedestal.environment.html @@ -1,6 +1,6 @@ -io.pedestal.environment documentation

io.pedestal.environment

added in 0.7.0

Information about the running environment for the Pedestal application.

+io.pedestal.environment documentation

io.pedestal.environment

added in 0.7.0

Information about the running environment for the Pedestal application.

dev-mode?

Set to the boolean value of the system property io.pedestal.dev-mode.

Development mode exists to assist in setting up a useful REPL-oriented workflow for local development and testing. It should never be enabled in production.

-
\ No newline at end of file +
\ No newline at end of file diff --git a/api/0.7/io.pedestal.http.body-params.html b/api/0.7/io.pedestal.http.body-params.html index 46a9b30..fe4f327 100644 --- a/api/0.7/io.pedestal.http.body-params.html +++ b/api/0.7/io.pedestal.http.body-params.html @@ -1,9 +1,9 @@ -io.pedestal.http.body-params documentation

io.pedestal.http.body-params

Provides interceptors and support for parsing the body of a request, generally according to the content type header. This results in new keys on the request map, depending on the type of data parsed.

+io.pedestal.http.body-params documentation

io.pedestal.http.body-params

Provides interceptors and support for parsing the body of a request, generally according to the content type header. This results in new keys on the request map, depending on the type of data parsed.

add-parser

(add-parser parser-map content-type parser-fn)

Adds a parser to the parser map; content type can either be a string (to exactly match the content type), or a regular expression.

The parser-fn is passed the request map and returns a modified request map with an appropriate key and parsed value. For example, the default JSON parser adds a :json-params key.

-

add-ring-middleware

deprecated in 0.7.0

(add-ring-middleware parser-map content-type middleware)

body-params

(body-params)(body-params parser-map)

Returns an interceptor that will parse the body of the request according to the content type. The normal rules are provided by default-parser-map which maps a regular expression identifying a content type to a parsing function for that type.

+

add-ring-middleware

deprecated in 0.7.0

(add-ring-middleware parser-map content-type middleware)

body-params

(body-params)(body-params parser-map)

Returns an interceptor that will parse the body of the request according to the content type. The normal rules are provided by default-parser-map which maps a regular expression identifying a content type to a parsing function for that type.

Parameters parsed from the body are added as a new key to the request map dependending on which parser does the work; for the default parsers, one of the following will be used:

  • :json-params
  • @@ -11,20 +11,20 @@
  • :form-params
  • :transit-params
-

custom-edn-parser

(custom-edn-parser & options)

Return an edn-parser fn that, given a request, will read the body of that request with edn/read. options are key-val pairs that will be passed as a hash-map to edn/read.

-

custom-json-parser

(custom-json-parser & options)

Return a json-parser fn that, given a request, will read the body of the request with json/parse-stream. options are key-val pairs that will be passed along to json/parse-stream.

-

custom-transit-parser

(custom-transit-parser & options)

Return a transit-parser fn that, given a request, will read the body of that request with transit/read. options is a sequence to pass to transit/reader along with the body of the request.

-

default-parser-map

(default-parser-map & parser-options)

Return a map of MIME-type to parsers. Included types are edn, json and form-encoding. parser-options are key-val pairs, valid options are:

+

custom-edn-parser

(custom-edn-parser & options)

Return an edn-parser fn that, given a request, will read the body of that request with edn/read. options are key-val pairs that will be passed as a hash-map to edn/read.

+

custom-json-parser

(custom-json-parser & options)

Return a json-parser fn that, given a request, will read the body of the request with json/parse-stream. options are key-val pairs that will be passed along to json/parse-stream.

+

custom-transit-parser

(custom-transit-parser & options)

Return a transit-parser fn that, given a request, will read the body of that request with transit/read. options is a sequence to pass to transit/reader along with the body of the request.

+

default-parser-map

(default-parser-map & parser-options)

Return a map of MIME-type to parsers. Included types are edn, json and form-encoding. parser-options are key-val pairs, valid options are:

:edn-options A hash-map of options to be used when invoking edn/read. :json-options A hash-map of options to be used when invoking json/parse-stream. :transit-options A vector of options to be used when invoking transit/reader - must apply to both json and msgpack

Examples:

(default-parser-map :json-options {:key-fn keyword}) ;; This parser-map would parse the json body ‘{“foo”: “bar”}’ as ;; {:foo “bar”}

(default-parser-map :edn-options {:readers data-readers}) ;; This parser-map will parse edn bodies using any custom edn readers you ;; define (in a data_readers.clj file, for example.)

(default-parser-map :transit-options {:handlers {“custom/model” custom-model-read-handler}}) ;; This parser-map will parse the transit body using a handler defined by ;; custom-model-read-handler.

-

edn-parser

deprecated in 0.7.0

(edn-parser & args)

Take a request and parse its body as edn.

+

edn-parser

deprecated in 0.7.0

(edn-parser & args)

Take a request and parse its body as edn.

Invoke custom-edn-parser instead.

-

form-parser

(form-parser request)

Take a request and parse its body as a form.

-

json-parser

deprecated in 0.7.0

(json-parser & args)

Take a request and parse its body as JSON.

+

form-parser

(form-parser request)

Take a request and parse its body as a form.

+

json-parser

deprecated in 0.7.0

(json-parser & args)

Take a request and parse its body as JSON.

Use custom-json-parser instead.

-

transit-parser

deprecated in 0.7.0

(transit-parser & args)

Take a request and parse its body as JSON transit.

+

transit-parser

deprecated in 0.7.0

(transit-parser & args)

Take a request and parse its body as JSON transit.

Use custom-transit-parser instead.

-
\ No newline at end of file +
\ No newline at end of file diff --git a/api/0.7/io.pedestal.http.container.html b/api/0.7/io.pedestal.http.container.html index 39b3e7b..273e4cb 100644 --- a/api/0.7/io.pedestal.http.container.html +++ b/api/0.7/io.pedestal.http.container.html @@ -1,4 +1,4 @@ -io.pedestal.http.container documentation

io.pedestal.http.container

Deeper Pedestal<->Container integration and cooperation for HTTP handling

-

WriteNIOByteBody

protocol

members

write-byte-buffer-body

(write-byte-buffer-body servlet-response body resume-chan context)

write-byte-channel-body

(write-byte-channel-body servlet-response body resume-chan context)
\ No newline at end of file +io.pedestal.http.container documentation

io.pedestal.http.container

Deeper Pedestal<->Container integration and cooperation for HTTP handling

+

WriteNIOByteBody

protocol

members

write-byte-buffer-body

(write-byte-buffer-body servlet-response body resume-chan context)

write-byte-channel-body

(write-byte-channel-body servlet-response body resume-chan context)
\ No newline at end of file diff --git a/api/0.7/io.pedestal.http.content-negotiation.html b/api/0.7/io.pedestal.http.content-negotiation.html index 04d7902..6a16879 100644 --- a/api/0.7/io.pedestal.http.content-negotiation.html +++ b/api/0.7/io.pedestal.http.content-negotiation.html @@ -1,6 +1,6 @@ -io.pedestal.http.content-negotiation documentation

io.pedestal.http.content-negotiation

best-match

(best-match match-fn parsed-accept-maps)

best-match-fn

(best-match-fn supported-type-strs)

negotiate-content

(negotiate-content supported-type-strs)(negotiate-content supported-type-strs opts-map)

Given a vector of strings (supported types mime-types) and optionally a map of additional options, return an interceptor that will parse client-request response formats, and add an :accept key on the request, of the most acceptable response format.

+io.pedestal.http.content-negotiation documentation

io.pedestal.http.content-negotiation

best-match

(best-match match-fn parsed-accept-maps)

best-match-fn

(best-match-fn supported-type-strs)

negotiate-content

(negotiate-content supported-type-strs)(negotiate-content supported-type-strs opts-map)

Given a vector of strings (supported types mime-types) and optionally a map of additional options, return an interceptor that will parse client-request response formats, and add an :accept key on the request, of the most acceptable response format.

The format of the :accept value is a map containing :field, :type, and :subtype - all strings

Additional options: :no-match-fn - A function that takes a context; Called when no acceptable format/mime-type is found :content-param-paths - a vector of vectors; paths into the context to find ‘accept’ format strings

-

parse-accept-*

(parse-accept-* accept-str)

parse-accept-element

(parse-accept-element accept-elem-str)

weighted-accept-qs

(weighted-accept-qs supported-types accept-elem)
\ No newline at end of file +

parse-accept-*

(parse-accept-* accept-str)

parse-accept-element

(parse-accept-element accept-elem-str)

weighted-accept-qs

(weighted-accept-qs supported-types accept-elem)
\ No newline at end of file diff --git a/api/0.7/io.pedestal.http.cors.html b/api/0.7/io.pedestal.http.cors.html index 37d1bb4..0e293bc 100644 --- a/api/0.7/io.pedestal.http.cors.html +++ b/api/0.7/io.pedestal.http.cors.html @@ -1,6 +1,6 @@ -io.pedestal.http.cors documentation

io.pedestal.http.cors

allow-origin

(allow-origin allowed-origins)

Returns a CORS interceptor that allows calls from the specified allowed-origins, which is one of the following:

+io.pedestal.http.cors documentation

io.pedestal.http.cors

allow-origin

(allow-origin allowed-origins)

Returns a CORS interceptor that allows calls from the specified allowed-origins, which is one of the following:

  • a sequence of strings

    @@ -16,5 +16,5 @@

    :creds - true or false, indicates whether client is allowed to send credentials

    :max-age - a long, indicates the number of seconds a client should cache the response from a preflight request

    :methods - a string, indicates the accepted HTTP methods. Defaults to “GET, POST, PUT, DELETE, HEAD, PATCH, OPTIONS”

    -

dev-allow-origin

Provides a default origin header as a blank string, if not supplied in the incoming request.

-
\ No newline at end of file +

dev-allow-origin

Provides a default origin header as a blank string, if not supplied in the incoming request.

+
\ No newline at end of file diff --git a/api/0.7/io.pedestal.http.csrf.html b/api/0.7/io.pedestal.http.csrf.html index 364e67f..979af63 100644 --- a/api/0.7/io.pedestal.http.csrf.html +++ b/api/0.7/io.pedestal.http.csrf.html @@ -1,9 +1,9 @@ -io.pedestal.http.csrf documentation

io.pedestal.http.csrf

CSRF protection interceptor support, compatible with ring-anti-forgery

-

access-denied-response

(access-denied-response body)

anti-forgery

(anti-forgery)(anti-forgery options)

Interceptor that prevents CSRF attacks. Any POST/PUT/PATCH/DELETE request to the handler returned by this function must contain a valid anti-forgery token, or else an access-denied response is returned.

+io.pedestal.http.csrf documentation

io.pedestal.http.csrf

CSRF protection interceptor support, compatible with ring-anti-forgery

+

access-denied-response

(access-denied-response body)

anti-forgery

(anti-forgery)(anti-forgery options)

Interceptor that prevents CSRF attacks. Any POST/PUT/PATCH/DELETE request to the handler returned by this function must contain a valid anti-forgery token, or else an access-denied response is returned.

The anti-forgery token can be placed into a HTML page via the ::anti-forgery-token within the request, which is bound to a random key unique to the current session. By default, the token is expected to be in a form field named ‘__anti-forgery-token’, or in the ‘X-CSRF-Token’ or ‘X-XSRF-Token’ headers.

This behavior can be customized by supplying a map of options: :read-token a function that takes a request and returns an anti-forgery token, or nil if the token does not exist. :cookie-token a truthy value, if you want a CSRF double-submit cookie set :error-response the response to return if the anti-forgery token is incorrect or missing. :error-handler a handler function (passed the context) to call if the anti-forgery token is incorrect or missing (intended to return a valid response). :body-params a body-params parser map to use; If none is supplied, the default parsers will be used (standard body-params behavior) :cookie-attrs a map of attributes to associate with the csrf cookie.

Only one of :error-response, :error-handler may be specified.

-

anti-forgery-rotate-token

anti-forgery-token

anti-forgery-token-str

default-error-response

denied-msg

existing-token

(existing-token request)

new-token

(new-token)

rotate-token

(rotate-token response)

Rotate the csrf token, e.g. after login succeeds.

-
\ No newline at end of file +

anti-forgery-rotate-token

anti-forgery-token

anti-forgery-token-str

default-error-response

denied-msg

existing-token

(existing-token request)

new-token

(new-token)

rotate-token

(rotate-token response)

Rotate the csrf token, e.g. after login succeeds.

+
\ No newline at end of file diff --git a/api/0.7/io.pedestal.http.html b/api/0.7/io.pedestal.http.html index 13881b8..baee851 100644 --- a/api/0.7/io.pedestal.http.html +++ b/api/0.7/io.pedestal.http.html @@ -1,20 +1,20 @@ -io.pedestal.http documentation

io.pedestal.http

This namespace ties together the many other namespaces to make it possible to succinctly define a service and start and stop a server for that service.

+io.pedestal.http documentation

io.pedestal.http

This namespace ties together the many other namespaces to make it possible to succinctly define a service and start and stop a server for that service.

This namespace is generic as to the underlying container for the server; in some cases, a namespace will be loaded on the fly to convert a service to a server (based on Jetty or Tomcat, or others).

In addition, there is support here for deploying a Pedestal application as part of a WAR file, via the ClojureVarServlet.

create-provider

(create-provider service-map)

Applies default-interceptors (if not already applied) and creates the interceptor chain provider (the basis for starting an embedded servlet container).

-

create-server

(create-server service-map)(create-server service-map init-fn)

Given a service map, creates and returns an initialized server map which is ready to be started via start. If init-fn, a zero arg function, is provided, it is invoked first.

+

create-server

(create-server service-map)(create-server service-map init-fn)

Given a service map, creates and returns an initialized server map which is ready to be started via start. If init-fn, a zero arg function, is provided, it is invoked first.

Creating a server does not start the server; that occurs when the returned map is passed to start.

Notes: - If the service map option :io.pedestal.http/chain-provider is present, it is used to create the server, otherwise a servlet provider will be used. In this case, the type of servlet container created is determined by the :io.pedestal.http/type option. - For servlet containers, the resulting service-map will contain the io.pedestal.http/service-fn key which is useful for testing the service without starting it.

-

create-servlet

(create-servlet service-map)

Creates a servlet given an options map with keyword keys prefixed by namespace e.g. :io.pedestal.http/interceptors or ::bootstrap/interceptors if the namespace is aliased to bootstrap.

+

create-servlet

(create-servlet service-map)

Creates a servlet given an options map with keyword keys prefixed by namespace e.g. :io.pedestal.http/interceptors or ::bootstrap/interceptors if the namespace is aliased to bootstrap.

Options:

  • :io.pedestal.http/interceptors: A vector of interceptors that defines a service.

Note: Additional options are passed to default-interceptors if :interceptors is not set.

-

default-debug-observer-omit

added in 0.7.0

(default-debug-observer-omit key-path)

Default for key paths to ignore when using debug-observer. This is primarily the request and response bodies, anything private to the io.pedestal.interceptor.chain namespaces, and a few routing-related keys (that produce non-useful logged output).

-

default-interceptors

(default-interceptors service-map)

Builds a default vector of interceptors given a service map with keyword keys prefixed by namespace e.g. :io.pedestal.http/routes (or ::http/routes if the namespace is aliased to http); the interceptor are added to the ::interceptors key.

+

default-debug-observer-omit

added in 0.7.0

(default-debug-observer-omit key-path)

Default for key paths to ignore when using debug-observer. This is primarily the request and response bodies, anything private to the io.pedestal.interceptor.chain namespaces, and a few routing-related keys (that produce non-useful logged output).

+

default-interceptors

(default-interceptors service-map)

Builds a default vector of interceptors given a service map with keyword keys prefixed by namespace e.g. :io.pedestal.http/routes (or ::http/routes if the namespace is aliased to http); the interceptor are added to the ::interceptors key.

This function is called from create-servlet and create-provider.

When the ::interceptors key is already present in the context, this function does nothing. This allows application code to invoke default-interceptors, and then add or modify those interceptors before continuing on towards creating and starting a server.

Options:

@@ -35,38 +35,38 @@
  • :tracing: An interceptor to handle telemetry request tracing; this is added as the first interceptor. Defaults to request-tracing-interceptor and can be set to nil to eliminate entirely (added in 0.7.0).
  • Note that none of the default interceptors will parse the content of the request body (for POST or other requests); individual routes that are of type POST should include the body-params interceptor to do so.

    -

    dev-interceptors

    (dev-interceptors service-map)

    Add dev-allow-origin and exception-debug interceptors to facilitate local development.

    +

    dev-interceptors

    (dev-interceptors service-map)

    Add dev-allow-origin and exception-debug interceptors to facilitate local development.

    This should normally be invoked after default-interceptors.

    -

    edn-response

    (edn-response obj)

    Return a Ring response that will print the given obj to the HTTP output stream in EDN format.

    -

    enable-debug-interceptor-observer

    added in 0.7.0

    (enable-debug-interceptor-observer service-map)(enable-debug-interceptor-observer service-map debug-observer-options)

    Enables debug-observer for all request executions. By default, uses default-debug-observer-omit to omit internal or overly verbose context map keys.

    +

    edn-response

    (edn-response obj)

    Return a Ring response that will print the given obj to the HTTP output stream in EDN format.

    +

    enable-debug-interceptor-observer

    added in 0.7.0

    (enable-debug-interceptor-observer service-map)(enable-debug-interceptor-observer service-map debug-observer-options)

    Enables debug-observer for all request executions. By default, uses default-debug-observer-omit to omit internal or overly verbose context map keys.

    The debug observer should not be enabled in production: it is somewhat expensive to identify changes to the context, and some data in the context that might be logged can be verbose, sensitive, or both.

    This modifies the ::initial-context key of the service map.

    -

    html-body

    Set the Content-Type header to “text/html” if the body is a string and a type has not been set.

    -

    interceptor-chain-provider

    (interceptor-chain-provider service-map)

    Called from create-provider, uses the ::chain-provider or ::type key of the service map to create the chain provider.

    -

    json-body

    Set the Content-Type header to “application/json” and convert the body to JSON if the body is a collection and a type has not been set.

    -

    json-print

    (json-print obj)

    Print object as JSON to out

    -

    json-response

    (json-response obj)

    Return a Ring response that will print the given obj to the HTTP output stream in JSON format.

    -

    log-request

    Log the request’s method and uri.

    -

    not-found

    An interceptor that returns a 404 when routing failed to resolve a route.

    -

    respond-with

    added in 0.7.0

    (respond-with context status)(respond-with context status body)(respond-with context status headers body)

    Utility function to add a :response map to the interceptor context.

    -

    response?

    (response? resp)

    A valid response is any map that includes an integer :status value.

    -

    server

    (server service-map)

    Converts a service map to a server map.

    +

    html-body

    Set the Content-Type header to “text/html” if the body is a string and a type has not been set.

    +

    interceptor-chain-provider

    (interceptor-chain-provider service-map)

    Called from create-provider, uses the ::chain-provider or ::type key of the service map to create the chain provider.

    +

    json-body

    Set the Content-Type header to “application/json” and convert the body to JSON if the body is a collection and a type has not been set.

    +

    json-print

    (json-print obj)

    Print object as JSON to out

    +

    json-response

    (json-response obj)

    Return a Ring response that will print the given obj to the HTTP output stream in JSON format.

    +

    log-request

    Log the request’s method and uri.

    +

    not-found

    An interceptor that returns a 404 when routing failed to resolve a route.

    +

    respond-with

    added in 0.7.0

    (respond-with context status)(respond-with context status body)(respond-with context status headers body)

    Utility function to add a :response map to the interceptor context.

    +

    response?

    (response? resp)

    A valid response is any map that includes an integer :status value.

    +

    server

    (server service-map)

    Converts a service map to a server map.

    A service map is largely configuration, including some special callbacks; most of the keys are namespaced. Some keys are applicable to any underlying implementation (such as Jetty or Tomcat), and some are specific to the particular implementation.

    This function uses the ::type key to link the service map to a specific implementation; this should be a function that accepts a service map and returns a server map of an unstarted server.

    ::type can also be a keyword; this keyword is used to build a fully qualified symbol to resolve the function. For example, :jetty will be expanded into io.pedestal.http.jetty/service (but this approach is not favored as it can prevent AOT compilation from pre-compiling the indirectly referenced namespace).

    The function is passed the service map and options; these options are a subset of the keys from the service map (::host, ::port, ::join?, ::container-options, and ::websockets); they are extracted from the service map and passed as the options map, after stripping out the namespaces (::host becomes :host).

    Returns a server map, which merges the provided service map with additional keys from the map returned by the server-fn. The server map may be passed to start and stop.

    A typical embedded app will call create-server, rather than calling this function directly.

    -

    service-fn

    (service-fn {:io.pedestal.http/keys [interceptors initial-context service-fn-options], :as service-map})

    Converts the interceptors for the service into a service function, which is a function that accepts a servlet, servlet request, and servlet response, and initiates the interceptor chain.

    -

    servlet

    (servlet {service-fn :io.pedestal.http/service-fn, :as service-map})

    Converts the service-fn in the service map to a servlet instance.

    -

    servlet-destroy

    (servlet-destroy service)

    servlet-init

    (servlet-init service config)

    servlet-service

    (servlet-service service servlet-req servlet-resp)

    start

    (start server-map)

    Given a server map, as returned by server (usually via create-server), starts the server. The server may later be stopped via stop.

    +

    service-fn

    (service-fn {:io.pedestal.http/keys [interceptors initial-context service-fn-options], :as service-map})

    Converts the interceptors for the service into a service function, which is a function that accepts a servlet, servlet request, and servlet response, and initiates the interceptor chain.

    +

    servlet

    (servlet {service-fn :io.pedestal.http/service-fn, :as service-map})

    Converts the service-fn in the service map to a servlet instance.

    +

    servlet-destroy

    (servlet-destroy service)

    servlet-init

    (servlet-init service config)

    servlet-service

    (servlet-service service servlet-req servlet-resp)

    start

    (start server-map)

    Given a server map, as returned by server (usually via create-server), starts the server. The server may later be stopped via stop.

    Returns the server map unchanged.

    -

    stop

    (stop server-map)

    Given a server map (started by start), stops the server, if running.

    +

    stop

    (stop server-map)

    Given a server map (started by start), stops the server, if running.

    Returns the server map unchanged.

    -

    transit-body

    Same as transit-json-body – Set the Content-Type header to “application/transit+json” and convert the body to transit+json if the body is a collection and a type has not been set.

    -

    transit-body-interceptor

    (transit-body-interceptor iname default-content-type transit-format)(transit-body-interceptor iname default-content-type transit-format transit-opts)

    Returns an interceptor which sets the Content-Type header to the appropriate value depending on the transit format. Converts the body to the specified Transit format if the body is a collection and a type has not been set. Optionally accepts transit-opts which are handed to trasit/writer and may contain custom write handlers.

    +

    transit-body

    Same as transit-json-body – Set the Content-Type header to “application/transit+json” and convert the body to transit+json if the body is a collection and a type has not been set.

    +

    transit-body-interceptor

    (transit-body-interceptor iname default-content-type transit-format)(transit-body-interceptor iname default-content-type transit-format transit-opts)

    Returns an interceptor which sets the Content-Type header to the appropriate value depending on the transit format. Converts the body to the specified Transit format if the body is a collection and a type has not been set. Optionally accepts transit-opts which are handed to trasit/writer and may contain custom write handlers.

    Expects the following arguments:

    iname - namespaced keyword for the interceptor name default-content-type - content-type string to set in the response transit-format - either :json or :msgpack transit-options - optional. map of options for transit/writer

    -

    transit-json-body

    Set the Content-Type header to “application/transit+json” and convert the body to transit+json if the body is a collection and a type has not been set.

    -

    transit-msgpack-body

    Set the Content-Type header to “application/transit+msgpack” and convert the body to transit+msgpack if the body is a collection and a type has not been set.

    -
    \ No newline at end of file +

    transit-json-body

    Set the Content-Type header to “application/transit+json” and convert the body to transit+json if the body is a collection and a type has not been set.

    +

    transit-msgpack-body

    Set the Content-Type header to “application/transit+msgpack” and convert the body to transit+msgpack if the body is a collection and a type has not been set.

    +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.impl.servlet-interceptor.html b/api/0.7/io.pedestal.http.impl.servlet-interceptor.html index 5cad3d0..09a73c9 100644 --- a/api/0.7/io.pedestal.http.impl.servlet-interceptor.html +++ b/api/0.7/io.pedestal.http.impl.servlet-interceptor.html @@ -1,20 +1,20 @@ -io.pedestal.http.impl.servlet-interceptor documentation

    io.pedestal.http.impl.servlet-interceptor

    Interceptors for adapting the Java HTTP Servlet interfaces.

    +io.pedestal.http.impl.servlet-interceptor documentation

    io.pedestal.http.impl.servlet-interceptor

    Interceptors for adapting the Java HTTP Servlet interfaces.

    default-exception-analyzer

    added in 0.7.0

    (default-exception-analyzer _context exception)

    The default for the :exception-analyzer option, this function is passed the context and a thrown exception that bubbled up to the stylobate interceptor.

    Primarily, this function determines if an exception should be logged or not; it can also log or otherwise report an exception itself, and then prevent the stylobate interceptor from reporting the exception, by returning nil.

    If a non-nil value is returned, it must be an exception, which will be logged.

    This implementation returns the exception, unless it represents a broken pipe (a common exception that occurs when, during a long response, the client terminates the socket connection).

    -

    exception-debug

    An interceptor which catches errors, renders them to readable text and sends them to the user. This interceptor is intended for development time assistance in debugging problems in pedestal services. Including it in interceptor paths on production systems may present a security risk by exposing call stacks of the application when exceptions are encountered.

    -

    http-interceptor-service-fn

    (http-interceptor-service-fn interceptors)(http-interceptor-service-fn interceptors default-context)(http-interceptor-service-fn interceptors default-context options)

    Returns a function which can be used as an implementation of the Servlet.service method. It executes the interceptors (which must be already converted into Interceptor records) on an initial context map containing :servlet, :servlet-config, :servlet-request, and :servlet-response. The stylobate and ring-response interceptors are prepended to the sequence of interceptors.

    +

    exception-debug

    An interceptor which catches errors, renders them to readable text and sends them to the user. This interceptor is intended for development time assistance in debugging problems in pedestal services. Including it in interceptor paths on production systems may present a security risk by exposing call stacks of the application when exceptions are encountered.

    +

    http-interceptor-service-fn

    (http-interceptor-service-fn interceptors)(http-interceptor-service-fn interceptors default-context)(http-interceptor-service-fn interceptors default-context options)

    Returns a function which can be used as an implementation of the Servlet.service method. It executes the interceptors (which must be already converted into Interceptor records) on an initial context map containing :servlet, :servlet-config, :servlet-request, and :servlet-response. The stylobate and ring-response interceptors are prepended to the sequence of interceptors.

    Options: :exception-analyzer - function that analyzes exceptions that propagate up to the stylobate interceptor, defaults to default-exception-analyzer.

    This is normally called automatically from io.pedestal.http/service-fn.

    -

    ring-response

    An interceptor which transmits a Ring specified response map to an HTTP response.

    +

    ring-response

    An interceptor which transmits a Ring specified response map to an HTTP response.

    If a later interceptor in this context throws an exception which is not caught, this interceptor will set the HTTP response status code to 500 with a generic error message. Also, if later interceptors fail to furnish the context with a :response map, this interceptor will set the HTTP response to a 500 error.

    -

    set-response

    (set-response servlet-resp resp-map)

    stylobate

    deprecated in 0.7.0

    An interceptor which primarily handles uncaught exceptions thrown during execution of the interceptor chain.

    +

    set-response

    (set-response servlet-resp resp-map)

    stylobate

    deprecated in 0.7.0

    An interceptor which primarily handles uncaught exceptions thrown during execution of the interceptor chain.

    This var is deprecated in 0.7.0 as it should only be added to the interceptor chain by http-interceptor-service-fn.

    -

    terminator-injector

    deprecated in 0.7.0

    An interceptor which causes execution to terminate when one of the interceptors produces a response, as defined by ring.util.response/response?

    +

    terminator-injector

    deprecated in 0.7.0

    An interceptor which causes execution to terminate when one of the interceptors produces a response, as defined by ring.util.response/response?

    Prior to 0.7.0, this interceptor was automatically queued. In 0.7.0, the context is initialized with a terminator function and this interceptor is no longer used.

    -

    WriteableBody

    protocol

    members

    default-content-type

    (default-content-type body)

    Get default HTTP content-type for body.

    +

    WriteableBody

    protocol

    members

    default-content-type

    (default-content-type body)

    Get default HTTP content-type for body.

    write-body-to-stream

    (write-body-to-stream body output-stream)

    Write body to the stream output-stream.

    -

    WriteableBodyAsync

    protocol

    members

    write-body-async

    (write-body-async body servlet-response resume-chan context)
    \ No newline at end of file +

    WriteableBodyAsync

    protocol

    members

    write-body-async

    (write-body-async body servlet-response resume-chan context)
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.impl.servlet-interceptor.specs.html b/api/0.7/io.pedestal.http.impl.servlet-interceptor.specs.html index e92539c..50482d6 100644 --- a/api/0.7/io.pedestal.http.impl.servlet-interceptor.specs.html +++ b/api/0.7/io.pedestal.http.impl.servlet-interceptor.specs.html @@ -1,3 +1,3 @@ -io.pedestal.http.impl.servlet-interceptor.specs documentation

    io.pedestal.http.impl.servlet-interceptor.specs

    \ No newline at end of file +io.pedestal.http.impl.servlet-interceptor.specs documentation

    io.pedestal.http.impl.servlet-interceptor.specs

    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.jetty.container.html b/api/0.7/io.pedestal.http.jetty.container.html index 5d8311d..a36830a 100644 --- a/api/0.7/io.pedestal.http.jetty.container.html +++ b/api/0.7/io.pedestal.http.jetty.container.html @@ -1,4 +1,4 @@ -io.pedestal.http.jetty.container documentation

    io.pedestal.http.jetty.container

    Extends Pedestal protocols onto Jetty container classes.

    +io.pedestal.http.jetty.container documentation

    io.pedestal.http.jetty.container

    Extends Pedestal protocols onto Jetty container classes.

    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.jetty.html b/api/0.7/io.pedestal.http.jetty.html index 89fb8fd..382ff6b 100644 --- a/api/0.7/io.pedestal.http.jetty.html +++ b/api/0.7/io.pedestal.http.jetty.html @@ -1,7 +1,7 @@ -io.pedestal.http.jetty documentation

    io.pedestal.http.jetty

    Jetty adaptor for Pedestal.

    +io.pedestal.http.jetty documentation

    io.pedestal.http.jetty

    Jetty adaptor for Pedestal.

    server

    (server service-map)(server service-map options)

    Called from io.pedestal.http/server to create a Jetty server instance.

    -

    start

    deprecated in 0.7.0

    (start server options)

    Deprecated; to be made private in the future.

    -

    stop

    deprecated in 0.7.0

    (stop server)

    Deprecated; to be made private in the future.

    -
    \ No newline at end of file +

    start

    deprecated in 0.7.0

    (start server options)

    Deprecated; to be made private in the future.

    +

    stop

    deprecated in 0.7.0

    (stop server)

    Deprecated; to be made private in the future.

    +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.jetty.util.html b/api/0.7/io.pedestal.http.jetty.util.html index faf494a..d3cffd3 100644 --- a/api/0.7/io.pedestal.http.jetty.util.html +++ b/api/0.7/io.pedestal.http.jetty.util.html @@ -1,5 +1,5 @@ -io.pedestal.http.jetty.util documentation

    io.pedestal.http.jetty.util

    add-server-filters

    (add-server-filters context & more-filter-opts)

    add-servlet-filter

    (add-servlet-filter context filter-opts)

    Add a ServletFilter to a ServletContextHandler, given the context and a map that contains: :filter - A FilterHolder, Filter class, or a String of a Filter class and optionally contains: :path - The pathSpec string that applies to the filter; defaults to ‘/*’ :dispatches - A keyword signaling the defaults to :request

    -

    dispatch-types

    dispatcher-set

    (dispatcher-set dispatches)

    Return a dispatch EnumSet given one of: - an EnumSet (no-op) - servlet DispatcherType - a keyword representation of DispatcherType (see dispatch-types) - :all which generates an EnumSet of all DispatcherTypes

    -

    filter-holder

    (filter-holder servlet-filter init-params)
    \ No newline at end of file +io.pedestal.http.jetty.util documentation

    io.pedestal.http.jetty.util

    add-server-filters

    (add-server-filters context & more-filter-opts)

    add-servlet-filter

    (add-servlet-filter context filter-opts)

    Add a ServletFilter to a ServletContextHandler, given the context and a map that contains: :filter - A FilterHolder, Filter class, or a String of a Filter class and optionally contains: :path - The pathSpec string that applies to the filter; defaults to ‘/*’ :dispatches - A keyword signaling the defaults to :request

    +

    dispatch-types

    dispatcher-set

    (dispatcher-set dispatches)

    Return a dispatch EnumSet given one of: - an EnumSet (no-op) - servlet DispatcherType - a keyword representation of DispatcherType (see dispatch-types) - :all which generates an EnumSet of all DispatcherTypes

    +

    filter-holder

    (filter-holder servlet-filter init-params)
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.params.html b/api/0.7/io.pedestal.http.params.html index 03a5a37..8f0f228 100644 --- a/api/0.7/io.pedestal.http.params.html +++ b/api/0.7/io.pedestal.http.params.html @@ -1,5 +1,5 @@ -io.pedestal.http.params documentation

    io.pedestal.http.params

    keyword-body-params

    Interceptor that converts the :body-params map to be keyed by keywords

    -

    keyword-params

    Interceptor that converts the :params map to be keyed by keywords

    -

    keywordize-keys

    (keywordize-keys x)

    keywordize-request-body-params

    keywordize-request-element

    (keywordize-request-element element context)

    keywordize-request-params

    \ No newline at end of file +io.pedestal.http.params documentation

    io.pedestal.http.params

    keyword-body-params

    Interceptor that converts the :body-params map to be keyed by keywords

    +

    keyword-params

    Interceptor that converts the :params map to be keyed by keywords

    +

    keywordize-keys

    (keywordize-keys x)

    keywordize-request-body-params

    keywordize-request-element

    (keywordize-request-element element context)

    keywordize-request-params

    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.request.html b/api/0.7/io.pedestal.http.request.html index c4f28db..a7e8368 100644 --- a/api/0.7/io.pedestal.http.request.html +++ b/api/0.7/io.pedestal.http.request.html @@ -1,6 +1,6 @@ -io.pedestal.http.request documentation

    io.pedestal.http.request

    base-request-map

    (base-request-map req)

    ContainerRequest

    protocol

    members

    async-started?

    (async-started? x)

    async-supported?

    (async-supported? x)

    body

    (body x)

    header

    (header x header-string)

    headers

    (headers x)

    path-info

    (path-info x)

    protocol

    (protocol x)

    query-string

    (query-string x)

    remote-addr

    (remote-addr x)

    request-method

    (request-method x)

    scheme

    (scheme x)

    server-name

    (server-name x)

    server-port

    (server-port x)

    ssl-client-cert

    (ssl-client-cert x)

    uri

    (uri x)

    ProxyDatastructure

    protocol

    A lazy proxy around a fully-realized data structure.

    +io.pedestal.http.request documentation

    io.pedestal.http.request

    base-request-map

    (base-request-map req)

    ContainerRequest

    protocol

    members

    async-started?

    (async-started? x)

    async-supported?

    (async-supported? x)

    body

    (body x)

    header

    (header x header-string)

    headers

    (headers x)

    path-info

    (path-info x)

    protocol

    (protocol x)

    query-string

    (query-string x)

    remote-addr

    (remote-addr x)

    request-method

    (request-method x)

    scheme

    (scheme x)

    server-name

    (server-name x)

    server-port

    (server-port x)

    ssl-client-cert

    (ssl-client-cert x)

    uri

    (uri x)

    ProxyDatastructure

    protocol

    A lazy proxy around a fully-realized data structure.

    This is deprecated in 0.7.0 and will likely be removed in the future.

    members

    realized

    (realized this)

    Return fully-realized version of underlying data structure.

    -

    ResponseBuffer

    protocol

    members

    response-buffer-size

    (response-buffer-size x)

    ring-dispatch

    \ No newline at end of file +

    ResponseBuffer

    protocol

    members

    response-buffer-size

    (response-buffer-size x)

    ring-dispatch

    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.request.lazy.html b/api/0.7/io.pedestal.http.request.lazy.html index 6a7048c..d711043 100644 --- a/api/0.7/io.pedestal.http.request.lazy.html +++ b/api/0.7/io.pedestal.http.request.lazy.html @@ -1,14 +1,14 @@ -io.pedestal.http.request.lazy documentation

    io.pedestal.http.request.lazy

    deprecated in 0.7.0

    classify-keys

    (classify-keys [_k v])

    Classify key-value pair based on whether its value is delayed, realized, or normal.

    -

    derefing-map-entry

    (derefing-map-entry kv)(derefing-map-entry k v)

    Create a new MapEntry-like object, but allow for values to be transparently derefed when accessed.

    +io.pedestal.http.request.lazy documentation

    io.pedestal.http.request.lazy

    deprecated in 0.7.0

    classify-keys

    (classify-keys [_k v])

    Classify key-value pair based on whether its value is delayed, realized, or normal.

    +

    derefing-map-entry

    (derefing-map-entry kv)(derefing-map-entry k v)

    Create a new MapEntry-like object, but allow for values to be transparently derefed when accessed.

    Does not provide the same level of ‘equivalency’ checking that MapEntry does. Use ‘seq’ to get a realized pair of key-value.

    -

    IntoLazyRequest

    protocol

    members

    -lazy-request

    (-lazy-request _)

    Create a lazy request

    -

    lazy-request

    (lazy-request m)

    Return a LazyRequest map that transparently derefs values that are delays.

    +

    IntoLazyRequest

    protocol

    members

    -lazy-request

    (-lazy-request _)

    Create a lazy request

    +

    lazy-request

    (lazy-request m)

    Return a LazyRequest map that transparently derefs values that are delays.

    Example: (:foo (lazy-request {:foo (delay :bar)})) ;; => :bar

    LazyRequest’s are value-equal to other LazyRequest’s that share the same underlying map, but not to raw maps. Use raw or realized to return plain maps of original key-vals or realized key-vals, respectively.

    -

    LazyDatastructure

    protocol

    Utilities for manipulating/realizing lazy data structures.

    +

    LazyDatastructure

    protocol

    Utilities for manipulating/realizing lazy data structures.

    members

    touch

    (touch this)

    Realize all portions of the underlying data structure. Returns this.

    -

    RawAccess

    protocol

    Utilities for exposing raw access to advanced data structures that layer new semantics onto simpler types.

    +

    RawAccess

    protocol

    Utilities for exposing raw access to advanced data structures that layer new semantics onto simpler types.

    members

    raw

    (raw this)

    Return the raw data structure underlying a more advanced wrapper

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.request.map.html b/api/0.7/io.pedestal.http.request.map.html index 25bd35b..0a1eea6 100644 --- a/api/0.7/io.pedestal.http.request.map.html +++ b/api/0.7/io.pedestal.http.request.map.html @@ -1,3 +1,3 @@ -io.pedestal.http.request.map documentation

    io.pedestal.http.request.map

    add-character-encoding

    (add-character-encoding req-map servlet-req)

    add-content-length

    (add-content-length req-map servlet-req)

    add-content-type

    (add-content-type req-map servlet-req)

    add-ssl-client-cert

    (add-ssl-client-cert req-map servlet-req)

    servlet-request-map

    (servlet-request-map servlet servlet-req servlet-resp)
    \ No newline at end of file +io.pedestal.http.request.map documentation

    io.pedestal.http.request.map

    add-character-encoding

    (add-character-encoding req-map servlet-req)

    add-content-length

    (add-content-length req-map servlet-req)

    add-content-type

    (add-content-type req-map servlet-req)

    add-ssl-client-cert

    (add-ssl-client-cert req-map servlet-req)

    servlet-request-map

    (servlet-request-map servlet servlet-req servlet-resp)
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.request.servlet-support.html b/api/0.7/io.pedestal.http.request.servlet-support.html index 2ebb383..7533a8a 100644 --- a/api/0.7/io.pedestal.http.request.servlet-support.html +++ b/api/0.7/io.pedestal.http.request.servlet-support.html @@ -1,4 +1,4 @@ -io.pedestal.http.request.servlet-support documentation

    io.pedestal.http.request.servlet-support

    Extends the ContainerRequest and ResponseBuffer protocols to the Jakarta Servlet interfaces.

    -

    servlet-path-info

    (servlet-path-info request)

    servlet-request-headers

    (servlet-request-headers servlet-req)
    \ No newline at end of file +io.pedestal.http.request.servlet-support documentation

    io.pedestal.http.request.servlet-support

    Extends the ContainerRequest and ResponseBuffer protocols to the Jakarta Servlet interfaces.

    +

    servlet-path-info

    (servlet-path-info request)

    servlet-request-headers

    (servlet-request-headers servlet-req)
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.request.zerocopy.html b/api/0.7/io.pedestal.http.request.zerocopy.html index 7359b7c..e7d166d 100644 --- a/api/0.7/io.pedestal.http.request.zerocopy.html +++ b/api/0.7/io.pedestal.http.request.zerocopy.html @@ -1,3 +1,3 @@ -io.pedestal.http.request.zerocopy documentation

    io.pedestal.http.request.zerocopy

    deprecated in 0.7.0

    call-through-request

    (call-through-request container-req)(call-through-request container-req override-map)
    \ No newline at end of file +io.pedestal.http.request.zerocopy documentation

    io.pedestal.http.request.zerocopy

    deprecated in 0.7.0

    call-through-request

    (call-through-request container-req)(call-through-request container-req override-map)
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.ring-middlewares.html b/api/0.7/io.pedestal.http.ring-middlewares.html index c4ceb73..cca48d2 100644 --- a/api/0.7/io.pedestal.http.ring-middlewares.html +++ b/api/0.7/io.pedestal.http.ring-middlewares.html @@ -1,55 +1,55 @@ -io.pedestal.http.ring-middlewares documentation

    io.pedestal.http.ring-middlewares

    This namespace creates interceptors for ring-core middlewares.

    +io.pedestal.http.ring-middlewares documentation

    io.pedestal.http.ring-middlewares

    This namespace creates interceptors for ring-core middlewares.

    Ring provides a trove of useful and familiar functionality; this namespace exposes that functionality as interceptors that work with Pedestal.

    In some cases, some or all of the Ring middleware has been reimplemented here.

    content-type

    (content-type & [opts])

    Applies a Content-Type header to a response if missing by mapping the file name extension in the request’s URI.

    The MIME mapping occurs in the function ring.util.mime-type/ext-mime-type.

    The opts arguments are key/value pairs; the :mime-types key is a map of overrides for extensions to MIME type mappings.

    -

    cookies

    Add support for HTTP cookies. On :enter, a :cookies key is added to the request map, containing the parsed cookie data (from the “cookie” HTTP header), as a map from cookie name to cookie data; each cookie is itself a map with key :value.

    +

    cookies

    Add support for HTTP cookies. On :enter, a :cookies key is added to the request map, containing the parsed cookie data (from the “cookie” HTTP header), as a map from cookie name to cookie data; each cookie is itself a map with key :value.

    This is a wrapper around the ring.middleware.cookies namespace.

    When the response map contains a :cookies key, a “Set-Cookie” header will be added to propagate cookie data back to the client.

    -

    fast-resource

    (fast-resource root-path)(fast-resource root-path opts)

    Fast access to static resources from the classpath; essentially works like the resource interceptor, but the response :body will be a java.nio.channels.FileChannel that can be streamed to the client asynchronously.

    +

    fast-resource

    (fast-resource root-path)(fast-resource root-path opts)

    Fast access to static resources from the classpath; essentially works like the resource interceptor, but the response :body will be a java.nio.channels.FileChannel that can be streamed to the client asynchronously.

    A file is large if it is larger than the HTTP buffer size, which is calculated via io.pedestal.http.request/response-buffer-size and defaults to 1460 bytes.

    If succesful, marks the current tracing span as routed, with a route-name of :fast-resource.

    If your container doesn’t recognize FileChannel response bodies, this interceptor will cause errors.

    Supports a map of options:

    :index? - If path is a directory, will attempt to find an ‘index.*’ file to serve. Defaults to true :follow-symlinks? - Serve files through symbolic links. Defaults to false :loader - A class loader specific for these resource fetches. Default to nil (use the main class loader).

    -

    file

    (file root-path & [opts])

    Allow file-system files to be accessed as static resources. On :enter, if a static file can be found that matches incoming request URI, a response is generated from its content. Since the file interceptor usually ordered before any routing interceptor, this means that such files can mask other application routes.

    +

    file

    (file root-path & [opts])

    Allow file-system files to be accessed as static resources. On :enter, if a static file can be found that matches incoming request URI, a response is generated from its content. Since the file interceptor usually ordered before any routing interceptor, this means that such files can mask other application routes.

    The interceptor supports both GET and HEAD requests.

    The underlying support comes from ring.middleware.file/file-request.

    The :body key of the response will be a java.io.File.

    If succesful, marks the current tracing span as routed, with a route-name of :file.

    Options are specified as key/value pairs after the root-path.

    Common options are :index-files? (defaults to true) which maps directory requests to requests for an index file (if present), and :allow-symlinks? (defaults to false) which allows symbolic links to be followed rather than ignored.

    -

    file-info

    (file-info & [mime-types])

    An interceptor that, on :leave, will check the request’s “if-modified-since” headed and convert the response into a status 304 if the underlying file (the :body of the response, a java.io.File) has not been modified since the specified date. It will also set the “Content-Type” response header. The :mime-types option can be provided, it works the same here as in the content-type interceptor.

    +

    file-info

    (file-info & [mime-types])

    An interceptor that, on :leave, will check the request’s “if-modified-since” headed and convert the response into a status 304 if the underlying file (the :body of the response, a java.io.File) has not been modified since the specified date. It will also set the “Content-Type” response header. The :mime-types option can be provided, it works the same here as in the content-type interceptor.

    See ring.middleware.file-info/file-info-response for more details.

    -

    flash

    (flash)

    Support temporary data (the “flash”) in the session (see session).

    +

    flash

    (flash)

    Support temporary data (the “flash”) in the session (see session).

    On :leave, the :flash key of the response is stored into the session.

    On :enter, the previously stored flash value, if any, is removed from the session and added as the request :flash key.

    -

    head

    (head)

    Interceptor to handle head requests

    +

    head

    (head)

    Interceptor to handle head requests

    On :enter, when the request method is :head, the request method is converted to :get. On :leave, for a :head request, the response :body is set to nil.

    -

    keyword-params

    Retained for backward compatibility. io.pedestal.http.params/keyword-params is recommended

    -

    multipart-params

    (multipart-params & [opts])

    Interceptor for multipart form parameters (i.e., forms with file uploads).

    +

    keyword-params

    Retained for backward compatibility. io.pedestal.http.params/keyword-params is recommended

    +

    multipart-params

    (multipart-params & [opts])

    Interceptor for multipart form parameters (i.e., forms with file uploads).

    A wrapper around ring.middleware.multipart-params/multipart-params-request.

    This will add a :multipart-params key to the request, and merge the multipart parameters into the request :params map.

    -

    nested-params

    (nested-params & [opts])

    Interceptor for ring.middleware.nested-params/nested-params-request Ring middleware.

    +

    nested-params

    (nested-params & [opts])

    Interceptor for ring.middleware.nested-params/nested-params-request Ring middleware.

    Nested parameter names follow a particular naming pattern, the result is that the :params may of the request is converted to a nested map.

    -

    not-modified

    (not-modified)

    Adds support for the “if-modified-since” and “if-none-match” request headers; generally this applies to responses generated via the file or resource interceptors.

    +

    not-modified

    (not-modified)

    Adds support for the “if-modified-since” and “if-none-match” request headers; generally this applies to responses generated via the file or resource interceptors.

    This is a wrapper around ring.middleware.not-modified/not-modified-response.

    -

    params

    (params & [opts])

    Extract query parameters from the request URI and request body and adds a :query-params and :form-params keys to the request, and merges those maps into the request :params map.

    +

    params

    (params & [opts])

    Extract query parameters from the request URI and request body and adds a :query-params and :form-params keys to the request, and merges those maps into the request :params map.

    This is a wrapper around ring.middleware.params/params-request.

    -

    resource

    (resource root-path)

    Allows access to static resources on the classpath.

    +

    resource

    (resource root-path)

    Allows access to static resources on the classpath.

    This is a wrapper around ring.middleware.resource/resource-request.

    If succesful, marks the current tracing span as routed, with a route-name of :resource

    The response :body may be a java.io.InputStream or a java.io.File depending on the request and the classpath.

    -

    response-fn-adapter

    deprecated in 0.7.0

    (response-fn-adapter response-fn)(response-fn-adapter response-fn opts)

    Adapts a Ring middleware fn taking a response and request (that returns a possibly updated response), into an interceptor-compatible function taking a context map, that can be used as the :leave callback of an interceptor.

    +

    response-fn-adapter

    deprecated in 0.7.0

    (response-fn-adapter response-fn)(response-fn-adapter response-fn opts)

    Adapts a Ring middleware fn taking a response and request (that returns a possibly updated response), into an interceptor-compatible function taking a context map, that can be used as the :leave callback of an interceptor.

    The response-fn is only invoked if there is a non-nil :response map in the context.

    If an opts map is provided (the arity two version) and is not empty, then the response function must be arity three, taking a response map, request map, and the provided options.

    -

    session

    (session)(session options)

    Interceptor for session ring middleware. A session is a simple store of data, associated with a single client, that persists between requests. A cookie (by default “ring-session”) is used to connect requests and responses to a session. A store (the default is an in-memory Atom) stores the data between requests.

    +

    session

    (session)(session options)

    Interceptor for session ring middleware. A session is a simple store of data, associated with a single client, that persists between requests. A cookie (by default “ring-session”) is used to connect requests and responses to a session. A store (the default is an in-memory Atom) stores the data between requests.

    The request key :session is a map storing the session data, and :session/key store the key uniquely identifying the client session.

    Options are documented in ring.middleware.session/wrap-session.

    On :enter, uses ring.middleware.session/session-request, which adds a :session key to the request.

    On :leave, uses the :session and :session/key response keys to update the store and, if necessary, create a new cookie with the new session key.

    It is the application’s responsibility to copy the :session and :session/key to the response. When this does not occur, the session will be removed from the store.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.route.definition.html b/api/0.7/io.pedestal.http.route.definition.html index e69378f..fc1cd34 100644 --- a/api/0.7/io.pedestal.http.route.definition.html +++ b/api/0.7/io.pedestal.http.route.definition.html @@ -1,8 +1,8 @@ -io.pedestal.http.route.definition documentation

    io.pedestal.http.route.definition

    allowed-keys

    capture-constraint

    (capture-constraint [k v])

    Add parenthesis to a regex in order to capture its value during evaluation.

    -

    defroutes

    macro

    deprecated in 0.5.1

    (defroutes name route-spec)

    Deprecated. – Prefer def and program against ExpandableRoutes Define a routing table from the terse routing syntax.

    -

    ensure-routes-integrity

    (ensure-routes-integrity route-maps)

    prioritize-constraints

    (prioritize-constraints routing-table)

    Sort a flat routing table of entries to guarantee that the most constrained route entries appear in the table prior to entries which have fewer constraints or no constraints.

    -

    sort-by-constraints

    (sort-by-constraints groupings route-path)

    Sort the grouping of route entries which all correspond to route-path from groupings such that the most constrained route table entries appear first and the least constrained appear last.

    -

    symbol->keyword

    (symbol->keyword s)

    uniquely-add-route-path

    (uniquely-add-route-path route-paths route-path)

    Append route-path to route-paths if route-paths doesn’t contain it already.

    -

    verify-unique-route-names

    (verify-unique-route-names routing-table)
    \ No newline at end of file +io.pedestal.http.route.definition documentation

    io.pedestal.http.route.definition

    allowed-keys

    capture-constraint

    (capture-constraint [k v])

    Add parenthesis to a regex in order to capture its value during evaluation.

    +

    defroutes

    macro

    deprecated in 0.5.1

    (defroutes name route-spec)

    Deprecated. – Prefer def and program against ExpandableRoutes Define a routing table from the terse routing syntax.

    +

    ensure-routes-integrity

    (ensure-routes-integrity route-maps)

    prioritize-constraints

    (prioritize-constraints routing-table)

    Sort a flat routing table of entries to guarantee that the most constrained route entries appear in the table prior to entries which have fewer constraints or no constraints.

    +

    sort-by-constraints

    (sort-by-constraints groupings route-path)

    Sort the grouping of route entries which all correspond to route-path from groupings such that the most constrained route table entries appear first and the least constrained appear last.

    +

    symbol->keyword

    (symbol->keyword s)

    uniquely-add-route-path

    (uniquely-add-route-path route-paths route-path)

    Append route-path to route-paths if route-paths doesn’t contain it already.

    +

    verify-unique-route-names

    (verify-unique-route-names routing-table)
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.route.definition.table.html b/api/0.7/io.pedestal.http.route.definition.table.html index cad5d6d..9e6d380 100644 --- a/api/0.7/io.pedestal.http.route.definition.table.html +++ b/api/0.7/io.pedestal.http.route.definition.table.html @@ -1,3 +1,3 @@ -io.pedestal.http.route.definition.table documentation

    io.pedestal.http.route.definition.table

    attach-constraints

    attach-path-regex

    (attach-path-regex ctx)

    attach-route-name

    ensure-unique-route-names

    (ensure-unique-route-names routes)

    finalize

    (finalize ctx)

    make-parse-context

    (make-parse-context opts row route)

    parse-constraints

    (parse-constraints {:keys [constraints path-params], :as ctx})

    parse-handlers

    (parse-handlers ctx)

    parse-path

    (parse-path ctx)

    parse-route-name

    (parse-route-name {:keys [route-name interceptors last-handler], :as ctx})

    parse-verb

    (parse-verb ctx)

    route-name

    (route-name route)

    route-table-row

    (route-table-row opts row route)

    table-routes

    (table-routes routes)(table-routes opts routes)

    take-next-pair

    (take-next-pair argname expected-pred expected-str ctx)
    \ No newline at end of file +io.pedestal.http.route.definition.table documentation

    io.pedestal.http.route.definition.table

    attach-constraints

    attach-path-regex

    (attach-path-regex ctx)

    attach-route-name

    ensure-unique-route-names

    (ensure-unique-route-names routes)

    finalize

    (finalize ctx)

    make-parse-context

    (make-parse-context opts row route)

    parse-constraints

    (parse-constraints {:keys [constraints path-params], :as ctx})

    parse-handlers

    (parse-handlers ctx)

    parse-path

    (parse-path ctx)

    parse-route-name

    (parse-route-name {:keys [route-name interceptors last-handler], :as ctx})

    parse-verb

    (parse-verb ctx)

    route-name

    (route-name route)

    route-table-row

    (route-table-row opts row route)

    table-routes

    (table-routes routes)(table-routes opts routes)

    take-next-pair

    (take-next-pair argname expected-pred expected-str ctx)
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.route.definition.terse.html b/api/0.7/io.pedestal.http.route.definition.terse.html index 8a969f3..36908e3 100644 --- a/api/0.7/io.pedestal.http.route.definition.terse.html +++ b/api/0.7/io.pedestal.http.route.definition.terse.html @@ -1,8 +1,8 @@ -io.pedestal.http.route.definition.terse documentation

    io.pedestal.http.route.definition.terse

    constraint-map?

    dissoc-when

    (dissoc-when pred m)

    Dissoc those keys from m whose values in m satisfy pred.

    -

    expand-constraint

    multimethod

    Expand into additional nodes which reflect constraints and apply them to specs.

    -

    ExpandableVerbAction

    protocol

    members

    expand-verb-action

    (expand-verb-action expandable-verb-action)

    Expand expandable-verb-action into a verbose-form verb-map.

    -

    first-of

    (first-of p coll)

    flatten-terse-app-routes

    (flatten-terse-app-routes route-spec)

    Return a vector of maps that are equivalent to the terse routing syntax, but expanded for consumption by the verbose route parser.

    -

    interceptor-vector?

    map-routes->vec-routes

    (map-routes->vec-routes route-map)

    Given a map-based route description, return Pedestal’s terse, vector-based routes, with interceptors correctly setup. These generated routes can be consumed by expand-routes

    -

    preamble?

    terse-routes

    (terse-routes route-spec)

    valid-handler?

    \ No newline at end of file +io.pedestal.http.route.definition.terse documentation

    io.pedestal.http.route.definition.terse

    constraint-map?

    dissoc-when

    (dissoc-when pred m)

    Dissoc those keys from m whose values in m satisfy pred.

    +

    expand-constraint

    multimethod

    Expand into additional nodes which reflect constraints and apply them to specs.

    +

    ExpandableVerbAction

    protocol

    members

    expand-verb-action

    (expand-verb-action expandable-verb-action)

    Expand expandable-verb-action into a verbose-form verb-map.

    +

    first-of

    (first-of p coll)

    flatten-terse-app-routes

    (flatten-terse-app-routes route-spec)

    Return a vector of maps that are equivalent to the terse routing syntax, but expanded for consumption by the verbose route parser.

    +

    interceptor-vector?

    map-routes->vec-routes

    (map-routes->vec-routes route-map)

    Given a map-based route description, return Pedestal’s terse, vector-based routes, with interceptors correctly setup. These generated routes can be consumed by expand-routes

    +

    preamble?

    terse-routes

    (terse-routes route-spec)

    valid-handler?

    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.route.definition.verbose.html b/api/0.7/io.pedestal.http.route.definition.verbose.html index 445549d..ed373bf 100644 --- a/api/0.7/io.pedestal.http.route.definition.verbose.html +++ b/api/0.7/io.pedestal.http.route.definition.verbose.html @@ -1,6 +1,6 @@ -io.pedestal.http.route.definition.verbose documentation

    io.pedestal.http.route.definition.verbose

    Implementation of the verbose routing syntax.

    +io.pedestal.http.route.definition.verbose documentation

    io.pedestal.http.route.definition.verbose

    Implementation of the verbose routing syntax.

    Note that functions marked with ^:no-doc are internal, and may be converted to private in a future release.

    expand-verbose-routes

    (expand-verbose-routes route-maps)

    Expand route-maps into a routing table of route entries.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.route.html b/api/0.7/io.pedestal.http.route.html index 68a8cbb..4258db3 100644 --- a/api/0.7/io.pedestal.http.route.html +++ b/api/0.7/io.pedestal.http.route.html @@ -1,70 +1,77 @@ -io.pedestal.http.route documentation

    io.pedestal.http.route

    *print-routing-table*

    dynamic

    added in 0.7.0

    If true, then the routing table is printed to the console at startup, and when it changes.

    +io.pedestal.http.route documentation

    io.pedestal.http.route

    *print-routing-table*

    dynamic

    added in 0.7.0

    If true, then the routing table is printed to the console at startup, and when it changes.

    Defaults to dev-mode?.

    -

    decode-query-part

    (decode-query-part string)

    Decodes one key or value of URL-encoded UTF-8 characters in a URL query string.

    -

    encode-query-part

    (encode-query-part string)

    Encodes one key or value for a UTF-8 URL-encoded query string. Encodes space as +.

    -

    expand-routes

    (expand-routes route-spec)

    Given a value (the route specification), produce and return a routing table, a seq of verbose routing maps. The routing table can then be converted to a Router using a number of routing algorithms.

    +

    decode-query-part

    (decode-query-part string)

    Decodes one key or value of URL-encoded UTF-8 characters in a URL query string.

    +

    encode-query-part

    (encode-query-part string)

    Encodes one key or value for a UTF-8 URL-encoded query string. Encodes space as +.

    +

    expand-routes

    (expand-routes route-spec)

    Given a value (the route specification), produce and return a routing table, a seq of verbose routing maps. The routing table can then be converted to a Router using a number of routing algorithms.

    A route specification is any type that satisfies ExpandableRoutes; this includes Clojure vectors, maps, and sets (for terse, table, and verbose routes).

    Ensures the integrity of expanded routes (even if they’ve already been checked):

    • Constraints are correctly ordered (most specific to least specific)
    • Route names are unique
    -

    ExpandableRoutes

    protocol

    A protocol extended onto types that can be used to convert instances into a seq of verbose route maps, the routing table.

    +

    ExpandableRoutes

    protocol

    A protocol extended onto types that can be used to convert instances into a seq of verbose route maps, the routing table.

    Built-in implementations map vectors to terse-routes, sets to table-routes, and maps to map-routes->vec-routes.

    members

    -expand-routes

    (-expand-routes expandable-route-spec)

    Generate and return the routing table from a given expandable form of routing data.

    -

    form-action-for-routes

    (form-action-for-routes routes & default-options)

    Like ‘url-for-routes’ but the returned function returns a map with the keys :action, the URL string; and :method, the HTTP verb as a lower-case string. Also, the :method-param is :_method by default, so HTTP verbs other than GET and POST will be converted to POST with the actual verb in the query string.

    -

    method-param

    (method-param)(method-param query-param-or-param-path)

    Returns an interceptor that smuggles HTTP verbs through a value in the request. Must come after the interceptor that populates that value (e.g. query-params or body-params).

    +

    form-action-for-routes

    (form-action-for-routes routes & default-options)

    Like ‘url-for-routes’ but the returned function returns a map with the keys :action, the URL string; and :method, the HTTP verb as a lower-case string. Also, the :method-param is :_method by default, so HTTP verbs other than GET and POST will be converted to POST with the actual verb in the query string.

    +

    method-param

    (method-param)(method-param query-param-or-param-path)

    Returns an interceptor that smuggles HTTP verbs through a value in the request. Must come after the interceptor that populates that value (e.g. query-params or body-params).

    query-param-or-param-path may be one of two things:

    The path :query-params :_method is used by default.

    -

    parse-param-map

    (parse-param-map m)

    parse-path-params

    (parse-path-params request)

    parse-query-params

    (parse-query-params request)

    parse-query-string

    (parse-query-string string & options)

    Parses URL query string (not including the leading ‘?’) into1 a map. options are key-value pairs, valid options are:

    +

    parse-param-map

    (parse-param-map m)

    parse-path-params

    (parse-path-params request)

    parse-query-params

    (parse-query-params request)

    parse-query-string

    (parse-query-string string & options)

    Parses URL query string (not including the leading ‘?’) into1 a map. options are key-value pairs, valid options are:

    :key-fn Function to call on parameter keys (after URL decoding), returns key for the map, default converts to a keyword.

    :value-fn Function to call on the key (after passing through key-fn) and parameter value (after URL decoding), returns value for the map, default does nothing.

    -

    path-params-decoder

    An Interceptor which URL-decodes path parameters. The path parameters are in the :request map as :path-parameters.

    +

    path-params-decoder

    An Interceptor which URL-decodes path parameters. The path parameters are in the :request map as :path-parameters.

    This will only operate once per interceptor chain execution, even if it appears multiple times; this prevents failures in existing applications that upgrade to Pedestal 0.6.0, as prior releases incorrectly failed to parse path parameters. Existing applications that upgrade may have this interceptor in some routes, which could yield runtime exceptions and request failures if the interceptor is executed twice.

    -

    print-routes

    (print-routes expanded-routes)

    Prints a route table (from expand-routes) in an easier to read format.

    -

    query-params

    An interceptor which parses query-string parameters from an HTTP request into a map. Keys in the map are query-string parameter names, as keywords, and values are strings. The map is assoc’d into the request at :query-params.

    -

    router

    (router routing-table)(router routing-table router-type)

    Given the expanded routing table and, optionally, what kind of router to construct, creates and returns a router interceptor.

    +

    print-routes

    (print-routes expanded-routes)

    Prints a route table (from expand-routes) in an easier to read format.

    +

    query-params

    An interceptor which parses query-string parameters from an HTTP request into a map. Keys in the map are query-string parameter names, as keywords, and values are strings. The map is assoc’d into the request at :query-params.

    +

    router

    (router routing-table)(router routing-table router-type)

    Given the expanded routing table and, optionally, what kind of router to construct, creates and returns a router interceptor.

    router-type may be a keyword identifying a known implementation (see router-implementations), or function that accepts a routing table, and returns a Router.

    The default router type is :map-tree, which is the fastest built-in router; however, if the expanded routes contain path parameters or wildcards, the result is equivalent to the slower :prefix-tree implementation.

    -

    router-implementations

    Maps from the common router implementations (:map-tree, :prefix-tree, or :linear-search) to a router constructor function (which accepts expanded routes, and returns a Router instance).

    -

    RouterSpecification

    protocol

    members

    router-spec

    (router-spec routing-table router-ctor)

    Given a routing-table (usually, via expand-routes and a routing contructor functions, returns an interceptor which attempts to match each route against a :request in context. For the first route that matches, it will:

    +

    router-implementations

    Maps from the common router implementations (:map-tree, :prefix-tree, or :linear-search) to a router constructor function (which accepts expanded routes, and returns a Router instance).

    +

    RouterSpecification

    protocol

    members

    router-spec

    (router-spec routing-table router-ctor)

    Given a routing-table (usually, via expand-routes and a routing contructor functions, returns an interceptor which attempts to match each route against a :request in context. For the first route that matches, it will:

    • enqueue the matched route’s interceptors
    • associate the route into the context as key :route
    • associate a map of :path-params into the :request

    If no route matches, returns the context with :route nil.

    -

    routes-from

    macro

    added in 0.7.0

    (routes-from route-spec-expr)

    Wraps around an expression that provides the routing specification.

    +

    routes-from

    macro

    added in 0.7.0

    (routes-from route-spec-expr)

    Wraps around an expression that provides the routing specification.

    In production mode (the default) evaluates to the expression, unchanged.

    In development mode (see dev-mode?), evaluates to a function that, when invoked, returns the expression passed through expand-routes; this is to support a REPL workflow. This works in combination with the extension of RouterSpecification onto Fn, which requires that the returned routing specification be expanded.

    Further, when the expression is a non-local symbol, it is assumed to identify a Var holding the unexpanded routing specification; to avoid capturing the Var’s value, the expansion de-references the named Var before passing it to expand-routes.

    -

    try-routing-for

    (try-routing-for routing-table router-type path verb)

    Used for testing; constructs a router from the routing-table and router-type and performs routing on the provided path and verb (e.g., :get or :post).

    +

    try-routing-for

    (try-routing-for routing-table router-type path verb)

    Used for testing; constructs a router from the routing-table and router-type and performs routing on the provided path and verb (e.g., :get or :post).

    Returns the matched route (a map from the routing table), or nil if routing was unsuccessful.

    -

    url-for

    (url-for route-name & options)

    Used by an invoked interceptor (including a handler function) to generate URLs based on a known route name (from the routing specification), and additional data.

    +

    url-for

    (url-for route-name & options)

    Used by an invoked interceptor (including a handler function) to generate URLs based on a known route name (from the routing specification), and additional data.

    This uses a hidden dynamic variable, so it can only be invoked from request processing threads, and only after the routing interceptor has routed the request.

    The available options are as described in url-for-routes.

    -

    url-for-routes

    (url-for-routes routes & default-options)

    Returns a function that generates URL routes (as strings) from the routes table. The returned function has the signature:

    +

    url-for-routes

    (url-for-routes routes & default-options)

    Returns a function that generates URL routes (as strings) from the routes table. The returned function has the signature:

        [route-name & options]
     
    -

    Where options are key-value pairs from:

    -

    :app-name Application name specified for this route

    -

    :request The original request; it will be merged into the generated link.

    -

    :params A map of all parameters; any params not used as path parameters will be added to the query string

    -

    :path-params A map of path parameters only

    -

    :strict-path-params? A boolean, when true will throw an exception if all path-params aren’t fulfilled for the url

    -

    :query-params A map of query-string parameters only

    -

    :method-param Keyword naming the query-string parameter in which to place the HTTP method name, if it is neither GET nor POST. If nil, the HTTP method name will not be included in the query string. Default is nil.

    -

    :context A string, function that returns a string, or symbol that resolves to a function that returns a string that specifies a root context for the URL. Default is nil.

    -

    :fragment A string for the fragment part of the url.

    -

    :absolute? Boolean, whether to force an absolute URL

    -

    :scheme Keyword (:http | :https) used to override the scheme portion of the url.

    -

    :host A string used to override the host portion of the URL.

    -

    :port An integer used to override the port in the URL.

    +

    Where options are key-value pairs:

    + + + + + + + + + + + + + + + + + + + +
    Key Value Description
    :app-name String Application name specified for this route
    :request Map The original request; it will be merged into the generated link
    :params Map A map of all parameters; any params not used as path parameters will be added to the query string
    :path-params Map A map of path parameters only
    :strict-path-params? Boolean When true will throw an exception if all path-params aren’t fulfilled for the URL
    :query-params Map A map of query-string parameters only
    :method-param Keyword Names the query-string parameter in which to place the HTTP method name (used when not :get or :post)
    :context varied String, function that returns a string, or symbol that resolves to a function; specifies root context for the URL
    :fragment String The fragment part of the URL
    :absolute? Boolean True to force an absolute URL
    :scheme :http or :https Used to override the scheme portion of the URL
    :host String Used to override the host portion of the URL
    :port Integer Used to override the port in the URL

    In addition, you may supply default-options to the ‘url-for-routes’ function, which are merged with the options supplied to the returned function.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.route.linear-search.html b/api/0.7/io.pedestal.http.route.linear-search.html index 6d285dd..e7591d1 100644 --- a/api/0.7/io.pedestal.http.route.linear-search.html +++ b/api/0.7/io.pedestal.http.route.linear-search.html @@ -1,4 +1,4 @@ -io.pedestal.http.route.linear-search documentation

    io.pedestal.http.route.linear-search

    router

    (router routes)

    Given a sequence of routes, return a router which satisfies the io.pedestal.http.route.router/Router protocol.

    -
    \ No newline at end of file +io.pedestal.http.route.linear-search documentation

    io.pedestal.http.route.linear-search

    router

    (router routes)

    Given a sequence of routes, return a router which satisfies the io.pedestal.http.route.router/Router protocol.

    +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.route.map-tree.html b/api/0.7/io.pedestal.http.route.map-tree.html index af27f28..49a935c 100644 --- a/api/0.7/io.pedestal.http.route.map-tree.html +++ b/api/0.7/io.pedestal.http.route.map-tree.html @@ -1,5 +1,5 @@ -io.pedestal.http.route.map-tree documentation

    io.pedestal.http.route.map-tree

    matching-route-map

    (matching-route-map routes)

    Given the full sequence of route-maps, return a single map, keyed by path, whose value is a function matching on the req. The function takes a request, matches criteria and constraints, and returns the most specific match. This function only processes the routes if all routes are static.

    -

    router

    (router routes)

    Given a sequence of routes, return a router which satisfies the io.pedestal.http.route.router/Router protocol.

    -
    \ No newline at end of file +io.pedestal.http.route.map-tree documentation

    io.pedestal.http.route.map-tree

    matching-route-map

    (matching-route-map routes)

    Given the full sequence of route-maps, return a single map, keyed by path, whose value is a function matching on the req. The function takes a request, matches criteria and constraints, and returns the most specific match. This function only processes the routes if all routes are static.

    +

    router

    (router routes)

    Given a sequence of routes, return a router which satisfies the io.pedestal.http.route.router/Router protocol.

    +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.route.path.html b/api/0.7/io.pedestal.http.route.path.html index ef85e5a..a8dfca3 100644 --- a/api/0.7/io.pedestal.http.route.path.html +++ b/api/0.7/io.pedestal.http.route.path.html @@ -1,3 +1,3 @@ -io.pedestal.http.route.path documentation

    io.pedestal.http.route.path

    merge-path-regex

    (merge-path-regex route)

    parse-path

    (parse-path pattern)(parse-path accumulated-info pattern)

    path-regex

    (path-regex {:keys [path-parts path-constraints]})
    \ No newline at end of file +io.pedestal.http.route.path documentation

    io.pedestal.http.route.path

    merge-path-regex

    (merge-path-regex route)

    parse-path

    (parse-path pattern)(parse-path accumulated-info pattern)

    path-regex

    (path-regex {:keys [path-parts path-constraints]})
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.route.prefix-tree.html b/api/0.7/io.pedestal.http.route.prefix-tree.html index 5d8c03f..0cb66b8 100644 --- a/api/0.7/io.pedestal.http.route.prefix-tree.html +++ b/api/0.7/io.pedestal.http.route.prefix-tree.html @@ -1,10 +1,10 @@ -io.pedestal.http.route.prefix-tree documentation

    io.pedestal.http.route.prefix-tree

    add-satisfies-constraints?

    (add-satisfies-constraints? {:keys [query-constraints path-constraints], :as route})

    Given a route, add a function of the request which returns true if the request satisfies all path and query constraints.

    -

    contains-wilds?

    (contains-wilds? path-spec)

    Return true if the given path-spec contains any wildcard params or catch-alls.

    -

    create-payload-fn

    (create-payload-fn routes)

    Given a sequence of routes, return a function of a request which will return a matching route. When the returned function is called we already know that the path matches. The function only considers method, host, scheme and port and will return the most specific match.

    -

    insert

    (insert node path-spec o)

    Given a tree node, a path-spec and a payload object, return a new tree with payload inserted.

    -

    lookup

    (lookup node path)

    Given a tree node and request path, find a matching leaf node and return the path params and payload or return nil if no match is found. Returns a map with :path-params and :payload keys.

    -

    partition-wilds

    (partition-wilds path-spec)

    Given a path-spec string, return a seq of strings with wildcards and catch-alls separated into their own strings. Eats the forward slash following a wildcard.

    -

    router

    (router routes)

    Given a sequence of routes, return a router which satisfies the io.pedestal.http.route.router/Router protocol.

    -
    \ No newline at end of file +io.pedestal.http.route.prefix-tree documentation

    io.pedestal.http.route.prefix-tree

    add-satisfies-constraints?

    (add-satisfies-constraints? {:keys [query-constraints path-constraints], :as route})

    Given a route, add a function of the request which returns true if the request satisfies all path and query constraints.

    +

    contains-wilds?

    (contains-wilds? path-spec)

    Return true if the given path-spec contains any wildcard params or catch-alls.

    +

    create-payload-fn

    (create-payload-fn routes)

    Given a sequence of routes, return a function of a request which will return a matching route. When the returned function is called we already know that the path matches. The function only considers method, host, scheme and port and will return the most specific match.

    +

    insert

    (insert node path-spec o)

    Given a tree node, a path-spec and a payload object, return a new tree with payload inserted.

    +

    lookup

    (lookup node path)

    Given a tree node and request path, find a matching leaf node and return the path params and payload or return nil if no match is found. Returns a map with :path-params and :payload keys.

    +

    partition-wilds

    (partition-wilds path-spec)

    Given a path-spec string, return a seq of strings with wildcards and catch-alls separated into their own strings. Eats the forward slash following a wildcard.

    +

    router

    (router routes)

    Given a sequence of routes, return a router which satisfies the io.pedestal.http.route.router/Router protocol.

    +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.route.router.html b/api/0.7/io.pedestal.http.route.router.html index 1223095..3bacebb 100644 --- a/api/0.7/io.pedestal.http.route.router.html +++ b/api/0.7/io.pedestal.http.route.router.html @@ -1,5 +1,5 @@ -io.pedestal.http.route.router documentation

    io.pedestal.http.route.router

    Router

    protocol

    A Router is created from a routing table (see expand-routes). Each implementation of Router represents a different strategy for dispatching incoming requests, balancing a number of tradeoffs.

    +io.pedestal.http.route.router documentation

    io.pedestal.http.route.router

    Router

    protocol

    A Router is created from a routing table (see expand-routes). Each implementation of Router represents a different strategy for dispatching incoming requests, balancing a number of tradeoffs.

    members

    find-route

    (find-route this req)

    Given an incoming request, find the matching route (one route map from the routing table).

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.route.specs.html b/api/0.7/io.pedestal.http.route.specs.html index 033b998..dc22852 100644 --- a/api/0.7/io.pedestal.http.route.specs.html +++ b/api/0.7/io.pedestal.http.route.specs.html @@ -1,5 +1,5 @@ -io.pedestal.http.route.specs documentation

    io.pedestal.http.route.specs

    Clojure spec definitions related to routing descriptions and routing tables.

    +io.pedestal.http.route.specs documentation

    io.pedestal.http.route.specs

    Clojure spec definitions related to routing descriptions and routing tables.

    This namespace includes function specifications for a number of routing-related functions; specs are optional unless this namespace is required.

    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.secure-headers.html b/api/0.7/io.pedestal.http.secure-headers.html index b739848..2bdce2e 100644 --- a/api/0.7/io.pedestal.http.secure-headers.html +++ b/api/0.7/io.pedestal.http.secure-headers.html @@ -1,12 +1,12 @@ -io.pedestal.http.secure-headers documentation

    io.pedestal.http.secure-headers

    Secure header settings applied in interceptors

    +io.pedestal.http.secure-headers documentation

    io.pedestal.http.secure-headers

    Secure header settings applied in interceptors

    content-security-policy-header

    (content-security-policy-header)(content-security-policy-header options)

    Create a custom value for the Content-Security-Policy header. No arg version returns a semi-‘Strict’ or script-focused policy: object-src ‘none’; script-src ‘unsafe-inline’ ‘unsafe-eval’ ‘strict-dynamic’ https: http:; To lock your resources to only those served by your domain (subdomains not included), consider: object-src ‘none’; default-src ‘self’

    -

    content-type-header

    (content-type-header)(content-type-header value)

    Create a custom value for content-type options. No arg version returns most secure setting: nosniff

    -

    create-headers

    (create-headers)(create-headers hsts-settings frame-options-settings content-type-settings xss-protection-settings download-options-settings cross-domain-policies-settings content-security-policy-settings)

    cross-domain-policies-header

    (cross-domain-policies-header)(cross-domain-policies-header value)

    Create a custom value for the X-Permitted-Cross-Domain-Policies header. No arg version returns the most secure setting: none.

    -

    csp-map->str

    (csp-map->str options)

    download-options-header

    (download-options-header)(download-options-header value)

    Create a custom value for the X-Download-Options header. No arg version returns the most secure setting: noopen. Passing a nil value will return nil, and the header won’t be added.

    -

    frame-options-header

    (frame-options-header)(frame-options-header policy)(frame-options-header allow-from-policy origin)

    Create a custom polic value for Frame-Options header. No arg version returns most secure setting: DENY

    -

    header-names

    header-names-vec

    hsts-header

    (hsts-header)(hsts-header max-age-secs)(hsts-header max-age-secs include-subdomains?)

    Create a max-age (and optionally include subdomains) Strict-Transport header No arg version sets age at 1 year (31536000 seconds) and includes subdomains. You may want to use 1 hour (3600 secs), 1 day (86400 secs), 1 week (604800 secs), or 1 month (2628000 secs)

    -

    secure-headers

    (secure-headers)(secure-headers options)

    Options are header values, which can be generated by the helper functions here

    -

    xss-protection-header

    (xss-protection-header)(xss-protection-header value)(xss-protection-header value mode)

    Create a custom value (and optionally mode) XSS-Protection header. No arg version returns the most secure setting: 1; block.

    -
    \ No newline at end of file +

    content-type-header

    (content-type-header)(content-type-header value)

    Create a custom value for content-type options. No arg version returns most secure setting: nosniff

    +

    create-headers

    (create-headers)(create-headers hsts-settings frame-options-settings content-type-settings xss-protection-settings download-options-settings cross-domain-policies-settings content-security-policy-settings)

    cross-domain-policies-header

    (cross-domain-policies-header)(cross-domain-policies-header value)

    Create a custom value for the X-Permitted-Cross-Domain-Policies header. No arg version returns the most secure setting: none.

    +

    csp-map->str

    (csp-map->str options)

    download-options-header

    (download-options-header)(download-options-header value)

    Create a custom value for the X-Download-Options header. No arg version returns the most secure setting: noopen. Passing a nil value will return nil, and the header won’t be added.

    +

    frame-options-header

    (frame-options-header)(frame-options-header policy)(frame-options-header allow-from-policy origin)

    Create a custom polic value for Frame-Options header. No arg version returns most secure setting: DENY

    +

    header-names

    header-names-vec

    hsts-header

    (hsts-header)(hsts-header max-age-secs)(hsts-header max-age-secs include-subdomains?)

    Create a max-age (and optionally include subdomains) Strict-Transport header No arg version sets age at 1 year (31536000 seconds) and includes subdomains. You may want to use 1 hour (3600 secs), 1 day (86400 secs), 1 week (604800 secs), or 1 month (2628000 secs)

    +

    secure-headers

    (secure-headers)(secure-headers options)

    Options are header values, which can be generated by the helper functions here

    +

    xss-protection-header

    (xss-protection-header)(xss-protection-header value)(xss-protection-header value mode)

    Create a custom value (and optionally mode) XSS-Protection header. No arg version returns the most secure setting: 1; block.

    +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.servlet.html b/api/0.7/io.pedestal.http.servlet.html index 97a505d..ae9c4f9 100644 --- a/api/0.7/io.pedestal.http.servlet.html +++ b/api/0.7/io.pedestal.http.servlet.html @@ -1,6 +1,6 @@ -io.pedestal.http.servlet documentation

    io.pedestal.http.servlet

    Generic Servlet adapter that closes over its implementation functions; this dynamically creates a Servlet instance that can be used with a servlet container such as Jetty.

    +io.pedestal.http.servlet documentation

    io.pedestal.http.servlet

    Generic Servlet adapter that closes over its implementation functions; this dynamically creates a Servlet instance that can be used with a servlet container such as Jetty.

    servlet

    (servlet & {:keys [init service destroy]})

    Returns an instance of jakarta.servlet.Servlet using provided functions for its implementation. Arguments are key-value pairs of:

    :init optional, initialization function taking two arguments: the Servlet and its ServletConfig

    :service required, handler function taking three arguments: the Servlet, ServletRequest, and ServletResponse

    @@ -8,4 +8,4 @@

    The :init, :service, and :destroy options correspond to the Servlet interface methods of the same names.

    The returned servlet instance also implements the ServletConfig interface.

    Note: this function returns an instance, not a class. If you need a class with a static name (for example, to deploy to a Servlet container) use the Java class pedestal.servlet.ClojureVarServlet.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.specs.html b/api/0.7/io.pedestal.http.specs.html index 5ecb144..f7358f1 100644 --- a/api/0.7/io.pedestal.http.specs.html +++ b/api/0.7/io.pedestal.http.specs.html @@ -1,3 +1,3 @@ -io.pedestal.http.specs documentation

    io.pedestal.http.specs

    \ No newline at end of file +io.pedestal.http.specs documentation

    io.pedestal.http.specs

    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.sse.html b/api/0.7/io.pedestal.http.sse.html index 2a9307a..bd0a687 100644 --- a/api/0.7/io.pedestal.http.sse.html +++ b/api/0.7/io.pedestal.http.sse.html @@ -1,11 +1,11 @@ -io.pedestal.http.sse documentation

    io.pedestal.http.sse

    Support for Server Sent Events.

    -

    COMMENT_FIELD

    DATA_FIELD

    do-heartbeat

    (do-heartbeat channel)(do-heartbeat channel _opts)

    end-event-stream

    deprecated in 0.4.0

    (end-event-stream _)

    DEPRECATED. Given a context, clean up the event stream it represents.

    -

    EVENT_FIELD

    get-bytes

    (get-bytes s)

    ID_FIELD

    mk-data

    (mk-data name data)(mk-data name data id)

    send-event

    (send-event channel name data)(send-event channel name data id)(send-event channel name data id put-fn)

    sse-setup

    deprecated in 0.7.0

    (sse-setup & args)

    See start-event-stream. This function is for backward compatibility.

    -

    start-event-stream

    (start-event-stream stream-ready-fn)(start-event-stream stream-ready-fn heartbeat-delay)(start-event-stream stream-ready-fn heartbeat-delay bufferfn-or-n)(start-event-stream stream-ready-fn heartbeat-delay bufferfn-or-n opts)

    Returns an interceptor which will start a Server Sent Event stream with the requesting client, and set the ServletResponse to go async. After the request handling context has been paused in the Servlet thread, stream-ready-fn will be called in a future, with the resulting context from setting up the SSE event stream.

    +io.pedestal.http.sse documentation

    io.pedestal.http.sse

    Support for Server Sent Events.

    +

    COMMENT_FIELD

    DATA_FIELD

    do-heartbeat

    (do-heartbeat channel)(do-heartbeat channel _opts)

    end-event-stream

    deprecated in 0.4.0

    (end-event-stream _)

    DEPRECATED. Given a context, clean up the event stream it represents.

    +

    EVENT_FIELD

    get-bytes

    (get-bytes s)

    ID_FIELD

    mk-data

    (mk-data name data)(mk-data name data id)

    send-event

    (send-event channel name data)(send-event channel name data id)(send-event channel name data id put-fn)

    sse-setup

    deprecated in 0.7.0

    (sse-setup & args)

    See start-event-stream. This function is for backward compatibility.

    +

    start-event-stream

    (start-event-stream stream-ready-fn)(start-event-stream stream-ready-fn heartbeat-delay)(start-event-stream stream-ready-fn heartbeat-delay bufferfn-or-n)(start-event-stream stream-ready-fn heartbeat-delay bufferfn-or-n opts)

    Returns an interceptor which will start a Server Sent Event stream with the requesting client, and set the ServletResponse to go async. After the request handling context has been paused in the Servlet thread, stream-ready-fn will be called in a future, with the resulting context from setting up the SSE event stream.

    opts is a map with optional keys:

    :on-client-disconnect - A function of one argument which will be called when the client permanently disconnects.

    -

    start-stream

    (start-stream stream-ready-fn context heartbeat-delay)(start-stream stream-ready-fn context heartbeat-delay bufferfn-or-n)(start-stream stream-ready-fn context heartbeat-delay bufferfn-or-n opts)

    Starts an SSE event stream and initiates a heartbeat to keep the connection alive. stream-ready-fn will be called with a core.async channel. The application can then put maps with keys :name and :data on that channel to cause SSE events to be sent to the client. Either the client or the application may close the channel to terminate and clean up the event stream; the client closes it by closing the connection.

    +

    start-stream

    (start-stream stream-ready-fn context heartbeat-delay)(start-stream stream-ready-fn context heartbeat-delay bufferfn-or-n)(start-stream stream-ready-fn context heartbeat-delay bufferfn-or-n opts)

    Starts an SSE event stream and initiates a heartbeat to keep the connection alive. stream-ready-fn will be called with a core.async channel. The application can then put maps with keys :name and :data on that channel to cause SSE events to be sent to the client. Either the client or the application may close the channel to terminate and clean up the event stream; the client closes it by closing the connection.

    The SSE’s core.async buffer can either be a fixed buffer (n) or a 0-arity function that returns a buffer.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.http.tracing.html b/api/0.7/io.pedestal.http.tracing.html index 3bc0207..822a1be 100644 --- a/api/0.7/io.pedestal.http.tracing.html +++ b/api/0.7/io.pedestal.http.tracing.html @@ -1,9 +1,9 @@ -io.pedestal.http.tracing documentation

    io.pedestal.http.tracing

    added in 0.7.0

    HTTP request tracing based on Open Telemetry.

    +io.pedestal.http.tracing documentation

    io.pedestal.http.tracing

    added in 0.7.0

    HTTP request tracing based on Open Telemetry.

    mark-routed

    (mark-routed context route-name)(mark-routed context route-name path)

    Marks the currently active span as routed, using route-name as the name of the route and path. Does nothing if there is no span in the context.

    The path defaults to the :uri of the request.

    Returns the context.

    -

    request-tracing-interceptor

    (request-tracing-interceptor)

    A tracing interceptor traces the execution of the request. When the request is successfully routed, the trace will identify the HTTP route and route name.

    +

    request-tracing-interceptor

    (request-tracing-interceptor)

    A tracing interceptor traces the execution of the request. When the request is successfully routed, the trace will identify the HTTP route and route name.

    This interceptor should come first (or at least, early) in the incoming pipeline to ensure that all execution time is accounted for. This is less important when the OpenTelemetry Java agent is in use, at that captures the overall request processing time, from start to finish, more accurately.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.interceptor.chain.debug.html b/api/0.7/io.pedestal.interceptor.chain.debug.html index 1bfc896..7ac7909 100644 --- a/api/0.7/io.pedestal.interceptor.chain.debug.html +++ b/api/0.7/io.pedestal.interceptor.chain.debug.html @@ -1,6 +1,6 @@ -io.pedestal.interceptor.chain.debug documentation

    io.pedestal.interceptor.chain.debug

    added in 0.7.0

    Tools to help debug interceptor chain execution.

    +io.pedestal.interceptor.chain.debug documentation

    io.pedestal.interceptor.chain.debug

    added in 0.7.0

    Tools to help debug interceptor chain execution.

    debug-observer

    (debug-observer)(debug-observer options)

    Returns an observer function that logs, at debug level, the interceptor name, stage, execution id, and a description of context changes.

    The context changes are in the form of a map. The :added key is a map of key path to added values. The :removed key is a map of key path to removed values. The :changed key is a map of key path to a value change, a map of :from and :to.

    Options map:

    @@ -15,4 +15,4 @@

    The :omit option is used to prevent certain key paths from appearing in the result delta; the value for these is replaced with .... It is typically a set, but can also be a function that accepts a key path vector. It is commonly used to omit large, insecure values such as [:response :body].

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.interceptor.chain.html b/api/0.7/io.pedestal.interceptor.chain.html index 0fde456..19d20f3 100644 --- a/api/0.7/io.pedestal.interceptor.chain.html +++ b/api/0.7/io.pedestal.interceptor.chain.html @@ -1,6 +1,6 @@ -io.pedestal.interceptor.chain documentation

    io.pedestal.interceptor.chain

    Interceptor pattern. Executes a chain of Interceptor functions on a common “context” map, maintaining a virtual “stack”, with error handling and support for asynchronous execution.

    +io.pedestal.interceptor.chain documentation

    io.pedestal.interceptor.chain

    Interceptor pattern. Executes a chain of Interceptor functions on a common “context” map, maintaining a virtual “stack”, with error handling and support for asynchronous execution.

    add-observer

    added in 0.7.0

    (add-observer context observer-fn)

    Adds an observer function to the execution; observer functions are notified after each interceptor executes. If the interceptor is asynchronous, the notification occurs once the new context is conveyed through the returned channel.

    The function is passed an event map:

    @@ -19,28 +19,29 @@

    The value returned by the observer is ignored.

    If an observer throws an exception, it is associated with the interceptor, exactly as if the interceptor had thrown the exception.

    When multiple observer functions are added, they are invoked in an unspecified order.

    -

    The debug-observer function is a useful observer provided by Pedesta, which identifies interceptors and how they each modified the context.

    -

    bind

    macro

    added in 0.7.0

    (bind context var value)

    Updates the context to add a binding of the given var and value. This is a convenience on modifying the :bindings key (a map of Vars and values).

    +

    The debug-observer function is used to create an observer function; this observer can be used to log each interceptor that executes, in what phase it executes, and how it modifies the context map..

    +

    bind

    macro

    added in 0.7.0

    (bind context var value)

    Updates the context to add a binding of the given var and value. This is a convenience on modifying the :bindings key (a map of Vars and values).

    Bound values will be available in subsequent interceptors.

    -

    enqueue

    (enqueue context interceptors)

    Adds interceptors to the end of context’s execution queue. Creates the queue if necessary. Returns updated context.

    -

    enqueue*

    (enqueue* context & interceptors-and-seq)

    Like ‘enqueue’ but vararg. If the last argument is itself a sequence of interceptors, they’re unpacked and added to the context’s execution queue.

    -

    execute

    (execute context)(execute context interceptors)

    Executes a queue of Interceptors attached to the context. Context must be a map, Interceptors are added with ‘enqueue’.

    -

    An Interceptor is a map or map-like object with the keys :enter, :leave, and :error. The value of each key is a function; missing keys or nil values are ignored. When executing a context, first all the :enter functions are invoked in order. As this happens, the Interceptors are pushed on to a stack.

    +

    enqueue

    (enqueue context interceptors)

    Adds interceptors to the end of context’s execution queue. Creates the queue if necessary. Returns updated context.

    +

    enqueue*

    (enqueue* context & interceptors-and-seq)

    Like ‘enqueue’ but vararg. If the last argument is itself a sequence of interceptors, they’re unpacked and added to the context’s execution queue.

    +

    execute

    (execute context)(execute context interceptors)

    Executes a queue of Interceptors attached to the context. Context must be a map, Interceptors are added with ‘enqueue’.

    +

    An Interceptor is record with the keys :enter, :leave, and :error. The value of each key is a function; missing keys or nil values are ignored. When executing a context, first all the :enter functions are invoked in order. As this happens, the Interceptors are pushed on to a stack. Interceptor may also have a :name, which is used when logging.

    When execution reaches the end of the queue, it begins popping Interceptors off the stack and calling their :leave functions. Therefore :leave functions are called in the opposite order from :enter functions.

    Both the :enter and :leave functions are passed a single argument, the context map, and return an updated context.

    If any Interceptor function throws an exception, execution stops and begins popping Interceptors off the stack and calling their :error functions. The :error function takes two arguments: the context and an exception. It may either handle the exception, in which case the execution continues with the next :leave function on the stack; or re-throw the exception, passing control to the :error function on the stack. If the exception reaches the end of the stack without being handled, execute will throw it

    Functions may return a core.async channel; this represents an asynchronous process. When this happens, the initial call to execute returns nil immediately, with the process exepected to write an updated context into the channel when its work completes.

    +

    The function on-enter-async is used to provide a callback for when an interceptor chain execution first switches from in-thread to asynchronous execution.

    Processing continues in core.async threads - including even when a later interceptor returns an immediate context, rather than a channel.

    -

    execute-only

    deprecated in 0.7.0

    (execute-only context interceptor-key)(execute-only context interceptor-key interceptors)

    Like execute, but only processes the interceptors in a single direction, using interceptor-key (i.e. :enter, :leave) to determine which functions to call.

    +

    execute-only

    deprecated in 0.7.0

    (execute-only context interceptor-key)(execute-only context interceptor-key interceptors)

    Like execute, but only processes the interceptors in a single direction, using interceptor-key (i.e. :enter, :leave) to determine which functions to call.

    Executes a queue of Interceptors attached to the context. Context must be a map, Interceptors are added with ‘enqueue’.

    An Interceptor Record has keys :enter, :leave, and :error. The value of each key is a function; missing keys or nil values are ignored. When executing a context, all the interceptor-key functions are invoked in order. As this happens, the Interceptors are pushed on to a stack.

    -

    on-enter-async

    added in 0.7.0

    (on-enter-async context f)

    Adds a callback function to be executed if the execution goes async, which occurs when an interceptor returns a channel rather than a context map.

    +

    on-enter-async

    added in 0.7.0

    (on-enter-async context f)

    Adds a callback function to be executed if the execution goes async, which occurs when an interceptor returns a channel rather than a context map.

    The supplied function is appended to the list of such functions. All the functions are invoked, but only invoked once (a subsequent interceptor also returning a channel does not have this side effect.

    The callback function will be passed the context, but any returned value from the function is ignored.

    -

    queue

    added in 0.7.0

    (queue context)

    Returns the contents of the queue, the as-yet uninvoked interceptors during the :enter phase of chain execution.

    +

    queue

    added in 0.7.0

    (queue context)

    Returns the contents of the queue, the as-yet uninvoked interceptors during the :enter phase of chain execution.

    Prior to 0.7.0, this was achieved by accessing the :io.pedestal.interceptor.chain/queue key; future enhancements may change how the interceptor queue and stack are stored.

    -

    terminate

    (terminate context)

    Removes all remaining interceptors from context’s execution queue. This effectively short-circuits execution of Interceptors’ :enter functions and begins executing the :leave functions.

    -

    terminate-when

    (terminate-when context pred)

    Adds a predicate establishing a terminating condition for execution of the interceptor chain.

    +

    terminate

    (terminate context)

    Removes all remaining interceptors from context’s execution queue. This effectively short-circuits execution of Interceptors’ :enter functions and begins executing the :leave functions.

    +

    terminate-when

    (terminate-when context pred)

    Adds a predicate establishing a terminating condition for execution of the interceptor chain.

    pred is a function that takes a context as its argument. It will be invoked after every Interceptor’s :enter function. If pred returns logical true, execution will stop at that Interceptor.

    -

    unbind

    macro

    added in 0.7.0

    (unbind context var)

    Updates the context to remove a previous binding.

    -
    \ No newline at end of file +

    unbind

    macro

    added in 0.7.0

    (unbind context var)

    Updates the context to remove a previous binding.

    +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.interceptor.error.html b/api/0.7/io.pedestal.interceptor.error.html index 45fed96..d64355e 100644 --- a/api/0.7/io.pedestal.interceptor.error.html +++ b/api/0.7/io.pedestal.interceptor.error.html @@ -1,6 +1,6 @@ -io.pedestal.interceptor.error documentation

    io.pedestal.interceptor.error

    error-dispatch

    macro

    (error-dispatch binding-vector & match-forms)

    Return an interceptor for doing pattern-matched error-dispatch, based on the ex-data of the exception. Pedestal wraps all exceptions in ex-info on error, providing the following keys to match on: :execution-id, :stage, :interceptor, :exception-type

    +io.pedestal.interceptor.error documentation

    io.pedestal.interceptor.error

    error-dispatch

    macro

    (error-dispatch binding-vector & match-forms)

    Return an interceptor for doing pattern-matched error-dispatch, based on the ex-data of the exception. Pedestal wraps all exceptions in ex-info on error, providing the following keys to match on: :execution-id, :stage, :interceptor, :exception-type

    This allows you to match the exact exception type, per interceptor/handler, and even constrain it to a single stage (:enter, :leave, :error).

    :exception-type is a keyword of the exception’s type, for example, `:java.lang.ArithmeticException

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.interceptor.helpers.html b/api/0.7/io.pedestal.interceptor.helpers.html index 4facc8f..1d142a8 100644 --- a/api/0.7/io.pedestal.interceptor.helpers.html +++ b/api/0.7/io.pedestal.interceptor.helpers.html @@ -1,19 +1,19 @@ -io.pedestal.interceptor.helpers documentation

    io.pedestal.interceptor.helpers

    deprecated in 0.6.0

    A collection of interceptor helpers.

    +io.pedestal.interceptor.helpers documentation

    io.pedestal.interceptor.helpers

    deprecated in 0.6.0

    A collection of interceptor helpers.

    The usage of the Interceptor API is preferred over the macros defined in this namespace. Usage of the macro helpers should be limited to cases where you are porting an existing Pedestal code base.

    The helper macros predate the interceptor API and can break AOT compilation but they are maintained for backwards compatibility. Refer to https://github.com/pedestal/pedestal/issues/308 and https://github.com/pedestal/pedestal/pull/301 for more details about macro helper issues and the rationale for the Interceptor API.

    This namespace has been effectively deprecated since 2016, and is fully deprecated in release 0.6.0.

    after

    (after f)(after f & args)

    Return an interceptor which calls f on context during the leave stage.

    -

    around

    (around f1 f2)(around n f1 f2)

    Return an interceptor which calls f1 on context during the enter stage, and calls f2 on context during the leave stage.

    -

    before

    (before f)(before f & args)

    Returns an interceptor which calls f on context during the enter stage.

    -

    defafter

    macro

    (defafter macro-name__13995__auto__ & args__13996__auto__)

    Defines an after interceptor. The defined function is processed during the leave stage of interceptor execution. The implicitly created function will operate on context, and return a value used as the new context, e.g.:

    +

    around

    (around f1 f2)(around n f1 f2)

    Return an interceptor which calls f1 on context during the enter stage, and calls f2 on context during the leave stage.

    +

    before

    (before f)(before f & args)

    Returns an interceptor which calls f on context during the enter stage.

    +

    defafter

    macro

    (defafter macro-name__13995__auto__ & args__13996__auto__)

    Defines an after interceptor. The defined function is processed during the leave stage of interceptor execution. The implicitly created function will operate on context, and return a value used as the new context, e.g.:

    (defafter check-zotted context (if-not (:zotted context) (throw (ex-info “Context was not zotted!” {:context context})) context))

    -

    defaround

    macro

    (defaround n & args)

    Defines an around interceptor. The definition resembles a multiple arity function definition, however both fns are 1-arity. The first fn will be called during the enter stage, the second during the leave stage, e.g.:

    +

    defaround

    macro

    (defaround n & args)

    Defines an around interceptor. The definition resembles a multiple arity function definition, however both fns are 1-arity. The first fn will be called during the enter stage, the second during the leave stage, e.g.:

    (defaround aroundinterceptor (context(assoc context :around :entering)) (context(assoc context :around :leaving)))

    -

    defbefore

    macro

    (defbefore macro-name__13995__auto__ & args__13996__auto__)

    Defines a before interceptor. The defined function performs processing during interceptor execution during the enter stage. The implicitly created function will operate on context, and return a value used as the new context, e.g.:

    +

    defbefore

    macro

    (defbefore macro-name__13995__auto__ & args__13996__auto__)

    Defines a before interceptor. The defined function performs processing during interceptor execution during the enter stage. The implicitly created function will operate on context, and return a value used as the new context, e.g.:

    (defbefore flag-zotted context (assoc context :zotted true))

    -

    defhandler

    macro

    (defhandler macro-name__13995__auto__ & args__13996__auto__)

    Defines a handler interceptor. The definition mirrors a ring-style request handler and is made in terms of a ring style request. The implicitly created interceptor will extract the request from the context it receives, pass it to the defined function, and then associate the return value from the defined function as into context with the :response key and return context, e.g.:

    +

    defhandler

    macro

    (defhandler macro-name__13995__auto__ & args__13996__auto__)

    Defines a handler interceptor. The definition mirrors a ring-style request handler and is made in terms of a ring style request. The implicitly created interceptor will extract the request from the context it receives, pass it to the defined function, and then associate the return value from the defined function as into context with the :response key and return context, e.g.:

    (defhandler hello-name request (ring.util.response/response (str "Hello, " (-> request :params :name))))

    This is equivalent to:

    (defbefore hello-name context (let request (:request context) response (ring.util.response/response (str "Hello, " (-> request :params :name))) (assoc context :response response)))

    -

    definterceptor

    macro

    deprecated in 0.6.0

    (definterceptor name & body)

    Define an instance of an interceptor and store it in a var. An optional doc string can be provided. The body can be anything that satisfies the IntoInterceptor protocol.

    +

    definterceptor

    macro

    deprecated in 0.6.0

    (definterceptor name & body)

    Define an instance of an interceptor and store it in a var. An optional doc string can be provided. The body can be anything that satisfies the IntoInterceptor protocol.

    usage: (definterceptor encode-response “An interceptor that encodes the response as json” (on-response encode-json))

    Alternatively, you may also: (def encode-response “An interceptor that encodes the response as json” (on-response encode-json)

    -

    defmiddleware

    macro

    (defmiddleware n & args)

    Defines a middleware interceptor. The definition resembles a multiple arity function definition, however both fns are 1-arity. The first fn will be called during the enter stage with the value of the :request key in the context, the second during the leave stage with the response key in the context, e.g.:

    +

    defmiddleware

    macro

    (defmiddleware n & args)

    Defines a middleware interceptor. The definition resembles a multiple arity function definition, however both fns are 1-arity. The first fn will be called during the enter stage with the value of the :request key in the context, the second during the leave stage with the response key in the context, e.g.:

    (defmiddleware middleware-interceptor (request(assoc request :middleware :on-request)) (response(assoc response :middleware :on-response)))

    -

    defon-request

    macro

    (defon-request macro-name__13995__auto__ & args__13996__auto__)

    Defines an on-request interceptor. The definition performs pre-processing on a request during the enter stage of interceptor execution. The implicitly created interceptor will extract the request from the context it receives, pass it to the defined function, and then associate the return value from the defined function as into context with the :request key and return context, e.g.:

    +

    defon-request

    macro

    (defon-request macro-name__13995__auto__ & args__13996__auto__)

    Defines an on-request interceptor. The definition performs pre-processing on a request during the enter stage of interceptor execution. The implicitly created interceptor will extract the request from the context it receives, pass it to the defined function, and then associate the return value from the defined function as into context with the :request key and return context, e.g.:

    (defon-request parse-body-as-wibblefish request (assoc request :wibblefish-params (wibblefish-parse (:body request))))

    This is equivalent to:

    (defbefore parse-body-as-wibblefish context (let request (:request context) new-request (assoc request :wibblefish-params (wibblefish-parse (:body request))) (assoc context :request new-request)))

    -

    defon-response

    macro

    (defon-response macro-name__13995__auto__ & args__13996__auto__)

    Defines an on-response interceptor. The definition performs post processing on a response during the leave stage of interceptor execution. The implicitly created interceptor will extract the response from the context it receives, pass it to the defined function, and then associate the return value from the defined function into context with the :response key and return context, e.g.:

    +

    defon-response

    macro

    (defon-response macro-name__13995__auto__ & args__13996__auto__)

    Defines an on-response interceptor. The definition performs post processing on a response during the leave stage of interceptor execution. The implicitly created interceptor will extract the response from the context it receives, pass it to the defined function, and then associate the return value from the defined function into context with the :response key and return context, e.g.:

    (defon-response change-body-to-html response (assoc response :body (render-to-html (:body response))))

    This is equivalent to:

    (defafter change-body-to-html context (let response (:response context) new-response (assoc response :body (render-to-html (:body response))) (assoc context :response new-response)))

    -

    handler

    (handler f)(handler n f)

    Returns an interceptor which calls f on the :request value of context, and assoc’s the return value as :response into context during the enter stage.

    -

    infer-rest-interceptor-function

    (infer-rest-interceptor-function args)

    Given list args, return the rest of args that would remain after removing the elements of args that specify the form returned by infer-first-interceptor-function.

    -

    middleware

    (middleware f1 f2)(middleware n f1 f2)

    Returns an interceptor which calls f1 on the :request value of context during the enter stage, and f2 on the :response value of context during the leave stage.

    -

    on-request

    (on-request f)(on-request f & args)

    Returns an interceptor which updates the :request value of context with f during the enter stage.

    -

    on-response

    (on-response f)(on-response f & args)

    Returns an interceptor which updates the :response value of context with f during the leave stage.

    -
    \ No newline at end of file +

    handler

    (handler f)(handler n f)

    Returns an interceptor which calls f on the :request value of context, and assoc’s the return value as :response into context during the enter stage.

    +

    infer-rest-interceptor-function

    (infer-rest-interceptor-function args)

    Given list args, return the rest of args that would remain after removing the elements of args that specify the form returned by infer-first-interceptor-function.

    +

    middleware

    (middleware f1 f2)(middleware n f1 f2)

    Returns an interceptor which calls f1 on the :request value of context during the enter stage, and f2 on the :response value of context during the leave stage.

    +

    on-request

    (on-request f)(on-request f & args)

    Returns an interceptor which updates the :request value of context with f during the enter stage.

    +

    on-response

    (on-response f)(on-response f & args)

    Returns an interceptor which updates the :response value of context with f during the leave stage.

    +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.interceptor.html b/api/0.7/io.pedestal.interceptor.html index 130414d..eaeffe9 100644 --- a/api/0.7/io.pedestal.interceptor.html +++ b/api/0.7/io.pedestal.interceptor.html @@ -1,9 +1,9 @@ -io.pedestal.interceptor documentation

    io.pedestal.interceptor

    Public API for creating interceptors, and various utility fns for common interceptor creation patterns.

    +io.pedestal.interceptor documentation

    io.pedestal.interceptor

    Public API for creating interceptors, and various utility fns for common interceptor creation patterns.

    interceptor

    (interceptor t)

    Given a value, produces and returns an Interceptor (Record).

    -

    interceptor-name

    (interceptor-name n)

    Ensures that an interceptor name (to eventually be the :name key of an Interceptor) is either a keyword or nil. Generally, interceptor names should be namespace-qualified keywords.

    -

    interceptor?

    (interceptor? o)

    Returns true if object o is an instance of the Interceptor record; the result of invoking interceptor.

    -

    IntoInterceptor

    protocol

    Conversion into Interceptor, ready for execution as part of an interceptor chain.

    +

    interceptor-name

    (interceptor-name n)

    Ensures that an interceptor name (to eventually be the :name key of an Interceptor) is either a keyword or nil. Generally, interceptor names should be namespace-qualified keywords.

    +

    interceptor?

    (interceptor? o)

    Returns true if object o is an instance of the Interceptor record; the result of invoking interceptor.

    +

    IntoInterceptor

    protocol

    Conversion into Interceptor, ready for execution as part of an interceptor chain.

    members

    -interceptor

    (-interceptor t)

    Given a value, produce an Interceptor Record.

    -

    valid-interceptor?

    (valid-interceptor? o)
    \ No newline at end of file +

    valid-interceptor?

    (valid-interceptor? o)
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.interceptor.specs.html b/api/0.7/io.pedestal.interceptor.specs.html index 794df14..20cd4fb 100644 --- a/api/0.7/io.pedestal.interceptor.specs.html +++ b/api/0.7/io.pedestal.interceptor.specs.html @@ -1,3 +1,3 @@ -io.pedestal.interceptor.specs documentation

    io.pedestal.interceptor.specs

    \ No newline at end of file +io.pedestal.interceptor.specs documentation

    io.pedestal.interceptor.specs

    \ No newline at end of file diff --git a/api/0.7/io.pedestal.interceptor.trace.html b/api/0.7/io.pedestal.interceptor.trace.html index a45bd3b..6c5c364 100644 --- a/api/0.7/io.pedestal.interceptor.trace.html +++ b/api/0.7/io.pedestal.interceptor.trace.html @@ -1,8 +1,8 @@ -io.pedestal.interceptor.trace documentation

    io.pedestal.interceptor.trace

    deprecated in 0.7.0

    default-span-postprocess

    (default-span-postprocess context span)

    default-span-resolver

    (default-span-resolver context)(default-span-resolver context servlet-class)

    headers->span-context

    (headers->span-context tracer headers)

    tracing-interceptor

    deprecated in 0.7.0

    (tracing-interceptor)(tracing-interceptor opts)

    Return an Interceptor for automatically initiating a distributed trace span on every request, which is finished on leave.

    +io.pedestal.interceptor.trace documentation

    io.pedestal.interceptor.trace

    deprecated in 0.7.0

    default-span-postprocess

    (default-span-postprocess context span)

    default-span-resolver

    (default-span-resolver context)(default-span-resolver context servlet-class)

    headers->span-context

    (headers->span-context tracer headers)

    tracing-interceptor

    deprecated in 0.7.0

    (tracing-interceptor)(tracing-interceptor opts)

    Return an Interceptor for automatically initiating a distributed trace span on every request, which is finished on leave.

    Spans are automatically populated with relevant tags: http.method, http.status_code, http.uri, span.kind

    If on leave there is an :error in the context, this interceptor with log the error with the span.

    Possible options: :span-resolver - a single-arg function that is given the context and returns a started and activated span, resolving any propagated or parent span. The default resolver is io.pedestal.interceptor.trace.default-span-resolver which resolves (in order; first resolution wins): 1. Pedestal tracing values in the Context 2. OpenTracing Servlet values (if the Servlet API class is detected) 3. OpenTracing Header values 4. Nothing found - A new span is created :trace-filter - a single-arg function that is given the context and returns true if a span should be created for this request. If not set or set to nil, spans are created for every request :uri-as-span-operation? - Boolean; True if the request URI should be used as the default span name - defaults to true :default-span-operation - A string or keyword to use as the default span name if URI isn’t found or :uri-as-span-operation? is false. Defaults to ‘PedestalSpan’ :span-postprocess - A function given the context and the span, performs any necessary span cleanup tasks and returns the context

    If the trace-filter or the span-resolver return something falsey, the context is forwarded without an active span

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.log.html b/api/0.7/io.pedestal.log.html index 24739cf..636a4da 100644 --- a/api/0.7/io.pedestal.log.html +++ b/api/0.7/io.pedestal.log.html @@ -1,17 +1,17 @@ -io.pedestal.log documentation

    io.pedestal.log

    A logging wrapper around SLF4J (but adaptable to other logging systems). Primary macros are trace, debug, info, warn, and error.

    +io.pedestal.log documentation

    io.pedestal.log

    A logging wrapper around SLF4J (but adaptable to other logging systems). Primary macros are trace, debug, info, warn, and error.

    Over time, this namespace has also accumulated other visibility-related functionality, including metrics (via the Codahale library) and telemetry (via OpenTelemetry) - these protocols and functions have been deprecated in 0.7.0 and will be removed in the future.

    *mdc-context*

    dynamic

    This map is copied into the SLF4J MDC by the with-context macro.

    You are free to take control of it for MDC-related purposes as it doesn’t directly affect Pedestal’s logging implementation.

    This map also includes all options that were passed into with-context.

    -

    active-span

    deprecated in 0.7.0

    (active-span)

    Return the current active span; Returns nil if there isn’t an active span.

    -

    add-span-baggage!

    deprecated in 0.7.0

    (add-span-baggage! span m)(add-span-baggage! span k v)(add-span-baggage! span bag-k bag-v & kvs)

    counter

    deprecated in 0.7.0

    (counter metric-name delta)(counter recorder metric-name delta)

    debug

    macro

    (debug & keyvals)

    default-formatter

    (default-formatter)

    Returns the default formatter (used to convert the event map to a string) used when the :io.pedestal.log/formatter key is not present in the log event. The default is pr-str, but can be overridden via JVM property io.pedestal.log.formatter or environment variable PEDESTAL_LOG_FORMATTER.

    -

    default-recorder

    deprecated in 0.7.0

    This is the default recorder of all metrics. This value is configured by setting the JVM Property ‘io.pedestal.log.defaultMetricsRecorder’ or the environment variable ‘PEDESTAL_METRICS_RECORDER’. The value of the setting should be a namespaced symbol that resolves to a 0-arity function or nil. That function should return something that satisfies the MetricRecorder protocol. If no function is found, metrics will be reported only to JMX via a DropWizard MetricRegistry.

    -

    default-tracer

    deprecated in 0.7.0

    This is the default Tracer, registered as the OpenTracing’s GlobalTracer. This value is configured by setting the JVM Property ‘io.pedestal.log.defaultTracer’ or the environment variable ‘PEDESTAL_TRACER’. The value of the setting should be a namespaced symbol that resolves to a 0-arity function or nil. That function should return something that satisfies the TracerOrigin protocol. If no function is found, the GlobalTracer will default to the NoopTracer and GlobalTracer/isRegistered will be false.

    -

    error

    macro

    (error & keyvals)

    finish-span

    deprecated in 0.7.0

    (finish-span span)

    Given a span, finish the span and return it.

    -

    format-name

    deprecated in 0.7.0

    (format-name n)

    Format a given metric name, regardless of type, into a string

    -

    gauge

    deprecated in 0.7.0

    (gauge metric-name value-fn)(gauge recorder metric-name value-fn)

    histogram

    deprecated in 0.7.0

    (histogram metric-name value)(histogram recorder metric-name value)

    info

    macro

    (info & keyvals)

    jmx-reporter

    deprecated in 0.7.0

    (jmx-reporter registry)

    log

    (log keyvals)(log keyvals default-level)

    This function provides basic/core logging functionality as a function. You may prefer to use this if you need custom logging functionality beyond what is offered by the standard Pedestal logging macros (which in turn just call the protocols).

    +

    active-span

    deprecated in 0.7.0

    (active-span)

    Return the current active span; Returns nil if there isn’t an active span.

    +

    add-span-baggage!

    deprecated in 0.7.0

    (add-span-baggage! span m)(add-span-baggage! span k v)(add-span-baggage! span bag-k bag-v & kvs)

    counter

    deprecated in 0.7.0

    (counter metric-name delta)(counter recorder metric-name delta)

    debug

    macro

    (debug & keyvals)

    default-formatter

    (default-formatter)

    Returns the default formatter (used to convert the event map to a string) used when the :io.pedestal.log/formatter key is not present in the log event. The default is pr-str, but can be overridden via JVM property io.pedestal.log.formatter or environment variable PEDESTAL_LOG_FORMATTER.

    +

    default-recorder

    deprecated in 0.7.0

    This is the default recorder of all metrics. This value is configured by setting the JVM Property ‘io.pedestal.log.defaultMetricsRecorder’ or the environment variable ‘PEDESTAL_METRICS_RECORDER’. The value of the setting should be a namespaced symbol that resolves to a 0-arity function or nil. That function should return something that satisfies the MetricRecorder protocol. If no function is found, metrics will be reported only to JMX via a DropWizard MetricRegistry.

    +

    default-tracer

    deprecated in 0.7.0

    This is the default Tracer, registered as the OpenTracing’s GlobalTracer. This value is configured by setting the JVM Property ‘io.pedestal.log.defaultTracer’ or the environment variable ‘PEDESTAL_TRACER’. The value of the setting should be a namespaced symbol that resolves to a 0-arity function or nil. That function should return something that satisfies the TracerOrigin protocol. If no function is found, the GlobalTracer will default to the NoopTracer and GlobalTracer/isRegistered will be false.

    +

    error

    macro

    (error & keyvals)

    finish-span

    deprecated in 0.7.0

    (finish-span span)

    Given a span, finish the span and return it.

    +

    format-name

    deprecated in 0.7.0

    (format-name n)

    Format a given metric name, regardless of type, into a string

    +

    gauge

    deprecated in 0.7.0

    (gauge metric-name value-fn)(gauge recorder metric-name value-fn)

    histogram

    deprecated in 0.7.0

    (histogram metric-name value)(histogram recorder metric-name value)

    info

    macro

    (info & keyvals)

    jmx-reporter

    deprecated in 0.7.0

    (jmx-reporter registry)

    log

    (log keyvals)(log keyvals default-level)

    This function provides basic/core logging functionality as a function. You may prefer to use this if you need custom logging functionality beyond what is offered by the standard Pedestal logging macros (which in turn just call the protocols).

    Given a map of logging information, and optionally a default log-level keyword (if not found in the map) – default is :info, Determine the appropriate logger to use, determine if logging-level is enabled, format the logging message, And return the result of calling the appropriate logging function, dispatched to the logging protocols.

    Special keys within the log message: :level – A keyword, the log level to use for this message, defaults to default-level :exception – A Throwable/Exception to log :io.pedestal.log/logger – The logger to use for this message, defaults to the override-logger or the SLF4J logger :io.pedestal.log/logger-name – A String, the loggerName to use if SLF4J logger is used, defaults to *ns* which may be ‘clojure.core’ depending on execution, :io.pedestal.log/formatter – A single-arg function that when given a map, returns a String for logging, defaults to pr-str

    If using this function within a macro, you’re encouraged to merge all ‘meta’ information (like line info) into the log message map. For example:

    @@ -19,11 +19,11 @@ log-map (assoc log-map ::logger-name (name (ns-name *ns*)))) final-log-map (assoc named-log-map :line (:line (meta &form)))">named-log-map (if (::logger-name log-map) log-map (assoc log-map ::logger-name (name (ns-name ns)))) final-log-map (assoc named-log-map :line (:line (meta &form))) `(log ~final-log-map :info)))

    -

    log-level-dispatch

    log-reporter

    deprecated in 0.7.0

    (log-reporter registry)

    log-span

    deprecated in 0.7.0

    (log-span span x)(log-span span k v)(log-span span k v & kvs)

    Log to a given span, and return the span.

    +

    log-level-dispatch

    log-reporter

    deprecated in 0.7.0

    (log-reporter registry)

    log-span

    deprecated in 0.7.0

    (log-span span x)(log-span span k v)(log-span span k v & kvs)

    Log to a given span, and return the span.

    If the log message is a string, the message is logged as an info ‘message’. If the log message is a keyword, the message is logged as an ‘event’, without a message. If the log message is a Throwable, the message is logged as an ‘error’, with info extracted from the Throwable If the log message is a map, the map is logged as a series of fields/values.

    This also supports the same logging style as io.pedestal.log – with any number of log keys and values.

    You are encouraged to follow the OpenTracing semantics

    -

    LoggerSource

    protocol

    Adapts an underlying logger (such as defined by SLF4J) to io.pedestal.log.

    +

    LoggerSource

    protocol

    Adapts an underlying logger (such as defined by SLF4J) to io.pedestal.log.

    For -trace, -debug, etc., the body will typically be a String, formatted from the event map; if you write code that directly invokes these methods, but use the io.pedestal.log implementation of LoggerSource for SLF4J, then Strings will pass through unchanged, but other Clojure types will be converted to strings via pr-str.

    If you write your own LoggerSource, you understand the same requirements: io.pedestal.log’s macros will only supply a String body, but other code may pass other types.

    members

    -debug

    (-debug t body)(-debug t body throwable)

    Log a DEBUG message, and optionally handle a special Throwable/Exception related to the message. The body may be any of Clojure’s literal data types, but a map or string is encouraged.

    @@ -32,29 +32,29 @@

    -level-enabled?

    (-level-enabled? t level-key)

    Given the log level as a keyword, return a boolean if that log level is currently enabled.

    -trace

    (-trace t body)(-trace t body throwable)

    Log a TRACE message, and optionally handle a special Throwable/Exception related to the message. The body may be any of Clojure’s literal data types, but a map or string is encouraged.

    -warn

    (-warn t body)(-warn t body throwable)

    Log a WARN message, and optionally handle a special Throwable/Exception related to the message. The body may be any of Clojure’s literal data types, but a map or string is encouraged.

    -

    LoggingMDC

    protocol

    members

    -clear-mdc

    (-clear-mdc t)

    Remove all entries within the MDC and return the MDC instance.

    +

    LoggingMDC

    protocol

    members

    -clear-mdc

    (-clear-mdc t)

    Remove all entries within the MDC and return the MDC instance.

    -get-mdc

    (-get-mdc t k)(-get-mdc t k not-found)

    Given a String key and optionally a not-found value (which should be a String), lookup the key in the MDC and return the value (A String); Returns nil if the key isn’t present, or not-found if value was supplied.

    -put-mdc

    (-put-mdc t k v)

    Given a String key and a String value, Add an entry to the MDC, and return the MDC instance.

    If k is nil, the original MDC is returned.

    -remove-mdc

    (-remove-mdc t k)

    Given a String key, remove the key-value entry in the MDC if the key is present And return the MDC instance.

    -set-mdc

    (-set-mdc t m)

    Given a map (of String keys and String values), Copy all key-values from the map to the MDC and return the MDC instance.

    -

    make-logger

    (make-logger logger-name)

    Returns a logger which satisfies the LoggerSource protocol.

    -

    maybe-init-java-util-log

    (maybe-init-java-util-log)

    Invoke this once when starting your application to redirect all java.util.logging log messages to SLF4J. The current project’s dependencies must include org.slf4j/jul-to-slf4j.

    -

    mdc-context-key

    The key to use when formatting mdc-context for storage into the MDC (via -put-mdc). io.pedestal.log uses only this single key of the underlying LoggingMDC implementation.

    -

    meter

    deprecated in 0.7.0

    (meter metric-name)(meter metric-name n-events)(meter recorder metric-name n-events)

    metric-registry

    deprecated in 0.7.0

    (metric-registry & reporter-init-fns)

    Create a metric-registry. Optionally pass in single-arg functions, which when passed a registry, create, start, and return a reporter.

    -

    MetricRecorder

    protocol

    deprecated in 0.7.0

    Metrics support in the pedestal.log library has been deprecated.

    +

    make-logger

    (make-logger logger-name)

    Returns a logger which satisfies the LoggerSource protocol.

    +

    maybe-init-java-util-log

    (maybe-init-java-util-log)

    Invoke this once when starting your application to redirect all java.util.logging log messages to SLF4J. The current project’s dependencies must include org.slf4j/jul-to-slf4j.

    +

    mdc-context-key

    The key to use when formatting mdc-context for storage into the MDC (via -put-mdc). io.pedestal.log uses only this single key of the underlying LoggingMDC implementation.

    +

    meter

    deprecated in 0.7.0

    (meter metric-name)(meter metric-name n-events)(meter recorder metric-name n-events)

    metric-registry

    deprecated in 0.7.0

    (metric-registry & reporter-init-fns)

    Create a metric-registry. Optionally pass in single-arg functions, which when passed a registry, create, start, and return a reporter.

    +

    MetricRecorder

    protocol

    deprecated in 0.7.0

    Metrics support in the pedestal.log library has been deprecated.

    members

    -counter

    (-counter t metric-name delta)

    Update a single Numeric/Long metric by the delta amount

    -gauge

    (-gauge t metric-name value-fn)

    Register a single metric value, returned by a 0-arg function; This function will be called everytime the Gauge value is requested.

    -histogram

    (-histogram t metric-name value)

    Measure a distribution of Long values

    -meter

    (-meter t metric-name n-events)

    Measure the rate of a ticking metric - a meter.

    -

    override-logger

    Override of the default logger source, from symbol property io.pedestal.log.overrideLogger or environment variable PEDESTAL_LOGGER.

    -

    span

    deprecated in 0.7.0

    (span operation-name)(span operation-name parent-span)(span operation-name parent-span opts)

    Given an operation name, and optionally a parent Span, and optionally a map of options return a new Span with the operation name set, started, and active.

    +

    override-logger

    Override of the default logger source, from symbol property io.pedestal.log.overrideLogger or environment variable PEDESTAL_LOGGER.

    +

    span

    deprecated in 0.7.0

    (span operation-name)(span operation-name parent-span)(span operation-name parent-span opts)

    Given an operation name, and optionally a parent Span, and optionally a map of options return a new Span with the operation name set, started, and active.

    Options are Tracer/TraceOrigin specific but all platforms support a minimum of: :initial-tags - a map of initial tags for the span

    If the parent is not set, the span has no parent (ie: current active spans are ignored). If the parent is nil, the behavior is Tracer/TraceOrigin specific – by default, the span has no parent.

    -

    span-baggage

    deprecated in 0.7.0

    (span-baggage span)(span-baggage span k)(span-baggage span k not-found)

    span-log-error-kind

    deprecated in 0.7.0

    span-log-error-obj

    deprecated in 0.7.0

    span-log-event

    deprecated in 0.7.0

    span-log-msg

    deprecated in 0.7.0

    span-log-stack

    deprecated in 0.7.0

    spy

    macro

    (spy expr)

    Logs expr and its value at DEBUG level, returns value.

    -

    tag-span

    deprecated in 0.7.0

    (tag-span span m)(tag-span span k v)(tag-span span tag-k tag-v & kvs)

    Tag a given span.

    +

    span-baggage

    deprecated in 0.7.0

    (span-baggage span)(span-baggage span k)(span-baggage span k not-found)

    span-log-error-kind

    deprecated in 0.7.0

    span-log-error-obj

    deprecated in 0.7.0

    span-log-event

    deprecated in 0.7.0

    span-log-msg

    deprecated in 0.7.0

    span-log-stack

    deprecated in 0.7.0

    spy

    macro

    (spy expr)

    Logs expr and its value at DEBUG level, returns value.

    +

    tag-span

    deprecated in 0.7.0

    (tag-span span m)(tag-span span k v)(tag-span span tag-k tag-v & kvs)

    Tag a given span.

    Tags can be expressed as: - a single tag key and tag value - a sequence of tag-key tag-values. - a map of tag-keys -> tag-values

    -

    trace

    macro

    (trace & keyvals)

    TraceOrigin

    protocol

    deprecated in 0.7.0

    Telemetry support in the pedestal.log library has been deprecated.

    +

    trace

    macro

    (trace & keyvals)

    TraceOrigin

    protocol

    deprecated in 0.7.0

    Telemetry support in the pedestal.log library has been deprecated.

    members

    -activate-span

    (-activate-span t span)

    Given a Tracer/TraceOrigin and a span, activate the span and return the newly activated span.

    -active-span

    (-active-span t)

    Given a Tracer/TraceOrigin, return the current, active Span or nil if there isn’t an active span

    -register

    (-register t)

    Given a Tracer/TraceOrigin perform whatever steps are necessary to register that Tracer/TraceOrigin to support the creation of spans, and return the Tracer/TraceOrigin.

    @@ -62,31 +62,31 @@

    -span

    (-span t operation-name)(-span t operation-name parent)(-span t operation-name parent opts)

    Given a Tracer/TraceOrigin, an operation name, and optionally a parent Span, and a map of additional options return a new Span with the operation name set. If the parent is not set, the span has no parent (ie: current active spans are ignored).

    Additional options are platform specific, but all platforms should support the following: :initial-tags - a map of initial tags for the span

    ** The span may be started on creation but should not be activated ** This should be left to application-specific span builders.

    -

    TraceSpan

    protocol

    deprecated in 0.7.0

    Telemetry support in the pedestal.log library has been deprecated.

    +

    TraceSpan

    protocol

    deprecated in 0.7.0

    Telemetry support in the pedestal.log library has been deprecated.

    members

    -finish-span

    (-finish-span t)(-finish-span t micros)

    Given a span, finish/complete and record the span optionally setting an explicit end timestamp in microseconds, and return the span. If no timestamp is specified, now/nanoTime is used, adjusted for microseconds. Multiple calls to -finishSpan should be noops

    -set-operation-name

    (-set-operation-name t operation-name)

    Given a span and the operation name (String), set the logical operation this span represents, and return the Span.

    -tag-span

    (-tag-span t tag-key tag-value)

    Given a span, a tag key (String), and a tag value (String), Set the tag key-value pair on the span for recording, and returns the Span.

    Some trace systems support numeric, object, boolean and other values. The protocol encourages at a minimum String keys and values, but extensions of the protocols are free to make platform-specific type/arg optimizations. Some Trace platforms have semantics around tag keys/values, eg. https://github.com/opentracing/specification/blob/master/semantic_conventions.md

    -

    TraceSpanBaggage

    protocol

    deprecated in 0.7.0

    Telemetry support in the pedestal.log library has been deprecated.

    +

    TraceSpanBaggage

    protocol

    deprecated in 0.7.0

    Telemetry support in the pedestal.log library has been deprecated.

    members

    -get-baggage

    (-get-baggage t k)(-get-baggage t k not-found)

    Given a span, a baggage key, and optionally a not-found value, return the baggage value (String) for the corresponding key (if present). If the key isn’t present, return not-found or nil.

    -get-baggage-map

    (-get-baggage-map t)

    Given a span, return a Map of all baggage items.

    -set-baggage

    (-set-baggage t k v)

    Given a span, a baggage key (String) and baggage value (String), add the key and value to the Span (and any additional context holding the span). and return the Span

    Adding baggage allows keys/values to be smuggled across span boundaries, creating a powerful distributed context. Baggage is only propagated to children of the span.

    -

    TraceSpanLog

    protocol

    deprecated in 0.7.0

    Telemetry support in the pedestal.log library has been deprecated.

    +

    TraceSpanLog

    protocol

    deprecated in 0.7.0

    Telemetry support in the pedestal.log library has been deprecated.

    members

    -error-span

    (-error-span t throwable)(-error-span t throwable micros)

    Given a span, a Throwable, and optionally an explicit timestamp in microseconds, Record the error to the span as an ‘error’, attaching Message, Error.Kind and Error.Object to the span, and return the span.

    -log-span

    (-log-span t msg)(-log-span t msg micros)

    Given a span, a log message/event, and optionally an explicit timestamp in microseconds, Record the message to the span, and return the span.

    If the message is a keyword, the message is recorded as an ‘event’, otherwise message is coerced into a string and recorded as a ‘message’.

    If no timestamp is specified, now/nanoTime is used, adjusted for microseconds.

    -

    TraceSpanLogMap

    protocol

    deprecated in 0.7.0

    Telemetry support in the pedestal.log library has been deprecated.

    +

    TraceSpanLogMap

    protocol

    deprecated in 0.7.0

    Telemetry support in the pedestal.log library has been deprecated.

    members

    -log-span-map

    (-log-span-map t msg-map)(-log-span-map t msg-map micros)

    Given a span, a map of fields, and optionally an explicit timestamp in microseconds, Record the event to the span, and return the span.

    Semantic log fields can be found at: https://github.com/opentracing/specification/blob/master/semantic_conventions.md#log-fields-table

    Some Trace Recorders don’t fully support round-tripping maps – use carefully. Some Trace platforms have semantics around key/values, eg. https://github.com/opentracing/specification/blob/master/semantic_conventions.md

    -

    warn

    macro

    (warn & keyvals)

    with-context

    macro

    (with-context ctx-map & body)

    Given a map of keys/values/options and a body, Set the map into the MDC via the mdc-context binding.

    +

    warn

    macro

    (warn & keyvals)

    with-context

    macro

    (with-context ctx-map & body)

    Given a map of keys/values/options and a body, Set the map into the MDC via the mdc-context binding.

    The MDC used defaults to the SLF4J MDC unless the :io.pedestal.log/mdc option is specified (see Options).

    By default, the map is formatted into a string value and stored under the “io.pedestal” key.

    Caveats: SLF4J MDC, only maintains thread-local bindings, users are encouraged to use app-specific MDC implementations when needed.

    Since SLF4J MDC manages data on a per-thread basis, false information may be contained in the MDC if threads are recycled. Refer to the slf4j docs for more information.

    Options: :io.pedestal.log/formatter - a single-arg function that when given the map, returns a formatted string Default (via default-formatter) is pr-str :io.pedestal.log/mdc - An object that satisfies the LoggingMDC protocol Defaults to the SLF4J MDC.

    -

    with-context-kv

    macro

    deprecated in 0.7.0

    (with-context-kv k v & body)

    Given a key, value, and body, associates the key-value pair into the mdc-context only for the scope/execution of body, and formats and stores the mdc-context into the SLF4J MDC under the ‘io.pedestal’ key (via io.pedestal.log/mdc-context-key) using the formatter (from the :io.pedestal.log/formatter option, or default-formatter.

    +

    with-context-kv

    macro

    deprecated in 0.7.0

    (with-context-kv k v & body)

    Given a key, value, and body, associates the key-value pair into the mdc-context only for the scope/execution of body, and formats and stores the mdc-context into the SLF4J MDC under the ‘io.pedestal’ key (via io.pedestal.log/mdc-context-key) using the formatter (from the :io.pedestal.log/formatter option, or default-formatter.

    This macro has been deprecated, use with-context instead: - This macro expands to nil if the provided k is nil; this is likely a day-1 bug - This macro bypasses the LoggingMDC protocol, invoking SLF4J methods directly

    -
    \ No newline at end of file + \ No newline at end of file diff --git a/api/0.7/io.pedestal.metrics.codahale.html b/api/0.7/io.pedestal.metrics.codahale.html index 01ade96..de3e0ee 100644 --- a/api/0.7/io.pedestal.metrics.codahale.html +++ b/api/0.7/io.pedestal.metrics.codahale.html @@ -1,8 +1,8 @@ -io.pedestal.metrics.codahale documentation

    io.pedestal.metrics.codahale

    deprecated in 0.7.0

    Extends the MetricSource SPI to the Codahale metrics library supplied by DropWizard.

    +io.pedestal.metrics.codahale documentation

    io.pedestal.metrics.codahale

    deprecated in 0.7.0

    Extends the MetricSource SPI to the Codahale metrics library supplied by DropWizard.

    Note that Codahale metrics do not have an equivalent concept to tags, so any tags are ignored.

    This exists to make it possible to continue using Codahale metrics (the standard through Pedestal 0.6) with Pedestal 0.7.

    -

    default-registry

    (default-registry)

    get-counter

    (get-counter source metric-name)

    get-gauge

    (get-gauge source metric-name)

    get-timer

    (get-timer source metric-name)

    MetricRegistrySource

    protocol

    members

    metric-registry

    (metric-registry source)

    Returns the underlying MetricRegistry from a MetricSource.

    +

    default-registry

    (default-registry)

    get-counter

    (get-counter source metric-name)

    get-gauge

    (get-gauge source metric-name)

    get-timer

    (get-timer source metric-name)

    MetricRegistrySource

    protocol

    members

    metric-registry

    (metric-registry source)

    Returns the underlying MetricRegistry from a MetricSource.

    This is primarily intended for tests.

    -

    wrap-registry

    (wrap-registry registry)
    \ No newline at end of file +

    wrap-registry

    (wrap-registry registry)
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.metrics.html b/api/0.7/io.pedestal.metrics.html index c21ed5f..53e6095 100644 --- a/api/0.7/io.pedestal.metrics.html +++ b/api/0.7/io.pedestal.metrics.html @@ -1,21 +1,21 @@ -io.pedestal.metrics documentation

    io.pedestal.metrics

    Metrics functionality, built on the metrics SPI (service provider interface).

    +io.pedestal.metrics documentation

    io.pedestal.metrics

    Metrics functionality, built on the metrics SPI (service provider interface).

    *default-metric-source*

    dynamic

    The default metric source, used when a specific metric source is not specified.

    This may itself be nil, in which case default no-op behavior will occur.

    -

    advance-counter

    (advance-counter metric-name attributes amount)(advance-counter metric-source metric-name attributes amount)

    Increments a counter metric by a numeric amount (which should be positive).

    +

    advance-counter

    (advance-counter metric-name attributes amount)(advance-counter metric-source metric-name attributes amount)

    Increments a counter metric by a numeric amount (which should be positive).

    Returns nil.

    -

    counter

    (counter metric-name attributes)(counter metric-source metric-name attributes)

    Finds or creates a counter metric with the given metric name.

    +

    counter

    (counter metric-name attributes)(counter metric-source metric-name attributes)

    Finds or creates a counter metric with the given metric name.

    Returns a function used to increment the counter. Invoked with no arguments, increments the counter by 1, or with a single numeric argument, increments the counter by that amount.

    -

    gauge

    (gauge metric-name attributes value-fn)(gauge metric-source metric-name attributes value-fn)

    Creates a gauge that obtains its metric values from value-fn, which must return a number. Does nothing if a gauge with that name already exists.

    +

    gauge

    (gauge metric-name attributes value-fn)(gauge metric-source metric-name attributes value-fn)

    Creates a gauge that obtains its metric values from value-fn, which must return a number. Does nothing if a gauge with that name already exists.

    Returns nil.

    -

    histogram

    (histogram metric-name attributes)(histogram metric-source metric-name attributes)

    Creates a histogram (sometimes called a distribution summary), which tracks the number of events and a dimension for each event; internally, distributes different events to various bucket ranges, yielding a histogram of sizes of the event; a comment example is to use a histogram to track the size of incoming requests or outgoing responses.

    +

    histogram

    (histogram metric-name attributes)(histogram metric-source metric-name attributes)

    Creates a histogram (sometimes called a distribution summary), which tracks the number of events and a dimension for each event; internally, distributes different events to various bucket ranges, yielding a histogram of sizes of the event; a comment example is to use a histogram to track the size of incoming requests or outgoing responses.

    Returns a function that records the dimension of an event.

    -

    increment-counter

    (increment-counter metric-name attributes)(increment-counter metric-source metric-name attributes)

    Increments a counter metric by 1.

    +

    increment-counter

    (increment-counter metric-name attributes)(increment-counter metric-source metric-name attributes)

    Increments a counter metric by 1.

    Returns nil.

    -

    timed

    macro

    (timed metric-name attributes & body)

    Obtains and starts a timer, then executes the body adding a (try … finally) block to stop the timer, using the *default-metric-source*.

    -

    timed*

    macro

    (timed* metric-source metric-name attributes & body)

    Variant of timed when using a specific metric source.

    -

    timer

    (timer metric-name attributes)(timer metric-source metric-name attributes)

    Creates a timer and return the timer’s trigger function. Invoking the trigger starts tracking execution duration, and returns another function that stops the timer and records the elapsed duration.

    +

    timed

    macro

    (timed metric-name attributes & body)

    Obtains and starts a timer, then executes the body adding a (try … finally) block to stop the timer, using the *default-metric-source*.

    +

    timed*

    macro

    (timed* metric-source metric-name attributes & body)

    Variant of timed when using a specific metric source.

    +

    timer

    (timer metric-name attributes)(timer metric-source metric-name attributes)

    Creates a timer and return the timer’s trigger function. Invoking the trigger starts tracking execution duration, and returns another function that stops the timer and records the elapsed duration.

    The stop timer function is idempotent; only the first call records a duration.

    Internally, timers measure elapsed nanosecond time.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.metrics.otel.html b/api/0.7/io.pedestal.metrics.otel.html index 54be1e6..ec50245 100644 --- a/api/0.7/io.pedestal.metrics.otel.html +++ b/api/0.7/io.pedestal.metrics.otel.html @@ -1,6 +1,6 @@ -io.pedestal.metrics.otel documentation

    io.pedestal.metrics.otel

    Default metrics implementation based on OpenTelemetry.

    +io.pedestal.metrics.otel documentation

    io.pedestal.metrics.otel

    Default metrics implementation based on OpenTelemetry.

    wrap-meter

    (wrap-meter meter)(wrap-meter meter time-source-fn)

    Wraps a Meter instance as a MetricSource.

    time-source-fn: used for testing, returns the current time in nanoseconds; used with timers.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.metrics.spi.html b/api/0.7/io.pedestal.metrics.spi.html index bb886b4..c6d474b 100644 --- a/api/0.7/io.pedestal.metrics.spi.html +++ b/api/0.7/io.pedestal.metrics.spi.html @@ -1,6 +1,6 @@ -io.pedestal.metrics.spi documentation

    io.pedestal.metrics.spi

    Service Provider Interface for metrics providers; protocols that providers should expose and implement.

    +io.pedestal.metrics.spi documentation

    io.pedestal.metrics.spi

    Service Provider Interface for metrics providers; protocols that providers should expose and implement.

    MetricSource

    protocol

    Provides methods to find or create counters, timers, and gauges.

    Metrics are created using a metric-name (which can be a string, keyword, or symbol) and attributes (which may be nil). attributes are used to configure and qualify the metric (for example, a request counter may have attributes to identify the URL of the request).

    Attributes keys are converted to string; for keywords, the leading : is stripped off.

    @@ -18,4 +18,4 @@

    The function is passed a value, to record that value as a new event that will be included in the distribution summary.

    timer

    (timer source metric-name attributes)

    Finds or creates a timer, returning the timer’s trigger function.

    When invoked, the trigger function starts a timer and returns a new function that stops the timer.

    -
    \ No newline at end of file + \ No newline at end of file diff --git a/api/0.7/io.pedestal.service-tools.dev.html b/api/0.7/io.pedestal.service-tools.dev.html index d182797..468bd06 100644 --- a/api/0.7/io.pedestal.service-tools.dev.html +++ b/api/0.7/io.pedestal.service-tools.dev.html @@ -1,7 +1,7 @@ -io.pedestal.service-tools.dev documentation

    io.pedestal.service-tools.dev

    deprecated in 0.7.0

    Development utilities for Pedestal.

    +io.pedestal.service-tools.dev documentation

    io.pedestal.service-tools.dev

    deprecated in 0.7.0

    Development utilities for Pedestal.

    Deprecated with no replacement; to be removed in a later release.

    watch

    (watch)(watch src-paths)

    Watches a list of directories for file changes, reloading them as necessary.

    -

    watch-routes-fn

    (watch-routes-fn routes-var)(watch-routes-fn routes-var src-paths)

    Given a routes var and optionally a vector of paths to watch, return a function suitable for a service’s :routes entry, that reloads routes on source file changes.

    -
    \ No newline at end of file +

    watch-routes-fn

    (watch-routes-fn routes-var)(watch-routes-fn routes-var src-paths)

    Given a routes var and optionally a vector of paths to watch, return a function suitable for a service’s :routes entry, that reloads routes on source file changes.

    +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.service-tools.war.html b/api/0.7/io.pedestal.service-tools.war.html index 2f27b80..3bdf5a7 100644 --- a/api/0.7/io.pedestal.service-tools.war.html +++ b/api/0.7/io.pedestal.service-tools.war.html @@ -1,8 +1,8 @@ -io.pedestal.service-tools.war documentation

    io.pedestal.service-tools.war

    deprecated in 0.7.0

    app-server-ns

    (app-server-ns opts)

    default-pedestal-manifest

    dir-entry

    (dir-entry war opts war-root dir-path)

    file-entry

    (file-entry war opts war-path file)

    in-war-path

    (in-war-path war-path root file)

    make-manifest

    (make-manifest)(make-manifest manifest-map)

    make-web-xml

    (make-web-xml opts)

    Given a map of options, return a string of XML - the web.xml for the service/WAR.

    +io.pedestal.service-tools.war documentation

    io.pedestal.service-tools.war

    deprecated in 0.7.0

    app-server-ns

    (app-server-ns opts)

    default-pedestal-manifest

    dir-entry

    (dir-entry war opts war-root dir-path)

    file-entry

    (file-entry war opts war-path file)

    in-war-path

    (in-war-path war-path root file)

    make-manifest

    (make-manifest)(make-manifest manifest-map)

    make-web-xml

    (make-web-xml opts)

    Given a map of options, return a string of XML - the web.xml for the service/WAR.

    Available options and default values :web-xml - a slurpable path, which is returned as the web.xml string. NOTE: All other options will be ignored. :servlet-description “Pedestal HTTP Servlet” :servlet-display-name - defaults to :servlet-description :servlet-name “PedestalServlet” :servlet-class “io.pedestal.servlet.ClojureVarServlet” :url-patterns “/*” :server-ns - Requires there to be fns servlet-init servlet-service servlet-destroy

    -

    manifest-str

    (manifest-str manifest-map)

    Given a map of manifest keys/values, Return a string of the single Manifest contents

    -

    skip-file?

    (skip-file? file war-path exclusions)

    string-input-stream

    (string-input-stream s)

    Returns a ByteArrayInputStream for the given String.

    -

    war

    (war opts)(war opts war-name-str)

    Create a PedestalService.war file. Optionally pass in a war file name. Various options are supported via the opt map :target-path - where the war will be saved; defaults to “.” :manifest - a map of override/additional Manifest entries; keys and values are both strings :compile-path - an optional, additional path of compiled resources to include :resource-paths - a vector of all additional sources, resources, war-resources to include :war-exclusions - a vector of regex strings; patterns of file names to exclude in the war

    -

    war-file-path

    (war-file-path target-dir war-name)

    write-entry

    (write-entry war war-path entry)

    write-war

    (write-war opts war-path & postprocess-fns)
    \ No newline at end of file +

    manifest-str

    (manifest-str manifest-map)

    Given a map of manifest keys/values, Return a string of the single Manifest contents

    +

    skip-file?

    (skip-file? file war-path exclusions)

    string-input-stream

    (string-input-stream s)

    Returns a ByteArrayInputStream for the given String.

    +

    war

    (war opts)(war opts war-name-str)

    Create a PedestalService.war file. Optionally pass in a war file name. Various options are supported via the opt map :target-path - where the war will be saved; defaults to “.” :manifest - a map of override/additional Manifest entries; keys and values are both strings :compile-path - an optional, additional path of compiled resources to include :resource-paths - a vector of all additional sources, resources, war-resources to include :war-exclusions - a vector of regex strings; patterns of file names to exclude in the war

    +

    war-file-path

    (war-file-path target-dir war-name)

    write-entry

    (write-entry war war-path entry)

    write-war

    (write-war opts war-path & postprocess-fns)
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.telemetry.otel-global-init.html b/api/0.7/io.pedestal.telemetry.otel-global-init.html index 4ee93e7..89f9303 100644 --- a/api/0.7/io.pedestal.telemetry.otel-global-init.html +++ b/api/0.7/io.pedestal.telemetry.otel-global-init.html @@ -1,6 +1,6 @@ -io.pedestal.telemetry.otel-global-init documentation

    io.pedestal.telemetry.otel-global-init

    added in 0.7.0

    Uses GlobalOpenTelemetry to provide defaults for metrics source and tracing source.

    +io.pedestal.telemetry.otel-global-init documentation

    io.pedestal.telemetry.otel-global-init

    added in 0.7.0

    Uses GlobalOpenTelemetry to provide defaults for metrics source and tracing source.

    metric-source

    (metric-source)

    Wraps the meter obtained from GlobalOpenTelemetry, with an instrumentation scope name of io.pedestal.metrics.

    -

    tracing-source

    (tracing-source)

    Returns the tracer obtained from GlobalOpenTelementry, with an instrumentation scope name of io.pedestal.tracing.

    -
    \ No newline at end of file +

    tracing-source

    (tracing-source)

    Returns the tracer obtained from GlobalOpenTelementry, with an instrumentation scope name of io.pedestal.tracing.

    +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.test.html b/api/0.7/io.pedestal.test.html index 6ec6d72..9635494 100644 --- a/api/0.7/io.pedestal.test.html +++ b/api/0.7/io.pedestal.test.html @@ -1,11 +1,11 @@ -io.pedestal.test documentation

    io.pedestal.test

    Pedestal testing utilities to simplify working with pedestal apps.

    +io.pedestal.test documentation

    io.pedestal.test

    Pedestal testing utilities to simplify working with pedestal apps.

    disable-routing-table-output-fixture

    added in 0.7.0

    (disable-routing-table-output-fixture f)

    A test fixture that disables printing of the routing table, even when development mode is enabled. It also disables ANSI colors in any Pedestal console output (such as deprecation warnings).

    -

    parse-url

    (parse-url url)

    raw-response-for

    (raw-response-for interceptor-service-fn verb url & options)

    Return a ring response map for an HTTP request of type verb against url url, when applied to interceptor-service-fn. Useful for integration testing pedestal applications and getting all relevant middlewares invoked, including ones which integrate with the servlet infrastructure. The response body will be returned as a ByteArrayOutputStream. Options:

    +

    parse-url

    (parse-url url)

    raw-response-for

    (raw-response-for interceptor-service-fn verb url & options)

    Return a ring response map for an HTTP request of type verb against url url, when applied to interceptor-service-fn. Useful for integration testing pedestal applications and getting all relevant middlewares invoked, including ones which integrate with the servlet infrastructure. The response body will be returned as a ByteArrayOutputStream. Options:

    :body : An optional string that is the request body. :headers : An optional map that are the headers

    -

    response-for

    (response-for interceptor-service-fn verb url & options)

    Return a ring response map for an HTTP request of type verb against url url, when applied to interceptor-service-fn. Useful for integration testing pedestal applications and getting all relevant middlewares invoked, including ones which integrate with the servlet infrastructure. The response body will be converted to a UTF-8 string. Options:

    +

    response-for

    (response-for interceptor-service-fn verb url & options)

    Return a ring response map for an HTTP request of type verb against url url, when applied to interceptor-service-fn. Useful for integration testing pedestal applications and getting all relevant middlewares invoked, including ones which integrate with the servlet infrastructure. The response body will be converted to a UTF-8 string. Options:

    :body : An optional string that is the request body. :headers : An optional map that are the headers

    -

    servlet-response-for

    (servlet-response-for interceptor-service-fn verb url & args)

    Return a ring response map for an HTTP request of type verb against url url, when applied to interceptor-service-fn. Useful for integration testing pedestal applications and getting all relevant middlewares invoked, including ones which integrate with the servlet infrastructure.

    -

    test-servlet-response

    (test-servlet-response)

    Returns a mock servlet response with a ServletOutputStream over a ByteArrayOutputStream. Captures the ByteArrayOutputStream in metadata. All headers set will swap a headers map held in an atom, also held in metadata.

    -

    test-servlet-response-body

    (test-servlet-response-body test-servlet-response)

    test-servlet-response-headers

    (test-servlet-response-headers test-servlet-response)

    test-servlet-response-status

    (test-servlet-response-status test-servlet-response)

    TestRequestBody

    protocol

    members

    ->servlet-input-stream

    (->servlet-input-stream input)
    \ No newline at end of file +

    servlet-response-for

    (servlet-response-for interceptor-service-fn verb url & args)

    Return a ring response map for an HTTP request of type verb against url url, when applied to interceptor-service-fn. Useful for integration testing pedestal applications and getting all relevant middlewares invoked, including ones which integrate with the servlet infrastructure.

    +

    test-servlet-response

    (test-servlet-response)

    Returns a mock servlet response with a ServletOutputStream over a ByteArrayOutputStream. Captures the ByteArrayOutputStream in metadata. All headers set will swap a headers map held in an atom, also held in metadata.

    +

    test-servlet-response-body

    (test-servlet-response-body test-servlet-response)

    test-servlet-response-headers

    (test-servlet-response-headers test-servlet-response)

    test-servlet-response-status

    (test-servlet-response-status test-servlet-response)

    TestRequestBody

    protocol

    members

    ->servlet-input-stream

    (->servlet-input-stream input)
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.tracing.html b/api/0.7/io.pedestal.tracing.html index ff221d7..fb9ed51 100644 --- a/api/0.7/io.pedestal.tracing.html +++ b/api/0.7/io.pedestal.tracing.html @@ -1,16 +1,16 @@ -io.pedestal.tracing documentation

    io.pedestal.tracing

    added in 0.7.0

    Wrappers around Open Telemetry tracing.

    +io.pedestal.tracing documentation

    io.pedestal.tracing

    added in 0.7.0

    Wrappers around Open Telemetry tracing.

    *context*

    dynamic

    The active OpenTelemetry context used as the parent of any created spans. If nil, then the span is created with the OpenTelemetry’s default current context.

    This is designed to be bound when a span is created so that new spans created subsequently in other threads (typically, asynchronous execution) can connect to the appropriate context. In those cases, OpenTelemetry’s current context is not always accurate, as it is stored in a thread-local variable.

    -

    *tracing-source*

    dynamic

    add-attribute

    (add-attribute span attribute-key attribute-value)

    Adds an attribute to a span, typically, to record response attributes such as the status code. This should not be called after the span has ended.

    -

    as-root

    (as-root builder)

    Identifies the new span as a root span, with no parent. When this is not called, and span is active in the Open Telemetry context, the active span will be the parent of the new span when the span is started.

    -

    create-span

    (create-span operation-name attributes)(create-span tracing-source operation-name attributes)

    Creates a new span builder, which allows configuration of the span prior to starting it.

    -

    end-span

    (end-span span)

    Ends the span, which will set its termination time to current time. Every started span must be ended.

    +

    *tracing-source*

    dynamic

    add-attribute

    (add-attribute span attribute-key attribute-value)

    Adds an attribute to a span, typically, to record response attributes such as the status code. This should not be called after the span has ended.

    +

    as-root

    (as-root builder)

    Identifies the new span as a root span, with no parent. When this is not called, and span is active in the Open Telemetry context, the active span will be the parent of the new span when the span is started.

    +

    create-span

    (create-span operation-name attributes)(create-span tracing-source operation-name attributes)

    Creates a new span builder, which allows configuration of the span prior to starting it.

    +

    end-span

    (end-span span)

    Ends the span, which will set its termination time to current time. Every started span must be ended.

    Returns nil.

    -

    make-context-current

    (make-context-current context)

    Makes the context the current context, returning a no-args function to close the scope (restoring the prior current scope).

    -

    make-span-context

    (make-span-context span)

    Creates a Context with the current context and the provided span.

    -

    record-exception

    (record-exception span e)

    rename-span

    (rename-span span span-name)

    set-status-code

    (set-status-code span status-code)

    Set the status code of the span to either :ok, :error, or :unset.

    -

    start

    (start builder)

    Builds the span from the span builder, starting and returning it.

    -

    with-kind

    (with-kind builder kind)

    Updates the span builder to label the new span with a kind (:internal, :server, :client, :producer, or :consumer).

    -
    \ No newline at end of file +

    make-context-current

    (make-context-current context)

    Makes the context the current context, returning a no-args function to close the scope (restoring the prior current scope).

    +

    make-span-context

    (make-span-context span)

    Creates a Context with the current context and the provided span.

    +

    record-exception

    (record-exception span e)

    rename-span

    (rename-span span span-name)

    set-status-code

    (set-status-code span status-code)

    Set the status code of the span to either :ok, :error, or :unset.

    +

    start

    (start builder)

    Builds the span from the span builder, starting and returning it.

    +

    with-kind

    (with-kind builder kind)

    Updates the span builder to label the new span with a kind (:internal, :server, :client, :producer, or :consumer).

    +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.tracing.spi.html b/api/0.7/io.pedestal.tracing.spi.html index 2c4803e..f05d279 100644 --- a/api/0.7/io.pedestal.tracing.spi.html +++ b/api/0.7/io.pedestal.tracing.spi.html @@ -1,5 +1,5 @@ -io.pedestal.tracing.spi documentation

    io.pedestal.tracing.spi

    Defines the TracingSource protocol, and provides implementations on nil and on OpenTelemetry’s Tracer.

    +io.pedestal.tracing.spi documentation

    io.pedestal.tracing.spi

    Defines the TracingSource protocol, and provides implementations on nil and on OpenTelemetry’s Tracer.

    TracingSource

    protocol

    members

    create-span

    (create-span this operation-name attributes)

    Creates a new SpanBuilder, from which a Span can be created; additional functions in io.pedestal.telemetry allow the span to be configured prior to being activated.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.websocket.html b/api/0.7/io.pedestal.websocket.html index 6c8aee9..af88959 100644 --- a/api/0.7/io.pedestal.websocket.html +++ b/api/0.7/io.pedestal.websocket.html @@ -1,6 +1,6 @@ -io.pedestal.websocket documentation

    io.pedestal.websocket

    add-endpoint

    (add-endpoint container path ws-endpoint-map)

    Adds a WebSocket endpoint to a ServerContainer.

    +io.pedestal.websocket documentation

    io.pedestal.websocket

    add-endpoint

    (add-endpoint container path ws-endpoint-map)

    Adds a WebSocket endpoint to a ServerContainer.

    The path provides the mapping to the endpoint, and must start with a slash.

    The ws-endpoint-map defines callbacks and configuration for the endpoint.

    When a connection is started for the endpoint, the :on-open callback is invoked; the return value is saved as the “session object” which is then passed to the remaining callbacks as the first function argument.

    @@ -15,14 +15,20 @@
    Passed a text message as a single String.
    :on-binary (Object, java.nio.ByteBuffer)
    Passed a binary message as a single ByteBuffer.
    +
    :configure (jakarta.websocket.server.ServerEndpointConfig.Builder)
    +
    Called at initialization time to perform any extra configuration of the endpoint (optional)
    +
    :subprotocols (vector of String, optional)
    +
    Configures the subprotocols of the endpoint
    +
    :idle-timeout-ms (long)
    +
    Time in milliseconds before an idle websocket is automatically closed.

    All callbacks are optional. The :on-open callback is critical, as it performs all the one-time setup for the WebSocket connection. The on-open-start-ws-connection function is a good starting place.

    -

    add-endpoints

    (add-endpoints container websockets-map)

    Adds all websocket endpoints in the path-map.

    -

    on-open-start-ws-connection

    (on-open-start-ws-connection opts)

    Returns an :on-open callback for add-endpoint, using start-ws-connection to do the actual work.

    -

    start-ws-connection

    (start-ws-connection ws-session opts)

    Starts a simple websocket connection for the given session and config.

    +

    add-endpoints

    (add-endpoints container websockets-map)

    Adds all websocket endpoints in the path-map.

    +

    on-open-start-ws-connection

    (on-open-start-ws-connection opts)

    Returns an :on-open callback for add-endpoint, using start-ws-connection to do the actual work.

    +

    start-ws-connection

    (start-ws-connection ws-session opts)

    Starts a simple websocket connection for the given session and config.

    Returns a channel used to send messages to the client.

    The values written to the channel are either a payload (a String, ByteBuffer, or some object that satisfies the WebSocketSendAsync protocol) or is a tuple of a payload and a response channel.

    When the response channel is non-nil, the result of the message send is written to it: Either the keyword :success, or an Exception thrown when attempting to send the message.

    Options: :send-buffer-or-n - used to create the channel, defaults to 10.

    -

    WebSocketSendAsync

    protocol

    members

    ws-send-async

    (ws-send-async msg remote-endpoint)

    Sends msg to remote-endpoint. Returns a promise channel from which the result can be taken.

    -
    \ No newline at end of file +

    WebSocketSendAsync

    protocol

    members

    ws-send-async

    (ws-send-async msg remote-endpoint)

    Sends msg to remote-endpoint. Returns a promise channel from which the result can be taken.

    +
    \ No newline at end of file diff --git a/api/0.7/io.pedestal.websocket.specs.html b/api/0.7/io.pedestal.websocket.specs.html index f77a050..90a7c00 100644 --- a/api/0.7/io.pedestal.websocket.specs.html +++ b/api/0.7/io.pedestal.websocket.specs.html @@ -1,3 +1,3 @@ -io.pedestal.websocket.specs documentation

    io.pedestal.websocket.specs

    \ No newline at end of file +io.pedestal.websocket.specs documentation

    io.pedestal.websocket.specs

    \ No newline at end of file