Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Production production env value Production = Env("production") // Development development env value Development = Env("development") // Test test env value Test = Env("test") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// Env environment
Env Env
// Handlers the handlers
Handlers []HandlerFunc
// ErrorHandler must not be nil
ErrorHandler ErrorHandlerFunc
// Req the http request
Req *http.Request
// Res the http response writer
Res http.ResponseWriter
// Values pre-request associated values
Values map[string]interface{}
// contains filtered or unexported fields
}
Context per-request context
type Env ¶
type Env string
Env empty-safe environment string
func (Env) IsDevelopment ¶
IsDevelopment is development, if empty returns true
type ErrorHandlerFunc ¶
ErrorHandlerFunc functions handles a pre-request context and a error
type HandlerFunc ¶
HandlerFunc function handles a per-request context and returns error
type Nova ¶
type Nova struct {
// Env environment must be one of "production", "development", "test"
Env Env
// Handlers slice of handler functions
Handlers []HandlerFunc
// ErrorHandler handler will be invoked on error returned by previous handlers
ErrorHandler ErrorHandlerFunc
}
Nova application
func (*Nova) CreateContext ¶
CreateContext create a nova.context from http.Request / http.ResponseWriter
func (*Nova) Error ¶
func (n *Nova) Error(handler ErrorHandlerFunc)
ErrorHandler register a error handler
Click to show internal directories.
Click to hide internal directories.
