Documentation
¶
Index ¶
- Constants
- func CurrentPath(r *http.Request) string
- func Path(root string, id string, suffixes ...string) string
- func RenderFlashes(renderer FlashRenderer, w http.ResponseWriter, r *http.Request) fido.Element
- func Url(root string, id string, suffixes ...string) string
- type BranchType
- type ErrorPageType
- type Flash
- type FlashRenderer
- type Flashes
- func (f *Flashes) Add(msg string, ugency Urgency, expiry int)
- func (f *Flashes) Clear(w http.ResponseWriter)
- func (f *Flashes) Decode(encoded string) error
- func (f *Flashes) Encode() ([]byte, error)
- func (f *Flashes) Error(msg string)
- func (f *Flashes) Info(msg string)
- func (f *Flashes) Save(w http.ResponseWriter) error
- func (f *Flashes) Success(msg string)
- func (f *Flashes) Warning(msg string)
- type Handler
- type Layout
- type PathType
- func (r *PathType) Delete(handler Handler) *PathType
- func (r *PathType) Get(handler Handler) *PathType
- func (r *PathType) Handle(method string, handler Handler) *PathType
- func (r *PathType) Map(route PathType) *PathType
- func (r *PathType) Patch(handler Handler) *PathType
- func (r *PathType) Post(handler Handler) *PathType
- func (r *PathType) Put(handler Handler) *PathType
- type Response
- func (r Response) Back() Response
- func (r Response) Content(content ...fido.Element) Response
- func (r Response) Err() error
- func (r Response) ErrDetail() string
- func (r Response) ErrPublic() string
- func (r Response) Error(err error) Response
- func (r Response) GetContent() []fido.Element
- func (r Response) Header(key, value string) Response
- func (r Response) Info(msg string, expiry ...int) Response
- func (r Response) Notify(msg string, urgency Urgency, expiry ...int) Response
- func (r Response) PushUrl(url string) Response
- func (r Response) Redirect(url string) Response
- func (r Response) ReplaceUrl(url string) Response
- func (r Response) Success(msg string, expiry ...int) Response
- func (r Response) Warning(msg string, expiry ...int) Response
- func (r Response) Wrap(msg string) Response
- type Router
- type Urgency
Constants ¶
View Source
const FlashCookieName = "flash"
Variables ¶
This section is empty.
Functions ¶
func CurrentPath ¶
func RenderFlashes ¶ added in v1.0.4
func RenderFlashes(renderer FlashRenderer, w http.ResponseWriter, r *http.Request) fido.Element
Types ¶
type ErrorPageType ¶
type Flashes ¶ added in v1.0.4
type Flashes []Flash
func LoadFlashes ¶ added in v1.0.4
func LoadFlashes(w http.ResponseWriter, r *http.Request) *Flashes
func (*Flashes) Clear ¶ added in v1.0.4
func (f *Flashes) Clear(w http.ResponseWriter)
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func (Response) GetContent ¶ added in v1.0.4
func (Response) ReplaceUrl ¶ added in v1.0.4
type Router ¶
func New ¶
func New(mux *http.ServeMux, layout Layout, errorPage ErrorPageType, flashRenderer FlashRenderer) *Router
func (*Router) Handle ¶
func (router *Router) Route(router *Router) *Router {
for path, route := range routes {
router.Path(path).Map(*route)
}
return router
}
func (*Router) HandleFunc ¶
Click to show internal directories.
Click to hide internal directories.