(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")) ```
(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]) ```
(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)))) ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close