caveman

API Reference

caveman

Web Application Framework for Common Lisp

CAVEMAN

  • Function CONFIG (&optional key)
  • Function CURRENT-MODE
  • Function APP-PATH (&rest paths)
  • Function REDIRECT-TO (url-or-action &rest params)
  • Function FORWARD-TO (symbol &rest params)
  • Function CURRENT-URI

Also exports

  • CAVEMAN.ROUTE:URL-FOR
  • CAVEMAN.ROUTE:DEFROUTE
  • CAVEMAN.APP:NEXT-ROUTE
  • CAVEMAN.CONTEXT:*REQUEST*
  • CAVEMAN.CONTEXT:CONTEXT
  • CAVEMAN.CONTEXT:*SESSION*
  • CAVEMAN.CONTEXT:WITH-CONTEXT-VARIABLES
  • CAVEMAN.ROUTE:URL
  • CAVEMAN.CONTEXT:*CONTEXT*
  • CAVEMAN.CONTEXT:*RESPONSE*

CAVEMAN.APP

  • Class <APP>  (<COMPONENT>)
    Base class for Caveman Application. All Caveman Application must inherit this class.
    ROUTING-RULES   Accessor: ROUTING-RULES
  • Method ADD-ROUTE ((this <app>) routing-rule)
    Add a routing rule to the Application.
  • Function NEXT-ROUTE
  • Function NOT-FOUND
    An action when no routing rules are found.
  • Method LOOKUP-ROUTE ((this <app>) symbol)
    Lookup a routing rule with SYMBOL from the application.

CAVEMAN.PROJECT

  • Class <PROJECT>  (<COMPONENT>)
    CONFIG   Accessor: CONFIG
    ACCEPTOR   Accessor: ACCEPTOR
    DEBUG-MODE-P   Accessor: DEBUG-MODE-P
    MODE   Accessor: PROJECT-MODE
  • Generic-Function BUILD (project)
    Build up an application for this project and return it. This method must be implemented in subclasses.
  • Method LOAD-CONFIG ((this <project>) mode)
  • Method START ((this <project>) &key (mode :dev) debug lazy &allow-other-keys)
  • Method START ((this <project>) &key port server &allow-other-keys)
  • Method STOP ((this <project>))
    Stop a server.

CAVEMAN.REQUEST

  • Class <REQUEST>  (<REQUEST>)
    Class for Caveman Request.
    No slots.
  • Function MAKE-REQUEST (req)
    Construct a request instance.

Also exports

  • CLACK.REQUEST:REMOTE-ADDR
  • CLACK.REQUEST:REQUEST-METHOD
  • CLACK.REQUEST:CLACK-HANDLER
  • CLACK.REQUEST:RAW-BODY
  • CLACK.REQUEST:COOKIES
  • CLACK.REQUEST:PARAMETER
  • CLACK.REQUEST:SERVER-NAME
  • CLACK.REQUEST:SERVER-PORT
  • CLACK.REQUEST:QUERY-STRING
  • CLACK.REQUEST:BODY-PARAMETER
  • CLACK.REQUEST:SERVER-PROTOCOL
  • CLACK.REQUEST:QUERY-PARAMETER
  • CLACK.REQUEST:REMOTE-PORT
  • CLACK.REQUEST:PATH-INFO
  • CLACK.REQUEST:CONTENT-LENGTH
  • CLACK.REQUEST:URI-SCHEME
  • CLACK.REQUEST:REQUEST-URI
  • CLACK.REQUEST:CONTENT-TYPE
  • CLACK.REQUEST:SCRIPT-NAME
  • CLACK.REQUEST:REFERER
  • CLACK.REQUEST:SECUREP
  • CLACK.REQUEST:USER-AGENT

CAVEMAN.RESPONSE

  • Class <RESPONSE>  (<RESPONSE>)
    Class for Caveman Response.
    No slots.

Also exports

  • CLACK.REQUEST-RESPONSE:HEADERS
  • CLACK.RESPONSE:REDIRECT
  • CLACK.RESPONSE:STATUS
  • CLACK.RESPONSE:BODY
  • CLACK.RESPONSE:FINALIZE
  • CLACK.RESPONSE:MAKE-RESPONSE
  • CLACK.RESPONSE:PUSH-HEADER

