Documentation
¶
Overview ¶
Package ottoengine is a module providing a way to define route processing using the Otto JavaScript virutal machine.
Otto is written by Robert Krimen, see https://github.com/robertkrimen/otto Otto Engine is written by Robert Doiel, see https://github.com/rsdoiel/ws
@author R. S. Doiel, <rsdoiel@gmail.com> copyright (c) 2015 all rights reserved. Released under the Simplified BSD License. See: http://opensource.org/licenses/BSD-2-Clause
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRoutes ¶
func AddRoutes(programs []Program)
AddRoutes allows a Program structure to fine an approach route handler.
func Engine ¶
func Engine(program Program)
Engine provides the basic service for ws.go to handle JavaScript interactions server side.
Types ¶
type Program ¶
type Program struct { Route string Filename string Source []byte VM *otto.Otto Script *otto.Script }
Program keeps track of assigned route, the JS file, the source of the JS file as well as handles for the VM and Script elements in otto.