gae

package
v0.0.0-...-9ccfb5e Latest Latest
Warning

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

Go to latest
Published: May 30, 2016 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package gae offers a google appengine integration for the gotojs package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextConstructor

func ContextConstructor(req *http.Request, res http.ResponseWriter) *HTTPContext

ContextConstructor creates a gotos HTTPContext

func ContextInjector

func ContextInjector(b Binding, hc *HTTPContext, injs Injections) bool

ContextInjector is a gotojs injector method that takes care to add the GAE context to then injection vector and allows bindings to take it as injection argument.

func SetupAndStart

func SetupAndStart(f *Container, cons ...ModuleController)

Types

type BaseModuleController

type BaseModuleController struct {
	Next ModuleController
	// contains filtered or unexported fields
}

func NewBaseModuleController

func NewBaseModuleController(f *Container, cons ...ModuleController) *BaseModuleController

NewBaseModuleController creates a generic module control that supoprts start/stop methods and integrates the gae specific context injections. The constructor should be called after the service bindings have been defined. A generic controller will be created and if given by parameter a subsequent one is chained in.

func (*BaseModuleController) ServeHTTP

func (con *BaseModuleController) ServeHTTP(res http.ResponseWriter, req *http.Request)

ServeHTTP dispatches incoming requests to module controller methods (start/stop) and the gotojs handler.

func (*BaseModuleController) Start

func (con *BaseModuleController) Start(c *Context)

Start is the menthod of the module controller that will be called when a appengine backend module is started (manual/basic_scaling)

func (*BaseModuleController) Stop

func (con *BaseModuleController) Stop(c *Context)

Stop is the menthod of the module controller that will be called when a appengine backend module is stoped or aborted (manual/basic_scaling)

type Context

type Context struct {
	appengine.Context
	Client      *http.Client
	HTTPContext *HTTPContext
}

Google App Engine context wrapper.

func NewContext

func NewContext(hc *HTTPContext) *Context

NewContext creates a new appengine context wrapper by the given http call attributes.

func (Context) Write

func (g Context) Write(p []byte) (n int, err error)

Writer to log on appengine info level.

type ModuleController

type ModuleController interface {
	Start(*Context)
	Stop(*Context)
}

Jump to

Keyboard shortcuts

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