Documentation ¶
Overview ¶
Package editor provides the editor web tool. To run with Google App Engine, install the Google App Engine Go SDK and go `goapp serve` in this directory.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Contexter ¶
Contexter gets a context for a specific request.
func ContexterBackground ¶
func ContexterBackground() Contexter
ContexterBackground gets a Contexter that provides context.Background().
type ContexterFunc ¶
ContexterFunc is a function wrapper for Contexter.
type Handler ¶
type Handler interface {
ServeHTTP(ctx context.Context, w http.ResponseWriter, r *http.Request) error
}
Handler is http.Handler with context.
type HandlerFunc ¶
HandlerFunc is http.HandlerFunc with context.
func (HandlerFunc) ServeHTTP ¶
func (h HandlerFunc) ServeHTTP(ctx context.Context, w http.ResponseWriter, r *http.Request) error
type Router ¶
type Router struct { // NotFound is the http.Handler to call when no routes // match. By default uses http.NotFoundHandler(). NotFound http.Handler // OnSystemError is called when a handler returns an error. OnSystemError func(context.Context, http.ResponseWriter, *http.Request, error) // contains filtered or unexported fields }
Router routes HTTP requests.
func (*Router) Handle ¶
Handle adds a handler with the specified method and pattern. Method can be any HTTP method string or "*" to match all methods. Pattern can contain path segments such as: /item/:id which is accessible via Param(context, "id"). If pattern ends with trailing /, it acts as a prefix. Errors returned from handlers are considered system errors and are handled via Router.OnSystemError.
func (*Router) HandleFunc ¶
func (r *Router) HandleFunc(method, pattern string, fn HandlerFunc)
HandleFunc is the http.HandlerFunc alternative to http.Handle.