Documentation
¶
Index ¶
- func DefaultResourceChecker(ctx context.Context) (context.Context, error)
- type Checker
- type ContextChecker
- type Deleter
- type Getter
- type Optioner
- type Peeker
- type Poster
- type Resource
- func (_ Resource) BadRequest(err error) *errors.BadRequestError
- func (_ Resource) BadRequestf(s string, args ...interface{}) *errors.BadRequestError
- func (_ Resource) BestMime(req *http.Request, supported ...string) (string, error)
- func (_ Resource) FormValue(req *http.Request, key string) (string, error, bool)
- func (_ Resource) FormValueBool(req *http.Request, key string) (bool, error, bool)
- func (_ Resource) FormValueFloat32(req *http.Request, key string) (float32, error, bool)
- func (_ Resource) FormValueInt16(req *http.Request, key string) (int16, error, bool)
- func (_ Resource) FormValueInt32(req *http.Request, key string) (int32, error, bool)
- func (m *Resource) Init(v interface{}, eh web.ErrorHandlerFunc, check ContextChecker)
- func (_ Resource) ParseForm(req *http.Request, size int64) error
- func (_ Resource) RouteParam(req *http.Request, key string) (interface{}, error, bool)
- func (_ Resource) RouteParamInt(req *http.Request, key string) (int, error, bool)
- func (_ Resource) RouteParamIntSlice(req *http.Request, key string) ([]int, error, bool)
- func (_ Resource) RouteParamSlice(req *http.Request, key string) ([]interface{}, error, bool)
- func (_ Resource) RouteParamString(req *http.Request, key string) (string, error, bool)
- func (_ Resource) RouteParamStringSlice(req *http.Request, key string) ([]string, error, bool)
- func (_ Resource) RoutePath(req *http.Request) string
- func (_ Resource) SeeOther(location string, args ...interface{}) *errors.RedirectError
- func (m *Resource) ServeHTTP(rw http.ResponseWriter, req *http.Request)
- func (m *Resource) TryServeHTTP(rw http.ResponseWriter, req *http.Request) error
- func (_ Resource) WriteJSON(w http.ResponseWriter, prefix string, indent string, d interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Deleter ¶
type Deleter interface {
Delete(rw http.ResponseWriter, req *http.Request) error
}
DELETE
type Optioner ¶
type Optioner interface {
Options(rw http.ResponseWriter, req *http.Request) error
}
OPTIONS
type Resource ¶
type Resource struct {
// contains filtered or unexported fields
}
func NewResource ¶
func NewResource(v interface{}, eh web.ErrorHandlerFunc, check ContextChecker) *Resource
func (Resource) BadRequest ¶
func (_ Resource) BadRequest(err error) *errors.BadRequestError
func (Resource) BadRequestf ¶
func (_ Resource) BadRequestf(s string, args ...interface{}) *errors.BadRequestError
func (Resource) FormValueBool ¶
Tries to get a bool field from a POSTed form
func (Resource) FormValueFloat32 ¶
Tries to get a float32 field from a POSTed form
func (Resource) FormValueInt16 ¶
Tries to get a int16 field from a POSTed form
func (Resource) FormValueInt32 ¶
Tries to get a int32 field from a POSTed form
func (*Resource) Init ¶
func (m *Resource) Init(v interface{}, eh web.ErrorHandlerFunc, check ContextChecker)
func (Resource) RouteParam ¶
Tries to get a interface{} Route Parameter from RouteContext
func (Resource) RouteParamInt ¶
Tries to get a int Route Parameter from RouteContext
func (Resource) RouteParamIntSlice ¶
Tries to get slice of int Route Parameters from RouteContext
func (Resource) RouteParamSlice ¶
Tries to get slice of interface{} Route Parameters from RouteContext
func (Resource) RouteParamString ¶
Tries to get a string Route Parameter from RouteContext
func (Resource) RouteParamStringSlice ¶
Tries to get slice of string Route Parameters from RouteContext
func (Resource) SeeOther ¶
func (_ Resource) SeeOther(location string, args ...interface{}) *errors.RedirectError
func (*Resource) ServeHTTP ¶
func (m *Resource) ServeHTTP(rw http.ResponseWriter, req *http.Request)
func (*Resource) TryServeHTTP ¶
Click to show internal directories.
Click to hide internal directories.