harness

package
v0.0.0-...-7db3b25 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2012 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

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 Run

func Run(mode string)

Run the Revel program in a given RunMode. If RunMode is PROD, it builds and runs the app directly. Otherwise, it instantiates a proxy (harness) that watches for changes and rebuilds as necessary.

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

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