Documentation ¶
Index ¶
- type App
- func (app *App) ClearCaches()
- func (app *App) DefaultHandler(handler Handler) *App
- func (app *App) Delete(pattern string, handler Handler, fields ...*Field) *App
- func (app *App) FaviconIco() *App
- func (app *App) FilterAfter(pattern string, filterHandler FilterHandler) *App
- func (app *App) FilterBefore(pattern string, filterHandler FilterHandler) *App
- func (app *App) Get(pattern string, handler Handler, fields ...*Field) *App
- func (app *App) GetCache(key string) interface{}
- func (app *App) GetContextPath() string
- func (app *App) GetStaticCache() bool
- func (app *App) GetStaticEnable() bool
- func (app *App) GetStaticPattern() string
- func (app *App) GetStaticPrefix() string
- func (app *App) GetValidateErrCode() int
- func (app *App) GetViewCache() bool
- func (app *App) GetViewPrefix() string
- func (app *App) GetViewSuffix() string
- func (app *App) GetWebRoot() string
- func (app *App) InterceptorAfter(pattern string, interceptorHandler InterceptorHandler) *App
- func (app *App) InterceptorBefore(pattern string, interceptorHandler InterceptorHandler) *App
- func (app *App) LogFatal(message string, args ...interface{})
- func (app *App) LogInfo(message string, args ...interface{})
- func (app *App) LogWarn(message string, args ...interface{})
- func (app *App) Patch(pattern string, handler Handler, fields ...*Field) *App
- func (app *App) Post(pattern string, handler Handler, fields ...*Field) *App
- func (app *App) Put(pattern string, handler Handler, fields ...*Field) *App
- func (app *App) RegisterStaticRes(fileExt, contentType string) *App
- func (app *App) RemoveCache(key string)
- func (app *App) Req(pattern string, handler Handler, fields ...*Field) *App
- func (app *App) RequestNotSupportedHandler(handler Handler) *App
- func (app *App) Run()
- func (app *App) RunAs(host string, port int)
- func (app *App) SetCache(key string, data interface{})
- func (app *App) SetContextPath(contextPath string) *App
- func (app *App) SetStaticCache(cache bool) *App
- func (app *App) SetStaticEnable(enable bool) *App
- func (app *App) SetStaticPattern(pattern string) *App
- func (app *App) SetStaticPrefix(prefix string) *App
- func (app *App) SetValidateErrCode(code int) *App
- func (app *App) SetViewCache(cache bool) *App
- func (app *App) SetViewPrefix(prefix string) *App
- func (app *App) SetViewSuffix(suffix string) *App
- func (app *App) SetWebRoot(webRoot string) *App
- func (app *App) TLS(certFile, keyFile string)
- type Context
- func (context *Context) AddHeader(name, value string) *Context
- func (context *Context) Binary(buffer []byte)
- func (context *Context) BinaryWith(buffer []byte, contentType string)
- func (context *Context) ClearCache()
- func (context *Context) GetCache(key string) interface{}
- func (context *Context) GetMultipartFile(name string) *MultipartFile
- func (context *Context) GetMultipartFiles(name string) []*MultipartFile
- func (context *Context) GetParameter(name string) string
- func (context *Context) GetParameterWithDefault(name, defaultValue string) string
- func (context *Context) GetParameters(name string) []string
- func (context *Context) GetParametersWithDefault(name string, defaultValue []string) []string
- func (context *Context) Image(buffer []byte)
- func (context *Context) JSON(data interface{})
- func (context *Context) ParseMultipart(maxMemory int64) error
- func (context *Context) RemoveCache(key string)
- func (context *Context) SetCache(key string, data interface{})
- func (context *Context) SetHeader(name, value string) *Context
- func (context *Context) Text(text string)
- func (context *Context) View(name string)
- type Field
- func (field *Field) Concat(concat bool) *Field
- func (field *Field) ConcatRune(concatRune rune) *Field
- func (field *Field) DefaultVal(defaultVal string) *Field
- func (field *Field) Enums(enums ...string) *Field
- func (field *Field) Fixed(fixed string) *Field
- func (field *Field) Length(length int) *Field
- func (field *Field) Max(max int) *Field
- func (field *Field) MaxLength(maxLength int) *Field
- func (field *Field) Min(min int) *Field
- func (field *Field) MinLength(minLength int) *Field
- func (field *Field) Name(name string) *Field
- func (field *Field) Preset(preset bool) *Field
- func (field *Field) Regex(regex string) *Field
- func (field *Field) Split(split bool) *Field
- func (field *Field) SplitRune(splitRune rune) *Field
- func (field *Field) Validate(validate bool) *Field
- type FilterContext
- type FilterHandler
- type Handler
- type InterceptorHandler
- type MultipartFile
- type Response
- func (response *Response) GetContentType() string
- func (response *Response) GetData() []byte
- func (response *Response) GetHeaders() *hashmap.HashMap
- func (response *Response) SetContentType(contentType string) *Response
- func (response *Response) SetDone(done bool) *Response
- func (response *Response) SetHeaders(headers *hashmap.HashMap) *Response
- type StaticHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
Define app struct
func (*App) DefaultHandler ¶
Config default handler
func (*App) FilterAfter ¶
func (app *App) FilterAfter(pattern string, filterHandler FilterHandler) *App
Route after filter
func (*App) FilterBefore ¶
func (app *App) FilterBefore(pattern string, filterHandler FilterHandler) *App
Route before filter
func (*App) InterceptorAfter ¶
func (app *App) InterceptorAfter(pattern string, interceptorHandler InterceptorHandler) *App
Route after interceptor
func (*App) InterceptorBefore ¶
func (app *App) InterceptorBefore(pattern string, interceptorHandler InterceptorHandler) *App
Route before interceptor
func (*App) RegisterStaticRes ¶
Register a static res
func (*App) RequestNotSupportedHandler ¶
Config request not supported handler
func (*App) SetContextPath ¶
Set contextPath
func (*App) SetStaticPattern ¶
Set static pattern
func (*App) SetValidateErrCode ¶
Set validate err code
type Context ¶
type Context struct { Request *http.Request //request RequestURI string //request uri ParsedRequestURI string //parsed request uri RequestMethod string //request method RequestHeader http.Header //request header ResponseWriter http.ResponseWriter //Response writer ResponseHeader *http.Header //Response header //K<string>,V<*list.ArrayList<MultipartFile>> Multipart *hashmap.HashMap //multipart map //K<string>,V<*list.ArrayList<string>> Parameters *hashmap.HashMap //map[string][]string MultipartParsed bool //multipart parsed ? Response *Response //Response }
Define context struct
func (*Context) BinaryWith ¶
Response binary to client with ContentType
func (*Context) GetMultipartFile ¶
func (context *Context) GetMultipartFile(name string) *MultipartFile
Get multipart file
func (*Context) GetMultipartFiles ¶
func (context *Context) GetMultipartFiles(name string) []*MultipartFile
Get request parameter
func (*Context) GetParameter ¶
Get request parameter
func (*Context) GetParameterWithDefault ¶
Get request parameter with default
func (*Context) GetParameters ¶
Get request parameters
func (*Context) GetParametersWithDefault ¶
Get request parameters with default
func (*Context) ParseMultipart ¶
Parse Multipart
type FilterContext ¶
type FilterContext struct { RequestURI string ParsedRequestURI string RequestMethod string RequestHeader http.Header ResponseHeader *http.Header Parameters *hashmap.HashMap //map[string][]string }
Define filter context
type MultipartFile ¶
type MultipartFile struct {
// contains filtered or unexported fields
}
Define MultipartFile struct
func (*MultipartFile) ContentType ¶
func (file *MultipartFile) ContentType() string
Get multipart file content type
func (*MultipartFile) Copy ¶
func (file *MultipartFile) Copy(distName string) error
Copy file to dist name
func (*MultipartFile) Filename ¶
func (file *MultipartFile) Filename() string
Get multipart file name
func (*MultipartFile) Header ¶
func (file *MultipartFile) Header(name string) string
Get multipart header
func (*MultipartFile) Headers ¶
func (file *MultipartFile) Headers() *hashmap.HashMap
Get multipart headers
func (*MultipartFile) Size ¶
func (file *MultipartFile) Size() int64
Get multipart file size in byte
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Define Response struct
func (*Response) GetContentType ¶
Get content type
func (*Response) SetContentType ¶
Set content type
type StaticHandler ¶
Define static handler