Documentation ¶
Index ¶
- func HandlerWrapper(path string, fn SpringWeb.Handler, filters []SpringWeb.Filter) func(*gin.Context)
- type Container
- type Context
- func (ctx *Context) Attachment(file string, name string)
- func (ctx *Context) Bind(i interface{}) error
- func (ctx *Context) Blob(code int, contentType string, b []byte)
- func (ctx *Context) ClientIP() string
- func (ctx *Context) ContentType() string
- func (ctx *Context) Cookie(name string) (*http.Cookie, error)
- func (ctx *Context) Cookies() []*http.Cookie
- func (ctx *Context) File(file string)
- func (ctx *Context) FormFile(name string) (*multipart.FileHeader, error)
- func (ctx *Context) FormParams() (url.Values, error)
- func (ctx *Context) FormValue(name string) string
- func (ctx *Context) Get(key string) interface{}
- func (ctx *Context) GetHeader(key string) string
- func (ctx *Context) GetRawData() ([]byte, error)
- func (ctx *Context) HTML(code int, html string)
- func (ctx *Context) HTMLBlob(code int, b []byte)
- func (ctx *Context) Handler() SpringWeb.Handler
- func (ctx *Context) Header(key, value string)
- func (ctx *Context) Inline(file string, name string)
- func (ctx *Context) IsTLS() bool
- func (ctx *Context) IsWebSocket() bool
- func (ctx *Context) JSON(code int, i interface{})
- func (ctx *Context) JSONBlob(code int, b []byte)
- func (ctx *Context) JSONP(code int, callback string, i interface{})
- func (ctx *Context) JSONPBlob(code int, callback string, b []byte)
- func (ctx *Context) JSONPretty(code int, i interface{}, indent string)
- func (ctx *Context) MultipartForm() (*multipart.Form, error)
- func (ctx *Context) NativeContext() interface{}
- func (ctx *Context) NoContent(code int)
- func (ctx *Context) Path() string
- func (ctx *Context) PathParam(name string) string
- func (ctx *Context) PathParamNames() []string
- func (ctx *Context) PathParamValues() []string
- func (ctx *Context) QueryParam(name string) string
- func (ctx *Context) QueryParams() url.Values
- func (ctx *Context) QueryString() string
- func (ctx *Context) Redirect(code int, url string)
- func (ctx *Context) Request() *http.Request
- func (ctx *Context) ResponseWriter() http.ResponseWriter
- func (ctx *Context) SSEvent(name string, message interface{})
- func (ctx *Context) SaveUploadedFile(file *multipart.FileHeader, dst string) error
- func (ctx *Context) Scheme() string
- func (ctx *Context) Set(key string, val interface{})
- func (ctx *Context) SetCookie(cookie *http.Cookie)
- func (ctx *Context) Status(code int)
- func (ctx *Context) Stream(code int, contentType string, r io.Reader)
- func (ctx *Context) String(code int, format string, values ...interface{})
- func (ctx *Context) XML(code int, i interface{})
- func (ctx *Context) XMLBlob(code int, b []byte)
- func (ctx *Context) XMLPretty(code int, i interface{}, indent string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandlerWrapper ¶
func HandlerWrapper(path string, fn SpringWeb.Handler, filters []SpringWeb.Filter) func(*gin.Context)
HandlerWrapper Web 处理函数包装器
Types ¶
type Container ¶
type Container struct { *SpringWeb.BaseWebContainer // contains filtered or unexported fields }
Container 适配 gin 的 Web 容器
func (*Container) SetGinEngine ¶
SetGinEngine 设置自定义 gin 引擎
type Context ¶
type Context struct { // LoggerContext 日志接口上下文 SpringLogger.LoggerContext // contains filtered or unexported fields }
Context 适配 gin 的 Web 上下文
func (*Context) Attachment ¶
Attachment sends a response as attachment.
func (*Context) ContentType ¶
ContentType returns the Content-Type header of the request.
func (*Context) FormFile ¶
func (ctx *Context) FormFile(name string) (*multipart.FileHeader, error)
FormFile returns the multipart form file for the provided name.
func (*Context) FormParams ¶
FormParams returns the form parameters as `url.Values`.
func (*Context) GetRawData ¶
GetRawData return stream data.
func (*Context) Handler ¶
func (ctx *Context) Handler() SpringWeb.Handler
Handler returns the matched handler by router.
func (*Context) IsWebSocket ¶
IsWebSocket returns true if HTTP connection is WebSocket otherwise false.
func (*Context) JSONPretty ¶
JSONPretty sends a pretty-print JSON with status code.
func (*Context) MultipartForm ¶
MultipartForm returns the multipart form.
func (*Context) NativeContext ¶
func (ctx *Context) NativeContext() interface{}
NativeContext 返回封装的底层上下文对象
func (*Context) PathParamNames ¶
PathParamNames returns path parameter names.
func (*Context) PathParamValues ¶
PathParamValues returns path parameter values.
func (*Context) QueryParam ¶
QueryParam returns the query param for the provided name.
func (*Context) QueryParams ¶
QueryParams returns the query parameters as `url.Values`.
func (*Context) QueryString ¶
QueryString returns the URL query string.
func (*Context) ResponseWriter ¶
func (ctx *Context) ResponseWriter() http.ResponseWriter
ResponseWriter returns `http.ResponseWriter`.
func (*Context) SaveUploadedFile ¶
func (ctx *Context) SaveUploadedFile(file *multipart.FileHeader, dst string) error
SaveUploadedFile uploads the form file to specific dst.