CAVEMAN.CONTEXT

  • Variable *PROJECT*
    nil
    Special variable to store current Caveman application. Don't set to this variable directly. This is designed to be bound in lexical let.
  • Variable *CONTEXT*
    nil
    Special variable to store Caveman Context, a hash table. Don't set to this variable directly. This is designed to be bound in lexical let.
  • Variable *REQUEST*
    nil
    Special variable to store Caveman Request, a instance of `<request>' in Caveman.Request package. Don't set to this variable directly. This is designed to be bound in lexical let.
  • Variable *RESPONSE*
    nil
    Special variable to store Caveman Response, a instance of `<response>' in Caveman.Response package. Don't set to this variable directly. This is designed to be bound in lexical let.
  • Variable *SESSION*
    nil
    Special variable to store session. Don't set to this variable directly. This is designed to be bound in lexical let.
  • Function MAKE-CONTEXT (req)
    Create a new Context.
  • Function CONTEXT (&optional key)
    Access to current context. If key is specified, return the value in current context. If not, just return a current context. Example: (context) ;=> #<HASH-TABLE :TEST EQL size 0/60 #x3020025FF5FD> (context :request) ;=> #<CAVEMAN.REQUEST:<REQUEST> #x3020024FCCFD>
  • Function (setf CONTEXT) (val key)
  • Macro WITH-CONTEXT-VARIABLES ((&rest vars) &body body)

CAVEMAN.MIDDLEWARE.CONTEXT

  • Class <CAVEMAN-MIDDLEWARE-CONTEXT>  (<MIDDLEWARE>)
    Clack Middleware to set context for each request.
    No slots.

CAVEMAN.SKELETON

  • Function GENERATE (path &rest params &key name description author email license depends-on &allow-other-keys)
    Generate a skeleton of Caveman Application. `name' must be a symbol or a keyword. `path' must be a pathname. If `path' isn't specified, generate a skeleton to current directory.

