Liking cljdoc? Tell your friends :D

clj-rpc.server


*commands*clj

source

build-handerclj

(build-hander options)
source

change-str->keywordclj

(change-str->keyword m)
source

execute-commandclj

(execute-command command-map request method-request)

get the function from the command-map according the method-name and execute this function with args return the execute result

get the function from the command-map according the method-name and
execute this function with args
return the execute result
sourceraw docstring

export-commandsclj

(export-commands ns fn-names & [options])

export all functions (fn-names is null or empty) or specify functions in the namespace ns invoker of this method must notice the order of the options options: options is a collection include several keys like [ [:requre-context true] [:params-checks ...] [... ...] ]

the meaning of option: :require-context (true or false default false) whether this command must have context :params-checks check parameters of the method be invoked statisfy the sepcific requirements example : {0 [:username]} --> the first parameter must equals (get-in context [:username])

for example : (export-commands 'clojure.core nil) (export-commands "clojure.core" nil) (export-commands 'clojure.core ['+]) (export-commands 'clojure.core ["+"] [ [:require-context true] [:params-check {0 [:id]}] ])

export all functions (fn-names is null or empty)
 or specify functions in the namespace ns
 invoker of this method must notice the order of the options
options:    options is a collection include several keys
  like [ [:requre-context true] [:params-checks ...] [... ...] ]

the meaning of option:
 :require-context (true or false default false)
    whether this command must have context
 :params-checks
   check parameters of the method be invoked statisfy the sepcific requirements
   example :
     {0 [:username]} -->
     the first parameter must equals (get-in context [:username])

 for example :
 (export-commands 'clojure.core nil)
 (export-commands "clojure.core" nil)
 (export-commands 'clojure.core ['+])
 (export-commands 'clojure.core ["+"]
                  [ [:require-context true] [:params-check {0 [:id]}] ])
sourceraw docstring

help-commandsclj

(help-commands commands)

return the command list

return the command list
sourceraw docstring

jetty-instanceclj

source

main-routesclj

source

rpc-default-portclj

source

rpc-invokeclj

(rpc-invoke command-map request rpc-request)

invoke rpc method rpc-request can a map (one invoke) or a collection of map (multi invokes)

invoke rpc method
rpc-request can a map (one invoke) or a collection of map (multi invokes)
sourceraw docstring

startclj

(start)
(start options)

start jetty server options : base on options of run-jetty of ring jetty adaptor and add several more :fn-get-context => function to get the context (fn-get-context token) :token-cookie-key => the cookie name according to the token :cookie-attrs => the cookie default attributes, include domain or others reference ring wrap-session :commands => the custom commands (atom of map) to be exported. (optional)

start jetty server
options :
   base on options of run-jetty  of ring jetty adaptor
   and add several more
   :fn-get-context  => function to get the context (fn-get-context token)
   :token-cookie-key => the cookie name according to the token
   :cookie-attrs => the cookie default attributes, include domain or others
                    reference ring wrap-session
   :commands => the custom commands (atom of map) to be exported. (optional) 
sourceraw docstring

stopclj

(stop)
(stop instance)

stop jetty server

stop jetty server
sourceraw docstring

with-commandscljmacro

(with-commands a-commands & body)

if you want to define another commands, using this macro, and in it invoke export-commands function lile:

if you want to define another commands, using this macro,
and in it invoke export-commands function lile:
sourceraw docstring

wrap-commandsclj

(wrap-commands handler new-commands)

enable binding a custom commands map new-commands must be a atom of map

enable binding a custom commands map
new-commands must be a atom of map
sourceraw docstring

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

× close