Liking cljdoc? Tell your friends :D

active.data.http.rpc


contextclj/s

(context path
         &
         {realm-format :format underlying :underlying-format caller :caller})

Returns an rpc context to be used in RPC declarations and implementations.

(def my-api (context "/api/my"))
Returns an rpc context to be used in RPC declarations and
implementations.

```
(def my-api (context "/api/my"))
```
sourceraw docstring

defn-rpcclj/smacro

(defn-rpc name context & more)

Declares an RPC endpoint. Depending on the referenced context, the defined name can be called as a function.

(defn-rpc foo context "docstring" :- realm/string [x :- realm/integer])
Declares an RPC endpoint. Depending on the referenced [[context]], the
defined name can be called as a function.
  
  ```
  (defn-rpc foo context "docstring" :- realm/string [x :- realm/integer])
  ```
  
sourceraw docstring

set-context-callerclj/s

(set-context-caller context caller)

Replaces the context caller of the given rpc context. This should be a function, that given an RPC representation usually returns a function taking the RPC's arguments. The details depend on the caller though.

(def my-api (-> (context "/api/my")
                #?(:cljs (set-context-caller cljs-caller))))
Replaces the `context caller` of the given rpc context. This should be
a function, that given an RPC representation usually returns a
function taking the RPC's arguments. The details depend on the caller
  though.

  ```
  (def my-api (-> (context "/api/my")
                  #?(:cljs (set-context-caller cljs-caller))))
  ```
  
sourceraw docstring

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

× close