This is the myway Reference Manual, version 0.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:07:57 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
myway
Sinatra-compatible routing library.
Eitaro Fukamachi
LLGPL
# My Way
My Way is a Sinatra-compatible URL routing library. This was originally written as Clack.Util.Route, a part of [Clack](http://clacklisp.org/).
## Usage
“‘common-lisp
(use-package :myway)
(defvar *mapper* (make-mapper))
(connect *mapper* "/" "Welcome to My Way.")
(connect *mapper* "/hello/?:name?"
(lambda (params)
(format nil "Hello, ~A" (or (getf params :name)
"Guest"))))
(dispatch *mapper* "/")
;=> "Welcome to My Way."
; T
(dispatch *mapper* "/hello")
;=> "Hello, Guest"
; T
(dispatch *mapper* "/hello/Eitaro")
;=> "Hello, Eitaro"
; T
(dispatch *mapper* "/hello/Eitaro" :method :POST)
;=> NIL
; NIL
“‘
### next-route
“‘common-lisp
(connect *mapper* "/guess/:who"
(lambda (params)
(if (string= (getf params :who) "Eitaro")
"You got me!"
(next-route))))
(connect *mapper* "/guess/*"
(lambda (params)
(declare (ignore params))
"You missed!"))
“‘
### to-app
‘to-app‘ makes a Clack app from ‘mapper‘.
“‘common-lisp
(to-app *mapper*)
;=> #<CLOSURE (LAMBDA (MYWAY::ENV) :IN TO-APP) {100E24F13B}>
(clack:clackup (to-app *mapper*))
“‘
## Installation
“‘common-lisp
(ql:quickload :myway)
“‘
## Author
* Eitaro Fukamachi (e.arrows@gmail.com)
## Copyright
Copyright (c) 2014 Eitaro Fukamachi (e.arrows@gmail.com)
## License
Licensed under the LLGPL License.
0.1.0
cl-ppcre
(system).
quri
(system).
map-set
(system).
alexandria
(system).
cl-utilities
(system).
src
(module).
Modules are listed depth-first from the system components tree.
myway/src
myway
(system).
myway.lisp
(file).
rule.lisp
(file).
route.lisp
(file).
mapper.lisp
(file).
util.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
myway/myway.asd
myway/src/myway.lisp
myway/src/rule.lisp
myway/src/route.lisp
myway/src/mapper.lisp
myway/src/util.lisp
myway/src/myway.lisp
route.lisp
(file).
mapper.lisp
(file).
util.lisp
(file).
src
(module).
*env*
(special variable).
connect
(function).
find-route
(function).
find-route-by-name
(function).
to-app
(function).
myway/src/rule.lisp
src
(module).
equal-rule
(function).
make-rule
(function).
match-rule
(function).
regex-rule
(structure).
rule
(structure).
rule-url-for
(generic function).
%make-regex-rule
(function).
%make-rule
(function).
*default-rule-methods*
(special variable).
compile-rule
(function).
copy-regex-rule
(function).
copy-rule
(function).
escape-special-char
(function).
list-to-map-set
(function).
match-method-p
(function).
regex-rule-format-string
(function).
(setf regex-rule-format-string)
(function).
regex-rule-methods
(function).
(setf regex-rule-methods)
(function).
regex-rule-p
(function).
regex-rule-param-keys
(function).
(setf regex-rule-param-keys)
(function).
regex-rule-regex
(function).
(setf regex-rule-regex)
(function).
regex-rule-url
(function).
(setf regex-rule-url)
(function).
rule-format-string
(reader).
(setf rule-format-string)
(writer).
rule-methods
(reader).
(setf rule-methods)
(writer).
rule-p
(function).
rule-param-keys
(reader).
(setf rule-param-keys)
(writer).
rule-regex
(reader).
(setf rule-regex)
(writer).
rule-url
(reader).
(setf rule-url)
(writer).
myway/src/route.lisp
rule.lisp
(file).
src
(module).
equal-route
(generic function).
initialize-instance
(method).
match-route
(generic function).
route
(class).
route-handler
(reader method).
(setf route-handler)
(writer method).
route-name
(reader method).
(setf route-name)
(writer method).
route-rule
(reader method).
(setf route-rule)
(writer method).
url-for
(function).
myway/src/mapper.lisp
route.lisp
(file).
util.lisp
(file).
src
(module).
add-route
(function).
clear-routes
(function).
dispatch
(function).
make-mapper
(function).
mapper
(structure).
mapper-routes
(function).
member-route
(function).
member-route-by-name
(function).
next-route
(function).
*next-route-function*
(special variable).
copy-mapper
(function).
mapper-%routes
(reader).
(setf mapper-%routes)
(writer).
mapper-p
(function).
myway/src/util.lisp
src
(module).
make-collector
(function).
Packages are listed by definition order.
myway.rule
common-lisp
.
equal-rule
(function).
make-rule
(function).
match-rule
(function).
regex-rule
(structure).
rule
(structure).
rule-url-for
(generic function).
%make-regex-rule
(function).
%make-rule
(function).
*default-rule-methods*
(special variable).
compile-rule
(function).
copy-regex-rule
(function).
copy-rule
(function).
escape-special-char
(function).
list-to-map-set
(function).
match-method-p
(function).
regex-rule-format-string
(function).
(setf regex-rule-format-string)
(function).
regex-rule-methods
(function).
(setf regex-rule-methods)
(function).
regex-rule-p
(function).
regex-rule-param-keys
(function).
(setf regex-rule-param-keys)
(function).
regex-rule-regex
(function).
(setf regex-rule-regex)
(function).
regex-rule-url
(function).
(setf regex-rule-url)
(function).
rule-format-string
(reader).
(setf rule-format-string)
(writer).
rule-methods
(reader).
(setf rule-methods)
(writer).
rule-p
(function).
rule-param-keys
(reader).
(setf rule-param-keys)
(writer).
rule-regex
(reader).
(setf rule-regex)
(writer).
rule-url
(reader).
(setf rule-url)
(writer).
myway.route
common-lisp
.
equal-route
(generic function).
match-route
(generic function).
route
(class).
route-handler
(generic reader).
(setf route-handler)
(generic writer).
route-name
(generic reader).
(setf route-name)
(generic writer).
route-rule
(generic reader).
(setf route-rule)
(generic writer).
url-for
(function).
myway
common-lisp
.
*env*
(special variable).
connect
(function).
find-route
(function).
find-route-by-name
(function).
to-app
(function).
myway.mapper
common-lisp
.
add-route
(function).
clear-routes
(function).
dispatch
(function).
make-mapper
(function).
mapper
(structure).
mapper-routes
(function).
member-route
(function).
member-route-by-name
(function).
next-route
(function).
*next-route-function*
(special variable).
copy-mapper
(function).
mapper-%routes
(reader).
(setf mapper-%routes)
(writer).
mapper-p
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
regex-rule
) params) ¶route
) &rest initargs &key url method regexp &allow-other-keys) ¶structure-object
.
(myway.util:make-collector)
structure-object
.
map-set:map-set
myway.rule::*default-rule-methods*
Jump to: | %
(
A C D E F G I L M N R T U |
---|
Jump to: | %
(
A C D E F G I L M N R T U |
---|
Jump to: | %
*
F H M N P R S U |
---|
Jump to: | %
*
F H M N P R S U |
---|
Jump to: | C F M P R S U |
---|
Jump to: | C F M P R S U |
---|