Documentation
¶
Index ¶
- type BaseMuxController
- type DemoApi
- type DemoController
- type JsonData
- type JsonHandler
- type JsonMuxer
- type MuxController
- type ResponseRender
- type Server
- func (s *Server) Cleanup()
- func (s *Server) DeleteJson(path string, name string, handle JsonHandler)
- func (s *Server) GetJson(path string, name string, handle JsonHandler)
- func (s *Server) ListenAndServe(addr string) error
- func (s *Server) PatchJson(path string, name string, handle JsonHandler)
- func (s *Server) PostJson(path string, name string, handle JsonHandler)
- func (s *Server) PutJson(path string, name string, handle JsonHandler)
- func (s *Server) RenderHtmlOr500(w http.ResponseWriter, status int, name string, binding interface{})
- func (s *Server) RenderJsonOr500(w http.ResponseWriter, status int, v interface{})
- func (s *Server) RenderServerError(w http.ResponseWriter, status int)
- type UrlReverser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseMuxController ¶
type BaseMuxController struct { ResponseRender UrlReverser }
func (*BaseMuxController) GetTemplates ¶
func (b *BaseMuxController) GetTemplates() []*render.TemplateSet
func (*BaseMuxController) SetResponseRender ¶
func (b *BaseMuxController) SetResponseRender(r ResponseRender)
func (*BaseMuxController) SetUrlReverser ¶
func (b *BaseMuxController) SetUrlReverser(r UrlReverser)
type DemoController ¶
type DemoController struct {
BaseMuxController
}
func (*DemoController) GetTemplates ¶
func (c *DemoController) GetTemplates() []*render.TemplateSet
func (*DemoController) MuxHandlers ¶
func (c *DemoController) MuxHandlers(m JsonMuxer)
type JsonData ¶
type JsonData struct { Status string `json:"status"` Payload interface{} `json:"payload"` }
type JsonHandler ¶
type JsonMuxer ¶
type JsonMuxer interface { server.Muxer GetJson(path string, name string, handle JsonHandler) PostJson(path string, name string, handle JsonHandler) PutJson(path string, name string, handle JsonHandler) PatchJson(path string, name string, handle JsonHandler) DeleteJson(path string, name string, handle JsonHandler) }
type MuxController ¶
type MuxController interface { MuxHandlers(m JsonMuxer) SetResponseRender(r ResponseRender) SetUrlReverser(r UrlReverser) GetTemplates() []*render.TemplateSet }
type ResponseRender ¶
type ResponseRender interface { RenderJsonOr500(w http.ResponseWriter, status int, v interface{}) RenderHtmlOr500(w http.ResponseWriter, status int, name string, binding interface{}) RenderServerError(w http.ResponseWriter, status int) }
type Server ¶
func (*Server) DeleteJson ¶
func (s *Server) DeleteJson(path string, name string, handle JsonHandler)
func (*Server) ListenAndServe ¶
func (*Server) RenderHtmlOr500 ¶
func (s *Server) RenderHtmlOr500(w http.ResponseWriter, status int, name string, binding interface{})
func (*Server) RenderJsonOr500 ¶
func (s *Server) RenderJsonOr500(w http.ResponseWriter, status int, v interface{})
func (*Server) RenderServerError ¶
func (s *Server) RenderServerError(w http.ResponseWriter, status int)
Click to show internal directories.
Click to hide internal directories.