Documentation ¶
Index ¶
- Variables
- func AddRoute(route *route)
- func AddRoutes(route ...*route)
- func AddTemplGlob(pattern string)
- func Delete(path string, action action)
- func DeleteRoute(path string, action action) *route
- func Get(path string, action action)
- func GetRoute(path string, action action) *route
- func Post(path string, action action)
- func PostRoute(path string, action action) *route
- func PutRoute(path string, action action) *route
- func ServeHTTP(rw http.ResponseWriter, req *http.Request)
- func SetLogger(log fiplog.Logger)
- func Start(port string) error
- type Context
- func (ctx *Context) BadRequest()
- func (ctx *Context) Conflict()
- func (ctx *Context) GetEntity(v interface{}) (err error)
- func (ctx *Context) GetFields() (fields *Fields, err error)
- func (ctx *Context) GetIntParam(key string) (i int)
- func (ctx *Context) GetIntParamWithDefault(key string, defaultVal int) int
- func (ctx *Context) GetIntQuery(key string, dflt int) int
- func (ctx *Context) GetParam(key string) interface{}
- func (ctx *Context) GetPlainReq() (body []byte)
- func (ctx *Context) GetQuery(key string) string
- func (ctx *Context) GetReqHeader(key string) (val string)
- func (ctx *Context) GetStringParam(key string) (s string)
- func (ctx *Context) GetUploadedFile() *UploadedFile
- func (ctx *Context) InternalError()
- func (ctx *Context) MethodNotAllowed()
- func (ctx *Context) Ok()
- func (ctx *Context) OkOrError(ok bool)
- func (ctx *Context) PageNotFound()
- func (ctx *Context) Request() *http.Request
- func (ctx *Context) ResponseWriter() http.ResponseWriter
- func (ctx *Context) ServeBody(content []byte)
- func (ctx *Context) ServeByTemplate(templ *template.Template, data interface{})
- func (ctx *Context) ServeFile(path string)
- func (ctx *Context) ServeHtml(content []byte)
- func (ctx *Context) ServeHtmlFile(path string)
- func (ctx *Context) ServeJson(o interface{})
- func (ctx *Context) ServeStatic(name string, content []byte)
- func (ctx *Context) ServeStatus(code int)
- func (ctx *Context) ServeString(o ...interface{})
- func (ctx *Context) ServeXML(content []byte)
- func (ctx *Context) SetHeader(key, val string)
- func (ctx *Context) Unauthorized()
- type Decoder
- type Encoder
- type Encoding
- type Fields
- type HttpMethod
- type Router
- type RouterType
- type RpcRequest
- type RpcResponse
- type Service
- func (svc *Service) AddRoute(route *route)
- func (svc *Service) AddRoutes(route ...*route)
- func (svc *Service) Delete(path string, action action)
- func (svc *Service) FileServer()
- func (svc *Service) Get(path string, action action)
- func (svc *Service) Post(path string, action action)
- func (svc *Service) ServeHTTP(rw http.ResponseWriter, req *http.Request)
- func (svc *Service) Start(port string) error
- type UploadedFile
Constants ¶
This section is empty.
Variables ¶
View Source
var MaxUploadSize int64 = 1024 * 1024
const DefaultMaxUploadSize = 1024*1024
View Source
var SupportedUploadFileTypes = []string{"jpg", "jpeg", "gif", "png"}
Functions ¶
func AddTemplGlob ¶
func AddTemplGlob(pattern string)
func DeleteRoute ¶
func DeleteRoute(path string, action action) *route
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶
func NewContext(rw http.ResponseWriter, req *http.Request) *Context
func (*Context) BadRequest ¶
func (ctx *Context) BadRequest()
func (*Context) GetIntParam ¶
func (*Context) GetIntParamWithDefault ¶
func (*Context) GetPlainReq ¶
func (*Context) GetReqHeader ¶
func (*Context) GetStringParam ¶
func (*Context) GetUploadedFile ¶
func (ctx *Context) GetUploadedFile() *UploadedFile
var UploadPath = "."
func (*Context) InternalError ¶
func (ctx *Context) InternalError()
func (*Context) MethodNotAllowed ¶
func (ctx *Context) MethodNotAllowed()
func (*Context) PageNotFound ¶
func (ctx *Context) PageNotFound()
func (*Context) ResponseWriter ¶
func (ctx *Context) ResponseWriter() http.ResponseWriter
func (*Context) ServeByTemplate ¶
func (*Context) ServeHtmlFile ¶
func (*Context) ServeStatic ¶
func (*Context) ServeStatus ¶
func (*Context) ServeString ¶
func (ctx *Context) ServeString(o ...interface{})
func (*Context) Unauthorized ¶
func (ctx *Context) Unauthorized()
type Fields ¶
type Fields struct {
// contains filtered or unexported fields
}
func (Fields) GetIntField ¶
func (Fields) GetStringField ¶
type HttpMethod ¶
type HttpMethod string
const ( NotSupported HttpMethod = "" //not http GET HttpMethod = "GET" PUT HttpMethod = "PUT" POST HttpMethod = "POST" DELETE HttpMethod = "DELETE" HEAD = "HEAD" )
type RpcRequest ¶
type RpcRequest struct {
// contains filtered or unexported fields
}
type RpcResponse ¶
type RpcResponse struct {
// contains filtered or unexported fields
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func DefaultService ¶
func DefaultService() *Service
func NewService ¶
func NewService() *Service
func NewServiceWithRouterType ¶
func NewServiceWithRouterType(rType RouterType) *Service
func (*Service) FileServer ¶
func (svc *Service) FileServer()
type UploadedFile ¶
Click to show internal directories.
Click to hide internal directories.