Documentation
¶
Index ¶
- Variables
- type App
- func (app *App) AfterFilter(pattern string, filterHandler FilterHandler) *App
- func (app *App) AfterInterceptor(pattern string, interceptorHandler InterceptorHandler) *App
- func (app *App) Banner(banner bool) *App
- func (app *App) BeforeFilter(pattern string, filterHandler FilterHandler) *App
- func (app *App) BeforeInterceptor(pattern string, interceptorHandler InterceptorHandler) *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) 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) 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) PreflightedHandler(handler Handler) *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)
- func (app *App) Use(middlewares ...Middleware) *App
- func (app *App) UseFilter(filterMiddlewares ...FilterMiddleware) *App
- func (app *App) UseInterceptor(interceptorMiddlewares ...InterceptorMiddleware) *App
- 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) ClearCaches()
- func (context *Context) ClearMiddlewareCtx(name string)
- func (context *Context) GetCache(key string) interface{}
- func (context *Context) GetMiddlewareCtx(name string) *hashmap.HashMap
- func (context *Context) GetMiddlewareData(name, key string) gotypes.V
- 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) RemoveMiddlewareData(name, key string)
- func (context *Context) SetCache(key string, data interface{})
- func (context *Context) SetDone(done bool) *Context
- func (context *Context) SetHeader(name, value string) *Context
- func (context *Context) SetMiddlewareData(name, key string, val gotypes.V)
- 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
- func (context *FilterContext) ClearCaches()
- func (context *FilterContext) ClearMiddlewareCtx(name string)
- func (context *FilterContext) GetCache(key string) interface{}
- func (context *FilterContext) GetMiddlewareCtx(name string) *hashmap.HashMap
- func (context *FilterContext) GetMiddlewareData(name, key string) gotypes.V
- func (context *FilterContext) RemoveCache(key string)
- func (context *FilterContext) RemoveMiddlewareData(name, key string)
- func (context *FilterContext) SetCache(key string, data interface{})
- func (context *FilterContext) SetMiddlewareData(name, key string, val gotypes.V)
- type FilterHandler
- type FilterMiddleware
- type Handler
- type InterceptorHandler
- type InterceptorMiddleware
- type Middleware
- 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 ¶
var Logger = &logger{}
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
Define app struct
func (*App) AfterFilter ¶
func (app *App) AfterFilter(pattern string, filterHandler FilterHandler) *App
Route after filter
func (*App) AfterInterceptor ¶
func (app *App) AfterInterceptor(pattern string, interceptorHandler InterceptorHandler) *App
Route after interceptor
func (*App) BeforeFilter ¶
func (app *App) BeforeFilter(pattern string, filterHandler FilterHandler) *App
Route before filter
func (*App) BeforeInterceptor ¶
func (app *App) BeforeInterceptor(pattern string, interceptorHandler InterceptorHandler) *App
Route before interceptor
func (*App) DefaultHandler ¶
Config default handler
func (*App) PreflightedHandler ¶
Config preflighted handler
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
func (*App) UseFilter ¶
func (app *App) UseFilter(filterMiddlewares ...FilterMiddleware) *App
Using filter middlewares
func (*App) UseInterceptor ¶
func (app *App) UseInterceptor(interceptorMiddlewares ...InterceptorMiddleware) *App
Using interceptor middlewares
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<*arraylist.ArrayList<MultipartFile>> Multipart *hashmap.HashMap //multipart map //K<string>,V<*arraylist.ArrayList<string>> Parameters *hashmap.HashMap //map[string][]string MultipartParsed bool //multipart parsed ? Response *Response //Response // contains filtered or unexported fields }
Define context struct
func (*Context) BinaryWith ¶
Response binary to client with ContentType
func (*Context) ClearMiddlewareCtx ¶
Clear middleware context
func (*Context) GetMiddlewareCtx ¶
Get middleware context
func (*Context) GetMiddlewareData ¶
Get middleware data
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
func (*Context) RemoveMiddlewareData ¶
Remove middleware data
func (*Context) SetMiddlewareData ¶
Set middleware data
type FilterContext ¶
type FilterContext struct { RequestURI string ParsedRequestURI string RequestMethod string RequestHeader http.Header ResponseHeader *http.Header Parameters *hashmap.HashMap // contains filtered or unexported fields }
Define filter context
func (*FilterContext) ClearMiddlewareCtx ¶
func (context *FilterContext) ClearMiddlewareCtx(name string)
Clear middleware context
func (*FilterContext) GetCache ¶
func (context *FilterContext) GetCache(key string) interface{}
Get app cache
func (*FilterContext) GetMiddlewareCtx ¶
func (context *FilterContext) GetMiddlewareCtx(name string) *hashmap.HashMap
Get middleware context
func (*FilterContext) GetMiddlewareData ¶
func (context *FilterContext) GetMiddlewareData(name, key string) gotypes.V
Get middleware data
func (*FilterContext) RemoveCache ¶
func (context *FilterContext) RemoveCache(key string)
Remove app cache
func (*FilterContext) RemoveMiddlewareData ¶
func (context *FilterContext) RemoveMiddlewareData(name, key string)
Remove middleware data
func (*FilterContext) SetCache ¶
func (context *FilterContext) SetCache(key string, data interface{})
Set app cache
func (*FilterContext) SetMiddlewareData ¶
func (context *FilterContext) SetMiddlewareData(name, key string, val gotypes.V)
Set middleware data
type FilterMiddleware ¶
type FilterMiddleware interface { //Set FilterMiddleware name Name() string //Set FilterMiddleware type Type() string //Set FilterMiddleware pattern Pattern() string //Process FilterMiddleware Process() FilterHandler }
Define Filter Middleware interface
type InterceptorMiddleware ¶
type InterceptorMiddleware interface { //Set InterceptorMiddleware name Name() string //Set InterceptorMiddleware type Type() string //Set InterceptorMiddleware pattern Pattern() string //Process InterceptorMiddleware Process() InterceptorHandler }
Define Interceptor Middleware interface
type Middleware ¶
type Middleware interface { //Set Middleware name Name() string //Set Middleware method Method() string //Set Middleware pattern Pattern() string //Process Middleware Process() Handler //Set Middleware fields Fields() []*Field }
Define Middleware interface
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