SpringEcho

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2019 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandlerWrapper

func HandlerWrapper(fn SpringWeb.Handler, filters ...SpringWeb.Filter) echo.HandlerFunc

Web 处理函数包装器

Types

type Container

type Container struct {
	EchoServer *echo.Echo
}

适配 echo 的 Web 容器

func NewContainer

func NewContainer() *Container

工厂函数

func (*Container) DELETE

func (c *Container) DELETE(path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter)

func (*Container) GET

func (c *Container) GET(path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter)

func (*Container) HEAD

func (c *Container) HEAD(path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter)

func (*Container) OPTIONS

func (c *Container) OPTIONS(path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter)

func (*Container) PATCH

func (c *Container) PATCH(path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter)

func (*Container) POST

func (c *Container) POST(path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter)

func (*Container) PUT

func (c *Container) PUT(path string, fn SpringWeb.Handler, filters ...SpringWeb.Filter)

func (*Container) Start

func (c *Container) Start(address string) error

func (*Container) StartTLS

func (c *Container) StartTLS(address string, certFile, keyFile string) error

func (*Container) Stop

func (c *Container) Stop()

type Context

type Context struct {
	*SpringTrace.DefaultTraceContext

	// echo 上下文对象
	EchoContext echo.Context

	// Web 处理函数
	HandlerFunc SpringWeb.Handler
}

适配 echo 的 Web 上下文

func (*Context) Attachment

func (ctx *Context) Attachment(file string, name string)

func (*Context) Bind

func (ctx *Context) Bind(i interface{}) error

func (*Context) Blob

func (ctx *Context) Blob(code int, contentType string, b []byte)

func (*Context) ClientIP

func (ctx *Context) ClientIP() string

func (*Context) ContentType

func (ctx *Context) ContentType() string

func (*Context) Cookie

func (ctx *Context) Cookie(name string) (*http.Cookie, error)

func (*Context) Cookies

func (ctx *Context) Cookies() []*http.Cookie

func (*Context) Error

func (ctx *Context) Error(err error)

func (*Context) File

func (ctx *Context) File(file string)

func (*Context) FormFile

func (ctx *Context) FormFile(name string) (*multipart.FileHeader, error)

func (*Context) FormParams

func (ctx *Context) FormParams() (url.Values, error)

func (*Context) FormValue

func (ctx *Context) FormValue(name string) string

func (*Context) Get

func (ctx *Context) Get(key string) interface{}

func (*Context) GetHeader

func (ctx *Context) GetHeader(key string) string

func (*Context) GetRawData

func (ctx *Context) GetRawData() ([]byte, error)

func (*Context) HTML

func (ctx *Context) HTML(code int, html string)

func (*Context) HTMLBlob

func (ctx *Context) HTMLBlob(code int, b []byte)

func (*Context) Handler

func (ctx *Context) Handler() SpringWeb.Handler

func (*Context) Header

func (ctx *Context) Header(key, value string)

func (*Context) Inline

func (ctx *Context) Inline(file string, name string)

func (*Context) IsTLS

func (ctx *Context) IsTLS() bool

func (*Context) IsWebSocket

func (ctx *Context) IsWebSocket() bool

func (*Context) JSON

func (ctx *Context) JSON(code int, i interface{})

func (*Context) JSONBlob

func (ctx *Context) JSONBlob(code int, b []byte)

func (*Context) JSONP

func (ctx *Context) JSONP(code int, callback string, i interface{})

func (*Context) JSONPBlob

func (ctx *Context) JSONPBlob(code int, callback string, b []byte)

func (*Context) JSONPretty

func (ctx *Context) JSONPretty(code int, i interface{}, indent string)

func (*Context) MultipartForm

func (ctx *Context) MultipartForm() (*multipart.Form, error)

func (*Context) NativeContext

func (ctx *Context) NativeContext() interface{}

func (*Context) NoContent

func (ctx *Context) NoContent(code int)

func (*Context) Path

func (ctx *Context) Path() string

func (*Context) PathParam

func (ctx *Context) PathParam(name string) string

func (*Context) PathParamNames

func (ctx *Context) PathParamNames() []string

func (*Context) PathParamValues

func (ctx *Context) PathParamValues() []string

func (*Context) QueryParam

func (ctx *Context) QueryParam(name string) string

func (*Context) QueryParams

func (ctx *Context) QueryParams() url.Values

func (*Context) QueryString

func (ctx *Context) QueryString() string

func (*Context) Redirect

func (ctx *Context) Redirect(code int, url string)

func (*Context) Request

func (ctx *Context) Request() *http.Request

func (*Context) SSEvent

func (ctx *Context) SSEvent(name string, message interface{})

func (*Context) SaveUploadedFile

func (ctx *Context) SaveUploadedFile(file *multipart.FileHeader, dst string) error

func (*Context) Scheme

func (ctx *Context) Scheme() string

func (*Context) Set

func (ctx *Context) Set(key string, val interface{})

func (*Context) SetCookie

func (ctx *Context) SetCookie(cookie *http.Cookie)

func (*Context) Status

func (ctx *Context) Status(code int)

func (*Context) Stream

func (ctx *Context) Stream(code int, contentType string, r io.Reader)

func (*Context) String

func (ctx *Context) String(code int, format string, values ...interface{})

func (*Context) XML

func (ctx *Context) XML(code int, i interface{})

func (*Context) XMLBlob

func (ctx *Context) XMLBlob(code int, b []byte)

func (*Context) XMLPretty

func (ctx *Context) XMLPretty(code int, i interface{}, indent string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL