This is the defrest Reference Manual, version 1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 05:01:26 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
defrest
defrest: expose functions as REST webservices for ajax or other stuff
Mathias Menzel-Nielsen <(reverse "ed.tfosztam@eztam")>
BSD
1
hunchentoot
(system).
cl-ppcre
(system).
split-sequence
(system).
quri
(system).
defrest.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
defrest/defrest.lisp
defrest
(system).
create-rest-table-dispatcher
(function).
defrest
(macro).
undefrest
(function).
*rest-dispatcher-table*
(special variable).
create-query-param-parser
(function).
create-rest-dispatcher
(function).
mark-template-splitpoints
(function).
parse-schema
(function).
parse-uri
(function).
parse-varlist
(function).
schema->regexpurl
(function).
split-sequence-on-positions
(function).
split-template-blocks
(function).
Packages are listed by definition order.
defrest
rest
cl-ppcre
.
common-lisp
.
hunchentoot
.
split-sequence
.
create-rest-table-dispatcher
(function).
defrest
(macro).
undefrest
(function).
*rest-dispatcher-table*
(special variable).
create-query-param-parser
(function).
create-rest-dispatcher
(function).
mark-template-splitpoints
(function).
parse-schema
(function).
parse-uri
(function).
parse-varlist
(function).
schema->regexpurl
(function).
split-sequence-on-positions
(function).
split-template-blocks
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Defines a new REST Method. It will listen to urls which match pattern,
have all template blocks replaced and binds variables to varlist.
Returns a dispatcher method, which can be put in the hunchentoot dispatcher
table AND creates an entry in the *rest-dispatcher-table* to be able to defrest
on toplevel.
Usage Example:
(defrest "/greet/{name:.+}" :GET (name)
(format nil "Hello ~a" name))
will create a Hello World Dispatcher which will greet GET /greet/Bonk with ’Hello Bonk’
builds a rest table dispatcher which can be added to the hunchentoot dispatchers to handle all defrest’ed functions
Removes the rest service with the exact PATTERN from the rest-table-dispatcher
Compiles the query definition into a function that is to be called with the query parameters of the current request and returns the value of the query parameter
Creates a hunchentoot compatible dispatcher for a given url SCHEMA, request METHOD and QUERY-PARAM-Schemes which will call the FUN function on match and hands over a parameter map hashtable
Returns a list of all split positions to seperate templateblocks in SCHEMA.
splits a schema into blocks representing it’s static parts and it’s placeholders.
Example 1:
’/test/{id:[a-z]+}’ => (’/test/’ (:KEY ’id’ :REGEXP ’[a-z]+’))
Example 2:
’/test/{id:[a-z]?[0-9]+}’ => (’/test/’ (:KEY ’id’ :REGEXP ’[a-z]?[0-9]+’))
Example 3:
’/album/{album:[a-z]+}/track/{track:[0-9]+}’ => (’/album/’ (:KEY ’album’ :REGEXP ’[a-z]+’) ’/track/’ (:KEY ’track’ :REGEXP ’[0-9]+’))
Example 4:
’/album/{album:[a-z]+}/track/{vol:[0-9]+}-{pos:[0-9]+}’ => (’/album/’ (:KEY ’album’ :REGEXP ’[a-z]+’) ’/track/’
(:KEY ’vol’ :REGEXP ’[0-9]+’) ’-’ (:KEY ’pos’ :REGEXP ’[0-9]+’))
Parses URI against SCHEMA and returns a hashtable with all pathvariable bindings and as second value the query parameters
Parses the varlist and returns a list of all bindings and a list of the bindings that are mapped to query parameters.
rips out the template blocks and replaces them with their regexp part. eg: {id:[0-9]+} becomes [0-9]+
Splits SEQ on all positions listed in POSLIST
splits an template uri to seperate the template placeholder blocks so that ’/bla/{var:.+}’ becomes (’/bla/’ ’{var:.+}’). best version
Jump to: | C D F M P S U |
---|
Jump to: | C D F M P S U |
---|
Jump to: | *
S |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
* | |||
*rest-dispatcher-table* : | Private special variables | ||
| |||
S | |||
Special Variable, *rest-dispatcher-table* : | Private special variables | ||
|
Jump to: | *
S |
---|
Jump to: | D F P S |
---|
Jump to: | D F P S |
---|