Liking cljdoc? Tell your friends :D

clj-rpc.context


add-contextclj

(add-context command options)

add context to specific command options is a collection include several keys like [ [:requre-context true] [:params-check ...] [... ...] ]

the meaning of option: :require-context (true or false default false) whether this command must have context :params-check check parameters of the method be invoked statisfy the sepcific requirements example : {0 [:username]} --> the first parameter must equals (get-in context [:username]) :params-inject inject parameters from request into the function example : [ [:remote-addr] [:server-name] ] --> client-ip and server-name as the first and second parameter of the function if client invoke (fun param1 param2) then the acutally invoke will be like (fun client-ip server-name param1 param2)

add context to specific command
options is a collection include several keys
like [ [:requre-context true] [:params-check ...] [... ...] ]

the meaning of option:
:require-context (true or false default false)
   whether this command must have context
:params-check
  check parameters of the method be invoked statisfy the sepcific requirements
  example :
    {0 [:username]} -->
    the first parameter must equals (get-in context [:username])
:params-inject
   inject parameters from request into the function
   example :
    [ [:remote-addr] [:server-name] ] -->
    client-ip and server-name as the first and second parameter of the function
    if client invoke (fun param1 param2) then the acutally invoke will be like
    (fun client-ip server-name param1 param2)
sourceraw docstring

add-context-to-command-mapclj

(add-context-to-command-map command-map options)

add context options to all the command in the command-map options : same as add-context

add context options to all the command in the command-map
options : same as add-context
sourceraw docstring

adjust-method-requestclj

(adjust-method-request cmd request method-request)

return new method-request (possible with error message)

return new method-request (possible with error message)
sourceraw docstring

adjust-responseclj

(adjust-response cmd request response)

enable every option has opportunity to adjust response or do some side-effects according response, return new response, handle reverse order of the options

enable every option has opportunity to adjust response or do    some side-effects according response,
return new response, handle reverse order of the options
sourceraw docstring

error-method-request?clj

(error-method-request? method-request)

return true if method-reqeust error else false

return true if method-reqeust error
else false
sourceraw docstring

get-client-ipclj

(get-client-ip request)
source

get-proxy-ipclj

(get-proxy-ip request)
source

render-method-requestcljmultimethod

adjust method request by option return new method-request

adjust method request by option
return new method-request
sourceraw docstring

render-responsecljmultimethod

adjust method response or do some side-effects by option return new response

adjust method response or do some side-effects by option
return new response
sourceraw docstring

warning-cost-msclj

source

wrap-bodyclj

(wrap-body handler)

convert the body of the request from InputStream to String

convert the body of the request from InputStream to String
sourceraw docstring

wrap-client-ipclj

(wrap-client-ip handler)

let :remote-addr represents the real client ip even though the client connects through a proxy server

let :remote-addr represents the real client ip even though
the client connects through a proxy server
sourceraw docstring

wrap-contextclj

(wrap-context handler fn-get-context cookie-attrs cookie-key)

accoding to the token (come from cookie in the http request or the token parameters) to get the context data , insert into the request

accoding to the token
  (come from cookie in the http request or the token parameters)
to get the context data , insert into the request
sourceraw docstring

wrap-costclj

(wrap-cost handler)

log the time of invoke that is bigger than warning-cost-ms

log the time of invoke that is bigger than warning-cost-ms
sourceraw docstring

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

× close