harness

package
v0.0.0-...-8479321 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2012 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const REGISTER_CONTROLLERS = `` /* 1176-byte string literal not displayed */

Variables

This section is empty.

Functions

func Build

func Build() (binaryPath string, 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.

func ExprName

func ExprName(expr ast.Expr) string

This returns the syntactic expression for referencing this type in Go. One complexity is that package-local types have to be fully-qualified. For example, if the type is "Hello", then it really means "pkg.Hello".

func StartApp

func StartApp(useHarness bool)

Run the Revel program, optionally using the harness.

Types

type ControllerSpec

type ControllerSpec struct {
	PackageName string
	StructName  string
	ImportPath  string
	MethodSpecs []*MethodSpec
	// contains filtered or unexported fields
}

func ScanControllers

func ScanControllers(path string) (specs []*ControllerSpec, compileError *rev.Error)

Parse the app directory and return a list of the controller types found. Returns a CompileError if the parsing fails.

func (*ControllerSpec) SimpleName

func (s *ControllerSpec) SimpleName() string

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() *rev.Error

Rebuild the Revel application and run it on the given port.

func (*Harness) Run

func (h *Harness) Run()

func (*Harness) ServeHTTP

func (hp *Harness) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles all requests. It checks for changes to app, rebuilds if necessary, and forwards the request.

func (*Harness) WatchDir

func (h *Harness) WatchDir(info os.FileInfo) bool

func (*Harness) WatchFile

func (h *Harness) WatchFile(filename string) bool

type MethodArg

type MethodArg struct {
	Name       string // Name of the argument.
	TypeName   string // The name of the type, e.g. "int", "*pkg.UserType"
	ImportPath string // If the arg is of an imported type, this is the import path.
}

type MethodSpec

type MethodSpec struct {
	Name        string        // Name of the method, e.g. "Index"
	Args        []*MethodArg  // Argument descriptors
	RenderCalls []*renderCall // Descriptions of Render() invocations from this Method.
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL