Documentation ¶
Index ¶
Constants ¶
const MAIN = `` /* 1626-byte string literal not displayed */
const ROUTES = `` /* 557-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 ¶
Build the app: 1. Generate the the main.go file. 2. Run the appropriate "go build" command. Requires that revel.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 revel.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) 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 { // StructSpecs lists type info for all structs found under the code paths. // They may be queried to determine which ones (transitively) embed certain types. StructSpecs []*TypeInfo // ValidationKeys provides a two-level lookup. The keys are: // 1. The fully-qualified function name, // e.g. "github.com/revel/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 // A list of import paths. // Revel notices files with an init() function and imports that package. InitImportPaths []string // contains filtered or unexported fields }
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, *revel.Error)
Parse the app controllers directory and return a list of the controller types found. Returns a CompileError if the parsing fails.
func (*SourceInfo) ControllerSpecs ¶
func (s *SourceInfo) ControllerSpecs() []*TypeInfo
func (*SourceInfo) TestSuites ¶
func (s *SourceInfo) TestSuites() []*TypeInfo
func (*SourceInfo) TypesThatEmbed ¶
func (s *SourceInfo) TypesThatEmbed(targetType string) (filtered []*TypeInfo)
TypesThatEmbed returns all types that (directly or indirectly) embed the target type, which must be a fully qualified type name, e.g. "github.com/revel/revel.Controller"
type TypeExpr ¶
type TypeExpr struct { Expr string // The unqualified type expression, e.g. "[]*MyType" PkgName string // The default package idenifier Valid bool // 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/revel/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.