Documentation ¶
Index ¶
- Variables
- func BasicAuth(h httprouter.Handle, requiredUser, requiredPassword string) httprouter.Handle
- func GetFlash(w http.ResponseWriter, r *http.Request) (bool, []interface{})
- func GetSession(w http.ResponseWriter, r *http.Request, key string) (bool, interface{})
- func HandleAPI(pattern string, handler http.Handler)
- func HandleAPIFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func HandleAPIMethod(method Method, pattern string, ...)
- func HandleUI(pattern string, handler http.Handler)
- func HandleUIFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func HandleUIMethod(method Method, pattern string, ...)
- func SetFlash(w http.ResponseWriter, r *http.Request, msg string) bool
- func SetSession(w http.ResponseWriter, r *http.Request, key string, value interface{}) bool
- type ErrEmptyJson
- type Handler
- func (w Handler) EncodeJson(v interface{}) (b []byte, err error)
- func (this Handler) Error(w http.ResponseWriter, err error)
- func (this Handler) Error404(w http.ResponseWriter)
- func (this Handler) Error500(w http.ResponseWriter, msg string)
- func (this Handler) Flush(w http.ResponseWriter)
- func (this Handler) Get(req *http.Request, key string, defaultValue string) string
- func (this Handler) GetIntOrDefault(r *http.Request, key string, defaultValue int) int
- func (this Handler) GetJson(r *http.Request) (*jsonq.JsonQuery, error)
- func (this Handler) GetParameter(r *http.Request, key string) string
- func (this Handler) GetParameterOrDefault(r *http.Request, key string, defaultValue string) string
- func (this Handler) GetRawBody(r *http.Request) ([]byte, error)
- func (this Handler) Write(w http.ResponseWriter, b []byte) (int, error)
- func (this Handler) WriteHeader(w http.ResponseWriter, code int)
- func (this Handler) WriteJson(w http.ResponseWriter, v interface{}, statusCode int) error
- func (this Handler) WriteJsonHeader(w http.ResponseWriter)
- func (this Handler) WriteListResultJson(w http.ResponseWriter, total int, v interface{}, statusCode int) error
- type Method
- type Result
Constants ¶
This section is empty.
Variables ¶
View Source
var RegisteredAPIFuncHandler map[string]func(http.ResponseWriter, *http.Request)
View Source
var RegisteredAPIHandler map[string]http.Handler
View Source
var RegisteredAPIMethodHandler map[string]map[string]func(w http.ResponseWriter, req *http.Request, ps httprouter.Params)
View Source
var RegisteredUIFuncHandler map[string]func(http.ResponseWriter, *http.Request)
View Source
var RegisteredUIHandler map[string]http.Handler
View Source
var RegisteredUIMethodHandler map[string]map[string]func(w http.ResponseWriter, req *http.Request, ps httprouter.Params)
Functions ¶
func BasicAuth ¶
func BasicAuth(h httprouter.Handle, requiredUser, requiredPassword string) httprouter.Handle
func GetSession ¶
func HandleAPIFunc ¶
func HandleAPIFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
func HandleAPIMethod ¶
func HandleAPIMethod(method Method, pattern string, handler func(w http.ResponseWriter, req *http.Request, ps httprouter.Params))
func HandleUIFunc ¶
func HandleUIFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
func HandleUIMethod ¶
func HandleUIMethod(method Method, pattern string, handler func(w http.ResponseWriter, req *http.Request, ps httprouter.Params))
func SetSession ¶
Types ¶
type ErrEmptyJson ¶
type ErrEmptyJson struct { }
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (Handler) EncodeJson ¶
func (Handler) Error404 ¶
func (this Handler) Error404(w http.ResponseWriter)
func (Handler) Flush ¶
func (this Handler) Flush(w http.ResponseWriter)
func (Handler) GetIntOrDefault ¶
func (Handler) GetParameterOrDefault ¶
func (Handler) WriteHeader ¶
func (this Handler) WriteHeader(w http.ResponseWriter, code int)
func (Handler) WriteJson ¶
func (this Handler) WriteJson(w http.ResponseWriter, v interface{}, statusCode int) error
func (Handler) WriteJsonHeader ¶
func (this Handler) WriteJsonHeader(w http.ResponseWriter)
func (Handler) WriteListResultJson ¶
Click to show internal directories.
Click to hide internal directories.