CAVEMAN.ROUTE

  • Macro URL (method url-rule form)
    Useful annotation to define actions. Example: ;; for Function @url GET "/login" (defun login (req) ;; response ) ;; for Clack Component @url GET "/member/:id" (defclass <member-profile> (<component>) ()) (defmethod call ((this <member-profile>) req) ;; response )
  • Macro DEFROUTE (method url-rule form)
    Recreation of @URL annotation in S-expression form
  • Macro URL->ROUTING-RULE (method url-rule form)
    Convert action form into a routing rule, a list. Example: ((member-profile #<url-rule> #'member-profile) (login-form #<url-rule> #'login-form))
  • Function URL-FOR (symbol &rest params)
    Make an URL for the action with PARAMS. Example: @url GET "/animals/:type" (defun animals (params)) (url-for 'animals :type "cat") ;; => "/animals/cat"

CAVEMAN.WIDGET

  • Class <CAVEMAN-WIDGET>
    Base class of view widget.
    VIEW   Accessor: VIEW
  • Method RENDER ((this <caveman-widget>) &optional params)

CAVEMAN.WIDGET.FORM

  • Class <CAVEMAN-WIDGET-FORM>  (<CAVEMAN-WIDGET>)
    ACTION   Accessor: FORM-ACTION
    METHOD   Accessor: FORM-METHOD
    COMPONENTS   Accessor: FORM-COMPONENTS
  • Function MAKE-FORM (&rest args)
    A synonim for `(make-instance '<caveman-widget-form> ...)`.
  • Method ADD ((this <caveman-widget-form>) widget)
    Add another widget to this form. That will be rendered in 'form' tag.
  • Method VALIDATE ((this <caveman-widget-form>) values)

CAVEMAN.VIEW.FUNCTION

  • Function RENDER (fn params)
    Render function for Functions.

CAVEMAN.VIEW.EMB

  • Function RENDER (file params)
    Render function for CL-EMB templates.

caveman-middleware-dbimanager

Clack Middleware for managing CL-DBI connections

CAVEMAN.MIDDLEWARE.DBIMANAGER

  • Class <CAVEMAN-MIDDLEWARE-DBIMANAGER>  (<MIDDLEWARE>)
    Clack Middleware for using CL-DBI. This is similar to `<clack-middleware-dbi>', except this doesn't always connect (and disconnect) for each HTTP requests.
    DBI-MANAGER
  • Function CONNECT-DB (&optional database-name)
    Return a connected DBI connection for database for `database-name'. This is meant to be used in an actual application.

caveman-test

No packages.

caveman2

Lightweight web application framework

CAVEMAN2

No exported symbols.

Also exports

  • LACK.REQUEST:REQUEST-CONTENT-TYPE
  • LACK.REQUEST:REQUEST-METHOD
  • LACK.RESPONSE:RESPONSE-BODY
  • LACK.RESPONSE:RESPONSE-STATUS
  • CAVEMAN2.APP:ON-EXCEPTION
  • LACK.REQUEST:REQUEST-COOKIES
  • LACK.REQUEST:REQUEST-REMOTE-ADDR
  • CAVEMAN2.APP:<APP>
  • LACK.REQUEST:REQUEST-QUERY-STRING
  • LACK.REQUEST:REQUEST-SERVER-NAME
  • NINGLE.CONTEXT:CONTEXT
  • LACK.RESPONSE:RESPONSE-SET-COOKIES
  • LACK.REQUEST:REQUEST-SCRIPT-NAME
  • NINGLE.CONTEXT:*REQUEST*
  • NINGLE.CONTEXT:*RESPONSE*
  • LACK.REQUEST:REQUEST-PARAMETERS
  • CAVEMAN2.SKELETON:MAKE-PROJECT
  • CAVEMAN2.ROUTE:DEFROUTE
  • CAVEMAN2.ROUTE:ROUTE
  • MYWAY.MAPPER:NEXT-ROUTE
  • NINGLE.CONTEXT:MAKE-RESPONSE
  • LACK.REQUEST:REQUEST-SERVER-PORT
  • LACK.REQUEST:REQUEST-QUERY-PARAMETERS
  • CAVEMAN2.HELPER:URL-FOR
  • LACK.RESPONSE:RESPONSE-HEADERS
  • CAVEMAN2.EXCEPTION:THROW-CODE
  • LACK.REQUEST:REQUEST-PATH-INFO
  • NINGLE.CONTEXT:*CONTEXT*
  • LACK.REQUEST:REQUEST-URI
  • CAVEMAN2.EXCEPTION:REDIRECT
  • LACK.REQUEST:REQUEST-BODY-PARAMETERS
  • NINGLE.CONTEXT:*SESSION*
  • LACK.REQUEST:REQUEST-SERVER-PROTOCOL
  • LACK.REQUEST:REQUEST-RAW-BODY
  • NINGLE.CONTEXT:MAKE-REQUEST
  • LACK.REQUEST:REQUEST-CONTENT-LENGTH
  • LACK.REQUEST:REQUEST-ENV
  • NINGLE.APP:CLEAR-ROUTING-RULES
  • LACK.REQUEST:REQUEST-REMOTE-PORT
  • LACK.REQUEST:REQUEST-HEADERS

CAVEMAN2.APP

  • Variable *CURRENT-APP*
    nil
  • Class <APP>  (<APP>)
    No slots.
  • Function FIND-PACKAGE-APP (package)
  • Method ON-EXCEPTION ((this <app>) code)

Also exports

  • NINGLE.CONTEXT:MAKE-REQUEST
  • NINGLE.APP:CLEAR-ROUTING-RULES
  • NINGLE.CONTEXT:CONTEXT
  • NINGLE.CONTEXT:*RESPONSE*
  • NINGLE.CONTEXT:*SESSION*
  • NINGLE.CONTEXT:*CONTEXT*
  • NINGLE.CONTEXT:MAKE-RESPONSE
  • MYWAY.MAPPER:NEXT-ROUTE
  • NINGLE.CONTEXT:*REQUEST*

CAVEMAN2.ROUTE

  • Variable *PARSED-PARAMETERS-SYMBOL-NAME*
    "_parsed"
  • Macro DEFROUTE (&rest args)
  • Macro ROUTE (method routing-rule form)

CAVEMAN2.NESTED-PARAMETER

  • Function PARSE-PARAMETERS (params-alist)

CAVEMAN2.HELPER

  • Function URL-FOR (route-name &rest params)

CAVEMAN2.EXCEPTION

  • Condition CAVEMAN-EXCEPTION  (SIMPLE-ERROR)
  • Function THROW-CODE (code)
  • Condition CAVEMAN-REDIRECTION  (ERROR)
  • Function REDIRECT (url &optional (code 302))

CAVEMAN2.SKELETON

  • Function MAKE-PROJECT (path &rest params &key name description author email license &allow-other-keys)

caveman2-db

Simple CL-DBI wrapper

CAVEMAN2.DB

  • Macro SELECT-ALL (db field &body clauses)
  • Macro SELECT-ONE (db field &body clauses)
  • Macro INSERT-INTO (db table &body clauses)
  • Macro UPDATE (db table &body clauses)
  • Macro DELETE-FROM (db table &body clauses)

Also exports

  • SXQL:GROUP-BY
  • CAVEMAN.MIDDLEWARE.DBIMANAGER:CONNECT-DB
  • SXQL:FROM
  • SXQL:UNION-QUERIES
  • SXQL:WHERE
  • SXQL:LIMIT
  • SXQL:LEFT-JOIN
  • SXQL:UNION-ALL-QUERIES
  • SXQL:OFFSET
  • SXQL:ORDER-BY
  • SXQL:SET=

caveman2-test

No packages.