Documentation
¶
Index ¶
- func MapFormToStruct(r *http.Request, dest interface{}) error
- type MappingError
- type RequestContext
- type URI
- func (u *URI) ExtractPathVariables(pattern string)
- func (u *URI) GetAllPathVariables() map[string]string
- func (u *URI) GetPath() string
- func (u *URI) GetPathRemainder() string
- func (u *URI) GetPathVariable(key string) string
- func (u *URI) GetQuery(key string) string
- func (u *URI) HasQuery(key string) bool
- func (u *URI) SetPathRemainder(rest string)
- func (u *URI) SetPathVariable(key, value string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapFormToStruct ¶
Types ¶
type MappingError ¶
type MappingError struct {
// contains filtered or unexported fields
}
func (*MappingError) Error ¶
func (e *MappingError) Error() string
type RequestContext ¶ added in v0.1.8
type RequestContext interface {
GetRequest() *http.Request
GetWriter() http.ResponseWriter
GetDI() serverdi.Context
GetURI() *URI
BindJSON(dest interface{}) error
BindForm(dest interface{}) error
JSON(status int, data interface{})
String(status int, text string)
Status(status int)
Set(key string, value interface{})
Get(key string) (interface{}, bool)
}
func NewContext ¶ added in v0.1.8
func NewContext(w http.ResponseWriter, r *http.Request, di serverdi.Context) RequestContext
type URI ¶ added in v0.1.8
type URI struct {
Path string
Query url.Values
PathVariables map[string]string
// PathRemainder is populated by the router when the matched
// route ends in a `**` catch-all segment. It holds everything in
// the real URL after the literal prefix — e.g. for pattern
// `/public/media/**` and URL `/public/media/owner/images/logo.png`
// the remainder is `owner/images/logo.png`. Empty for normal
// routes.
PathRemainder string
}
func (*URI) ExtractPathVariables ¶ added in v0.1.8
func (*URI) GetAllPathVariables ¶ added in v0.1.8
func (*URI) GetPathRemainder ¶ added in v0.1.9
GetPathRemainder returns the catch-all remainder computed by the router for `**` patterns. Empty when the route didn't use `**`.
func (*URI) GetPathVariable ¶ added in v0.1.8
func (*URI) SetPathRemainder ¶ added in v0.1.9
SetPathRemainder is called by the router for `**` routes.
func (*URI) SetPathVariable ¶ added in v0.1.8
Click to show internal directories.
Click to hide internal directories.