Documentation
¶
Index ¶
- Constants
- Variables
- func AddMiddleWare(name string, f MiddleWareConstructor) (err error)
- type BaseMiddleWare
- func (mw BaseMiddleWare) Body(ctxt *web.Context)
- func (mw BaseMiddleWare) Cleanup(ctxt *web.Context)
- func (mw BaseMiddleWare) Controller(ctxt *web.Context, cm *controller.ControlManager)
- func (mw BaseMiddleWare) Request(ctxt *web.Context)
- func (mw BaseMiddleWare) Response(ctxt *web.Context)
- func (mw BaseMiddleWare) View(ctxt *web.Context, vw mvc.View)
- type CSRFCheck
- type CSRFMiddleWare
- type CSRFTokenGetter
- func (ct CSRFTokenGetter) Cookie() *http.Cookie
- func (ct CSRFTokenGetter) FeedStructValue(ctxt *web.Context, field *controller.FieldMeta, value reflect.Value) (reflect.Value, error)
- func (ct CSRFTokenGetter) FormToken() template.HTML
- func (ct CSRFTokenGetter) Name() string
- func (ct CSRFTokenGetter) Ok() bool
- func (ct CSRFTokenGetter) URLWToken(path string, qstr ...web.Q) string
- func (ct CSRFTokenGetter) Value() string
- func (ct CSRFTokenGetter) Verify() bool
- type CacheMiddleWare
- type HTMLHead
- func (h *HTMLHead) AddCSS(css ...string)
- func (h *HTMLHead) AddCSSBatch(name string)
- func (h *HTMLHead) AddScript(script ...string)
- func (h *HTMLHead) AddScriptBatch(name string)
- func (h *HTMLHead) CSS() []string
- func (h *HTMLHead) Scripts() []string
- func (h *HTMLHead) SetTitle(title string)
- func (h *HTMLHead) Title() string
- type HTMLHeadMiddleWare
- func (mw *HTMLHeadMiddleWare) AddDefaultCSS(css ...string)
- func (mw *HTMLHeadMiddleWare) AddDefaultScript(script ...string)
- func (mw *HTMLHeadMiddleWare) Body(ctxt *web.Context)
- func (mw *HTMLHeadMiddleWare) CreateCSSBatch(name string, css ...string)
- func (mw *HTMLHeadMiddleWare) CreateScriptBatch(name string, script ...string)
- func (mw *HTMLHeadMiddleWare) View(ctxt *web.Context, vw mvc.View)
- type HTTPHeadMiddleWare
- type MiddleWare
- func CSRFMiddleWareConstructor() MiddleWare
- func CacheNoCacheMiddleWareConstructor() MiddleWare
- func CacheNoStoreMiddleWareConstructor() MiddleWare
- func CachePublicMiddleWareConstructor() MiddleWare
- func GetMiddleWare(name string) MiddleWare
- func HTMLHeadMiddleWareConstructor() MiddleWare
- func HTTPHeadMiddleWareConstructor() MiddleWare
- type MiddleWareConstructor
Constants ¶
View Source
const ( CacheProfileNoCache CacheProfileNoStore CacheProfilePublic )
Variables ¶
View Source
var (
ErrMiddleWareNameExists = errors.New("Name given for middleware already exists")
)
Functions ¶
func AddMiddleWare ¶
func AddMiddleWare(name string, f MiddleWareConstructor) (err error)
Types ¶
type BaseMiddleWare ¶
type BaseMiddleWare struct { }
func (BaseMiddleWare) Body ¶
func (mw BaseMiddleWare) Body(ctxt *web.Context)
func (BaseMiddleWare) Cleanup ¶
func (mw BaseMiddleWare) Cleanup(ctxt *web.Context)
func (BaseMiddleWare) Controller ¶
func (mw BaseMiddleWare) Controller(ctxt *web.Context, cm *controller.ControlManager)
func (BaseMiddleWare) Request ¶
func (mw BaseMiddleWare) Request(ctxt *web.Context)
func (BaseMiddleWare) Response ¶
func (mw BaseMiddleWare) Response(ctxt *web.Context)
type CSRFMiddleWare ¶
type CSRFMiddleWare struct {
BaseMiddleWare
}
func NewCSRFMiddleWare ¶
func NewCSRFMiddleWare() CSRFMiddleWare
func (CSRFMiddleWare) Controller ¶
func (mw CSRFMiddleWare) Controller(ctxt *web.Context, _ *controller.ControlManager)
type CSRFTokenGetter ¶
type CSRFTokenGetter struct {
// contains filtered or unexported fields
}
func (CSRFTokenGetter) Cookie ¶
func (ct CSRFTokenGetter) Cookie() *http.Cookie
func (CSRFTokenGetter) FeedStructValue ¶
func (ct CSRFTokenGetter) FeedStructValue(ctxt *web.Context, field *controller.FieldMeta, value reflect.Value) (reflect.Value, error)
func (CSRFTokenGetter) FormToken ¶
func (ct CSRFTokenGetter) FormToken() template.HTML
func (CSRFTokenGetter) Name ¶
func (ct CSRFTokenGetter) Name() string
func (CSRFTokenGetter) Ok ¶
func (ct CSRFTokenGetter) Ok() bool
func (CSRFTokenGetter) URLWToken ¶
func (ct CSRFTokenGetter) URLWToken(path string, qstr ...web.Q) string
func (CSRFTokenGetter) Value ¶
func (ct CSRFTokenGetter) Value() string
func (CSRFTokenGetter) Verify ¶
func (ct CSRFTokenGetter) Verify() bool
type CacheMiddleWare ¶
type CacheMiddleWare struct { BaseMiddleWare // contains filtered or unexported fields }
func NewCacheMiddleWare ¶
func NewCacheMiddleWare(profile int) CacheMiddleWare
func (CacheMiddleWare) Request ¶
func (mw CacheMiddleWare) Request(ctxt *web.Context)
type HTMLHead ¶
type HTMLHead struct {
// contains filtered or unexported fields
}
func (*HTMLHead) AddCSSBatch ¶
func (*HTMLHead) AddScriptBatch ¶
type HTMLHeadMiddleWare ¶
type HTMLHeadMiddleWare struct { BaseMiddleWare // contains filtered or unexported fields }
func NewHTMLHeadMiddleWare ¶
func NewHTMLHeadMiddleWare() *HTMLHeadMiddleWare
func (*HTMLHeadMiddleWare) AddDefaultCSS ¶
func (mw *HTMLHeadMiddleWare) AddDefaultCSS(css ...string)
func (*HTMLHeadMiddleWare) AddDefaultScript ¶
func (mw *HTMLHeadMiddleWare) AddDefaultScript(script ...string)
func (*HTMLHeadMiddleWare) Body ¶
func (mw *HTMLHeadMiddleWare) Body(ctxt *web.Context)
func (*HTMLHeadMiddleWare) CreateCSSBatch ¶
func (mw *HTMLHeadMiddleWare) CreateCSSBatch(name string, css ...string)
func (*HTMLHeadMiddleWare) CreateScriptBatch ¶
func (mw *HTMLHeadMiddleWare) CreateScriptBatch(name string, script ...string)
type HTTPHeadMiddleWare ¶
type HTTPHeadMiddleWare struct { BaseMiddleWare // contains filtered or unexported fields }
func NewHTTPHeadMiddleWare ¶
func NewHTTPHeadMiddleWare() *HTTPHeadMiddleWare
func (*HTTPHeadMiddleWare) AddDefaultHeader ¶
func (mw *HTTPHeadMiddleWare) AddDefaultHeader(name string, value ...string)
func (*HTTPHeadMiddleWare) Request ¶
func (mw *HTTPHeadMiddleWare) Request(ctxt *web.Context)
type MiddleWare ¶
type MiddleWare interface { Request(*web.Context) Body(*web.Context) Controller(*web.Context, *controller.ControlManager) View(*web.Context, mvc.View) Response(*web.Context) Cleanup(*web.Context) }
func CSRFMiddleWareConstructor ¶
func CSRFMiddleWareConstructor() MiddleWare
func CacheNoCacheMiddleWareConstructor ¶
func CacheNoCacheMiddleWareConstructor() MiddleWare
func CacheNoStoreMiddleWareConstructor ¶
func CacheNoStoreMiddleWareConstructor() MiddleWare
func CachePublicMiddleWareConstructor ¶
func CachePublicMiddleWareConstructor() MiddleWare
func GetMiddleWare ¶
func GetMiddleWare(name string) MiddleWare
func HTMLHeadMiddleWareConstructor ¶
func HTMLHeadMiddleWareConstructor() MiddleWare
func HTTPHeadMiddleWareConstructor ¶
func HTTPHeadMiddleWareConstructor() MiddleWare
type MiddleWareConstructor ¶
type MiddleWareConstructor func() MiddleWare
Click to show internal directories.
Click to hide internal directories.