Documentation
¶
Index ¶
- type AppConfig
- type Application
- func (app *Application) Assets() []Asset
- func (app *Application) GET(p string, h Handler)
- func (app Application) NewContext(rc RouteConfig, w http.ResponseWriter, r *http.Request) Context
- func (app *Application) Serve()
- func (app *Application) Use(mw ...MiddlewareFunc)
- func (app Application) View(ctx Context, viewName string, data ViewData)
- type Asset
- type AssetsConfigs
- type Context
- type DatabaseConfig
- type DefaultConfiguration
- type DefaultContext
- type FileExtension
- type Handler
- type MiddlewareFunc
- type MiddlewareStack
- type ParamValues
- type RouteConfig
- type ViewConfig
- type ViewData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { Configuration DefaultConfiguration Middleware *MiddlewareStack `json:"-"` // contains filtered or unexported fields }
func New ¶
func New(conf DefaultConfiguration) *Application
New creates a new instance of Application
func (*Application) Assets ¶ added in v0.0.6
func (app *Application) Assets() []Asset
func (*Application) GET ¶ added in v0.0.4
func (app *Application) GET(p string, h Handler)
func (Application) NewContext ¶ added in v0.0.4
func (app Application) NewContext(rc RouteConfig, w http.ResponseWriter, r *http.Request) Context
func (*Application) Serve ¶
func (app *Application) Serve()
func (*Application) Use ¶ added in v0.0.4
func (app *Application) Use(mw ...MiddlewareFunc)
type Asset ¶ added in v0.0.6
type Asset struct { Name string Extension FileExtension }
type AssetsConfigs ¶ added in v0.0.6
type AssetsConfigs struct {
Path string `json:"path"`
}
type DatabaseConfig ¶
type DefaultConfiguration ¶
type DefaultConfiguration struct { App AppConfig DB DatabaseConfig View ViewConfig Assets AssetsConfigs }
func LoadConfigs ¶
func LoadConfigs(cfg *DefaultConfiguration) *DefaultConfiguration
type DefaultContext ¶ added in v0.0.4
func (*DefaultContext) Params ¶ added in v0.0.4
func (d *DefaultContext) Params() ParamValues
func (*DefaultContext) Request ¶ added in v0.0.4
func (d *DefaultContext) Request() *http.Request
Request returns the original Request.
func (*DefaultContext) Response ¶ added in v0.0.4
func (d *DefaultContext) Response() http.ResponseWriter
Response returns the original Response for the request.
type FileExtension ¶ added in v0.0.6
type FileExtension string
const ( Javascript FileExtension = "js" Stylesheet FileExtension = "css" )
type MiddlewareFunc ¶ added in v0.0.4
type MiddlewareStack ¶ added in v0.0.4
type MiddlewareStack struct {
// contains filtered or unexported fields
}
func (*MiddlewareStack) Use ¶ added in v0.0.4
func (ms *MiddlewareStack) Use(mw ...MiddlewareFunc)
type ParamValues ¶ added in v0.0.4
type RouteConfig ¶ added in v0.0.4
type RouteConfig struct { Method string `json:"method"` Path string `json:"path"` HandlerName string `json:"handler"` ResourceName string `json:"resourceName,omitempty"` PathName string `json:"pathName"` Aliases []string `json:"aliases"` MuxRoute *mux.Route `json:"-"` Handler Handler `json:"-"` App *Application `json:"-"` }
func (RouteConfig) ServeHTTP ¶ added in v0.0.4
func (r RouteConfig) ServeHTTP(res http.ResponseWriter, req *http.Request)
type ViewConfig ¶ added in v0.0.4
type ViewConfig struct {
Path string `json:"path"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.