Documentation ¶
Index ¶
- Constants
- type Ctx
- func (c Ctx) Body2File(key string) ([]byte, error)
- func (c Ctx) Body2JSON(output interface{}) error
- func (c Ctx) GetParam(src ParamSource, key string, idx int) Param
- func (c Ctx) GetQueryParamInt(key string) (int, error)
- func (c Ctx) GetQueryParamString(key string) string
- func (c Ctx) GetRUriSliceInt(name string) (int, error)
- func (c Ctx) GetUriSliceString(name string) string
- func (c Ctx) PrintHead()
- func (c Ctx) ServeBufferFile(filename string, r io.ReadSeeker)
- func (c Ctx) ServeDiskFile(filename, filepath string)
- func (c Ctx) WriteError(code int, err error, errFmt ErrFormatter)
- func (c Ctx) WriteMapJSON(code int, values map[string]interface{})
- func (c Ctx) WriteString(code int, format string, values ...interface{})
- func (c Ctx) WriteStructJSON(code int, output interface{}, errFmt ErrFormatter)
- type ErrFormatter
- type HandlerFunc
- type Param
- type ParamSource
- type Router
Constants ¶
View Source
const ( Head = ParamSource("Head") UriSlice = ParamSource("UriSlice") Query = ParamSource("Query") Body = ParamSource("Body") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ctx ¶
type Ctx struct {
// contains filtered or unexported fields
}
func (Ctx) GetQueryParamInt ¶
http://example.com/path1/path2?k1=v1&k2=v2 [k1,v1] and [k2, v2] are query params
func (Ctx) GetQueryParamString ¶
http://example.com/path1/path2?k1=v1&k2=v2 [k1,v1] and [k2, v2] are query params
func (Ctx) GetRUriSliceInt ¶
http://example.com/path1/path2?k1=v1&k2=v2 path1 and path2 are router slices
func (Ctx) GetUriSliceString ¶
http://example.com/path1/path2?k1=v1&k2=v2 path1 and path2 are router slices
func (Ctx) ServeBufferFile ¶
func (c Ctx) ServeBufferFile(filename string, r io.ReadSeeker)
func (Ctx) ServeDiskFile ¶
func (Ctx) WriteError ¶
func (c Ctx) WriteError(code int, err error, errFmt ErrFormatter)
func (Ctx) WriteMapJSON ¶
func (Ctx) WriteString ¶
func (Ctx) WriteStructJSON ¶
func (c Ctx) WriteStructJSON(code int, output interface{}, errFmt ErrFormatter)
type ErrFormatter ¶
type HandlerFunc ¶
type HandlerFunc func(*Ctx)
type ParamSource ¶
type ParamSource string
Click to show internal directories.
Click to hide internal directories.