Documentation ¶
Index ¶
Constants ¶
const REGISTER_CONTROLLERS = `` /* 1575-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func IsBuiltinType ¶
Types ¶
type App ¶
type App struct { BinaryPath string // Path to the app executable Port int // Port to pass as a command line argument. // contains filtered or unexported fields }
App contains the configuration for running a Revel app. (Not for the app itself) Its only purpose is constructing the command to execute.
func Build ¶
func Build() (app *App, compileError *rev.Error)
Build the app: 1. Generate the the main.go file. 2. Run the appropriate "go build" command. Requires that rev.Init has been called previously. Returns the path to the built binary, and an error if there was a problem building it.
type AppCmd ¶
AppCmd manages the running of a Revel app server. It requires rev.Init to have been called previously.
type Harness ¶
type Harness struct {
// contains filtered or unexported fields
}
Harness reverse proxies requests to the application server. It builds / runs / rebuilds / restarts the server when code is changed.
func NewHarness ¶
func NewHarness() *Harness
Return a reverse proxy that forwards requests to the given port.
func (*Harness) Refresh ¶
func (h *Harness) Refresh() (err *rev.Error)
Rebuild the Revel application and run it on the given port.
func (*Harness) Run ¶
func (h *Harness) Run()
Run the harness, which listens for requests and proxies them to the app server, which it runs and rebuilds as necessary.
type MethodSpec ¶
type SourceInfo ¶
type SourceInfo struct { // ControllerSpecs lists type info for all structs found under // app/controllers/... that embed (directly or indirectly) rev.Controller. ControllerSpecs []*TypeInfo // ValidationKeys provides a two-level lookup. The keys are: // 1. The fully-qualified function name, // e.g. "github.com/robfig/revel/samples/chat/app/controllers.(*Application).Action" // 2. Within that func's file, the line number of the (overall) expression statement. // e.g. the line returned from runtime.Caller() // The result of the lookup the name of variable being validated. ValidationKeys map[string]map[int]string // TestSuites list the types that constitute the set of application tests. TestSuites []*TypeInfo // A list of import paths. // Revel notices files with an init() function and imports that package. InitImportPaths []string }
SourceInfo is the top-level struct containing all extracted information about the app source code, used to generate main.go.
func ProcessSource ¶
func ProcessSource(roots []string) (*SourceInfo, *rev.Error)
Parse the app controllers directory and return a list of the controller types found. Returns a CompileError if the parsing fails.
type TypeExpr ¶
type TypeExpr struct { Expr string // The unqualified type expression, e.g. "[]*MyType" PkgName string // The default package idenifier // contains filtered or unexported fields }
TypeExpr provides a type name that may be rewritten to use a package name.
func NewTypeExpr ¶
This returns the syntactic expression for referencing this type in Go.
type TypeInfo ¶
type TypeInfo struct { StructName string // e.g. "Application" ImportPath string // e.g. "github.com/robfig/revel/samples/chat/app/controllers" PackageName string // e.g. "controllers" MethodSpecs []*MethodSpec // contains filtered or unexported fields }
TypeInfo summarizes information about a struct type in the app source code.