Liking cljdoc? Tell your friends :D

duckula.handler

Default Duckula handler. It talks JSON but can validate requests with provided Avro schemas

Default Duckula handler. It talks JSON
but can validate requests with provided Avro schemas
raw docstring

buildclj

(build config)

Sort of a router, but does validation. Config has to have the form of: { "/some/route" {:handler ring.rquest.handler/function :response "path/to/avro/response/Schema" :request "path/to/avro/request/Schema"} ; .. and more "/no/validation" {:handler ring.req.handler/no-validation} } Handler assumes that requests use application/json for input and output as content types. For 100% avro input/input we'd need a slightly different builder (and ring middlewares). It depends on a component implementing duckula.prococol/Monitoring protocol

  • request count (success, error, failure)
  • request timing
  • track exceptions
Sort of a router, but does validation.
Config has to have the form of:
{
"/some/route" {:handler ring.rquest.handler/function
                 :response "path/to/avro/response/Schema"
                 :request "path/to/avro/request/Schema"}
; .. and more
"/no/validation" {:handler ring.req.handler/no-validation}
}
Handler assumes that requests use application/json for input and output as content types.
For 100% avro input/input we'd need a slightly different builder (and ring middlewares).
It depends on a component implementing  duckula.prococol/Monitoring protocol
- request count (success, error, failure)
- request timing
- track exceptions
sourceraw docstring

build-metric-keysclj

(build-metric-keys {:keys [endpoints prefix] :as config})

For each endpoint it constructs a list of metric keys to be used when tracking timing, rates and errors Example for name test-api and /some/endpoint it will create test-api.some.endpoint test-api.some.endpoint.success test-api.some.endpoint.error test-api.some.endpoint.failure

For each endpoint it constructs a list of metric keys
to be used when tracking timing, rates and errors
Example for name test-api and /some/endpoint it will create
test-api.some.endpoint
test-api.some.endpoint.success
test-api.some.endpoint.error
test-api.some.endpoint.failure
sourceraw docstring

build-route-mapclj

(build-route-map {:keys [prefix endpoints] :as config})

Turns static config (documented below) into a map of function maps:

  • request handler
  • request input validator
  • request output validator Validators use Avro to ensure passed in data is ok
Turns static config (documented below) into a map of function maps:
- request handler
- request input validator
- request output validator
Validators use Avro to ensure passed in data is ok
sourceraw docstring

not-found-404clj

(not-found-404 & _)
source

not-found-metricsclj

source

use-kebab-case?clj

(use-kebab-case? {:keys [mangle-names? kebab-case-names?]})
source

validate-with-tagclj

(validate-with-tag tag validator-fn input monitoring)

Runs validation function and re-throws the exception with extra info attached. Each generated avro validator function carries metadata with schema name

Runs validation function and re-throws the exception
with extra info attached.
Each generated avro validator function carries metadata with schema name
sourceraw docstring

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

× close