Liking cljdoc? Tell your friends :D

goose.console


app-handlerclj

(app-handler {:keys [broker] :as console-opts} req)

A Ring handler that sets up the necessary middleware and serves Goose Console UI It takes two arguments:

Keys

:console-opts : A map containing the configuration options for the console
:route-prefix : The route path that exposes the Goose Console via app-handler (should not include a trailing "/")
:broker : Message broker that transfers message from Producer to Consumer. Given value must implement goose.broker/Broker protocol. Message Broker wiki :app-name : Name of the application using Goose

:req : The Ring request map representing the incoming HTTP request.

A Ring handler that sets up the necessary middleware and serves Goose Console UI
It takes two arguments:

### Keys
`:console-opts`    : A map containing the configuration options for the console \
   `:route-prefix` : The route path that exposes the Goose Console via app-handler (should not include a trailing "/") \
   `:broker`       : Message broker that transfers message from Producer to Consumer.
                     Given value must implement [[goose.broker/Broker]] protocol.
                     [Message Broker wiki](https://github.com/nilenso/goose/wiki/Message-Brokers)
   `:app-name`     : Name of the application using Goose

 `:req`               : The Ring request map representing the incoming HTTP request.
sourceraw docstring

(header header-items {:keys [app-name prefix-route uri] :or {app-name ""}})

Creates a navbar header in hiccup syntax with goose logo and app name

Args

header-items : A seq of maps each containing route and label keys to specify navigation links

data : A map that should include: - uri: The current page's URI to identify the active link - app-name: Application's name - prefix-route: Function to prepend paths for URL generation

Creates a navbar header in hiccup syntax with goose logo and app name

### Args
`header-items` : A seq of maps each containing route and label keys to
specify navigation links

`data` : A map that should include:
    - `uri`: The current page's URI to identify the active link
    - `app-name`: Application's name
    - `prefix-route`: Function to prepend paths for URL generation
sourceraw docstring

layoutclj

(layout & components)

Generates HTML layout for webpage using provided hiccup components

Args

components: A variadic list of functions. Each function is expected to accept a map data and return hiccup data representing part of a webpage

Usage

(def job [job]
     [:p {:class "job"} (:id job)])

    (let [view (layout job)]
       (view "Jobs page" {:id "jid"})
Generates HTML layout for webpage using provided hiccup components

### Args

components: A variadic list of functions. Each function is expected to accept
            a map `data` and return hiccup data representing part of a webpage

### Usage
 ```Clojure
 (def job [job]
      [:p {:class "job"} (:id job)])

     (let [view (layout job)]
        (view "Jobs page" {:id "jid"})
 ```
sourceraw docstring

load-cssclj

(load-css _)

Load static css file

Load static css file
sourceraw docstring

load-imgclj

(load-img _)

Load goose logo

Load goose logo
sourceraw docstring

load-jsclj

(load-js _)

Load javascript file

Load javascript file
sourceraw docstring

not-foundclj

(not-found _)

A default not found response

A default not found response
sourceraw docstring

redirect-to-home-pageclj

(redirect-to-home-page {:keys [prefix-route]})

Redirects the user to the home page using given prefix-route function

Redirects the user to the home page using given prefix-route function
sourceraw docstring

wrap-method-overrideclj

(wrap-method-override handler)

Middleware to override HTTP method based on the _method parameters in request params, allowing to simulate PUT, DELETE, PATCH etc. methods that are not supported in HTML forms

Middleware to override HTTP method based on the `_method` parameters in request params, allowing
to simulate PUT, DELETE, PATCH etc. methods that are not supported in HTML forms
sourceraw docstring

wrap-prefix-routeclj

(wrap-prefix-route handler)

Middleware that injects a prefix-route function into the request, that facilitates URL construction in views by prepending given route-prefix to paths

Middleware that injects a `prefix-route` function into the request,
that facilitates URL construction in views by prepending given route-prefix to paths
sourceraw docstring

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

× close