Documentation
¶
Overview ¶
framework/echo/adapter.go
framework/echo/context.go
framework/echo/server.go
Index ¶
- func Adapter(handler simplehttp.HandlerFunc) echo.HandlerFunc
- func MiddlewareAdapter(middleware simplehttp.MiddlewareFunc) echo.MiddlewareFunc
- func NewEchoContext(c echo.Context, cfgs ...*simplehttp.Config) simplehttp.Context
- func NewServer(config *simplehttp.Config) simplehttp.Server
- type EchoContext
- func (c *EchoContext) Bind(v interface{}) error
- func (c *EchoContext) BindForm(i interface{}) error
- func (c *EchoContext) BindJSON(i interface{}) error
- func (c *EchoContext) Context() context.Context
- func (c *EchoContext) Get(key string) interface{}
- func (c *EchoContext) GetBody() []byte
- func (c *EchoContext) GetFile(fieldName string) (*multipart.FileHeader, error)
- func (c *EchoContext) GetHeader(key string) string
- func (c *EchoContext) GetHeaders() *simplehttp.RequestHeader
- func (c *EchoContext) GetMethod() string
- func (c *EchoContext) GetPath() string
- func (c *EchoContext) GetQueryParam(key string) string
- func (c *EchoContext) GetQueryParams() map[string][]string
- func (c *EchoContext) JSON(code int, data interface{}) error
- func (c *EchoContext) Request() *http.Request
- func (c *EchoContext) Response() http.ResponseWriter
- func (c *EchoContext) SSE(handler simplehttp.SSEHandler) error
- func (c *EchoContext) SaveFile(file *multipart.FileHeader, dst string) error
- func (c *EchoContext) SendFile(filepath string, attachment bool) error
- func (c *EchoContext) Set(key string, value interface{})
- func (c *EchoContext) SetContext(ctx context.Context)
- func (c *EchoContext) SetHeader(key, value string)
- func (c *EchoContext) SetRequestHeader(key, value string)
- func (c *EchoContext) SetResponseHeader(key, value string)
- func (c *EchoContext) Stream(code int, contentType string, reader io.Reader) error
- func (c *EchoContext) String(code int, data string) error
- func (c *EchoContext) Upgrade() (simplehttp.Websocket, error)
- type EchoGroup
- func (g *EchoGroup) DELETE(path string, handler simplehttp.HandlerFunc)
- func (g *EchoGroup) GET(path string, handler simplehttp.HandlerFunc)
- func (g *EchoGroup) Group(prefix string) simplehttp.Router
- func (g *EchoGroup) HEAD(path string, handler simplehttp.HandlerFunc)
- func (g *EchoGroup) OPTIONS(path string, handler simplehttp.HandlerFunc)
- func (g *EchoGroup) PATCH(path string, handler simplehttp.HandlerFunc)
- func (g *EchoGroup) POST(path string, handler simplehttp.HandlerFunc)
- func (g *EchoGroup) PUT(path string, handler simplehttp.HandlerFunc)
- func (g *EchoGroup) Static(prefix, root string)
- func (g *EchoGroup) StaticFile(path, filepath string)
- func (g *EchoGroup) Use(middleware ...simplehttp.Middleware)
- func (g *EchoGroup) WebSocket(path string, handler func(simplehttp.Websocket) error)
- type EchoServer
- func (s *EchoServer) DELETE(path string, handler simplehttp.HandlerFunc)
- func (s *EchoServer) GET(path string, handler simplehttp.HandlerFunc)
- func (s *EchoServer) Group(prefix string) simplehttp.Router
- func (s *EchoServer) HEAD(path string, handler simplehttp.HandlerFunc)
- func (s *EchoServer) OPTIONS(path string, handler simplehttp.HandlerFunc)
- func (s *EchoServer) PATCH(path string, handler simplehttp.HandlerFunc)
- func (s *EchoServer) POST(path string, handler simplehttp.HandlerFunc)
- func (s *EchoServer) PUT(path string, handler simplehttp.HandlerFunc)
- func (s *EchoServer) Shutdown(ctx context.Context) error
- func (s *EchoServer) Start(address string) error
- func (s *EchoServer) Static(prefix, root string)
- func (s *EchoServer) StaticFile(path, filepath string)
- func (s *EchoServer) Use(middleware ...simplehttp.Middleware)
- func (s *EchoServer) WebSocket(path string, handler func(simplehttp.Websocket) error)
- type EchoWebSocket
- func (ws *EchoWebSocket) Close() error
- func (ws *EchoWebSocket) ReadJSON(v interface{}) error
- func (ws *EchoWebSocket) ReadMessage() (messageType int, p []byte, err error)
- func (ws *EchoWebSocket) WriteJSON(v interface{}) error
- func (ws *EchoWebSocket) WriteMessage(messageType int, data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Adapter ¶
func Adapter(handler simplehttp.HandlerFunc) echo.HandlerFunc
Adapter converts SimpleHttp HandlerFunc to echo.HandlerFunc
func MiddlewareAdapter ¶
func MiddlewareAdapter(middleware simplehttp.MiddlewareFunc) echo.MiddlewareFunc
MiddlewareAdapter converts SimpleHttp Middleware to echo.MiddlewareFunc
func NewEchoContext ¶
func NewEchoContext(c echo.Context, cfgs ...*simplehttp.Config) simplehttp.Context
func NewServer ¶
func NewServer(config *simplehttp.Config) simplehttp.Server
Types ¶
type EchoContext ¶
type EchoContext struct {
// contains filtered or unexported fields
}
EchoContext implements MedaContext interface using Echo's Context
func (*EchoContext) Bind ¶
func (c *EchoContext) Bind(v interface{}) error
func (*EchoContext) BindForm ¶
func (c *EchoContext) BindForm(i interface{}) error
func (*EchoContext) BindJSON ¶
func (c *EchoContext) BindJSON(i interface{}) error
func (*EchoContext) Context ¶
func (c *EchoContext) Context() context.Context
func (*EchoContext) Get ¶
func (c *EchoContext) Get(key string) interface{}
func (*EchoContext) GetBody ¶
func (c *EchoContext) GetBody() []byte
func (*EchoContext) GetFile ¶
func (c *EchoContext) GetFile(fieldName string) (*multipart.FileHeader, error)
func (*EchoContext) GetHeader ¶
func (c *EchoContext) GetHeader(key string) string
func (*EchoContext) GetHeaders ¶
func (c *EchoContext) GetHeaders() *simplehttp.RequestHeader
func (*EchoContext) GetMethod ¶
func (c *EchoContext) GetMethod() string
func (*EchoContext) GetPath ¶
func (c *EchoContext) GetPath() string
func (*EchoContext) GetQueryParam ¶
func (c *EchoContext) GetQueryParam(key string) string
func (*EchoContext) GetQueryParams ¶
func (c *EchoContext) GetQueryParams() map[string][]string
func (*EchoContext) JSON ¶
func (c *EchoContext) JSON(code int, data interface{}) error
func (*EchoContext) Request ¶
func (c *EchoContext) Request() *http.Request
func (*EchoContext) Response ¶
func (c *EchoContext) Response() http.ResponseWriter
func (*EchoContext) SSE ¶ added in v0.0.8
func (c *EchoContext) SSE(handler simplehttp.SSEHandler) error
SSE starts a Server-Sent Events stream
func (*EchoContext) SaveFile ¶
func (c *EchoContext) SaveFile(file *multipart.FileHeader, dst string) error
func (*EchoContext) SendFile ¶
func (c *EchoContext) SendFile(filepath string, attachment bool) error
func (*EchoContext) Set ¶
func (c *EchoContext) Set(key string, value interface{})
func (*EchoContext) SetContext ¶
func (c *EchoContext) SetContext(ctx context.Context)
func (*EchoContext) SetHeader ¶
func (c *EchoContext) SetHeader(key, value string)
func (*EchoContext) SetRequestHeader ¶
func (c *EchoContext) SetRequestHeader(key, value string)
func (*EchoContext) SetResponseHeader ¶
func (c *EchoContext) SetResponseHeader(key, value string)
func (*EchoContext) Upgrade ¶
func (c *EchoContext) Upgrade() (simplehttp.Websocket, error)
type EchoGroup ¶
type EchoGroup struct {
// contains filtered or unexported fields
}
EchoGroup implements MedaRouter interface for route groups
func (*EchoGroup) DELETE ¶
func (g *EchoGroup) DELETE(path string, handler simplehttp.HandlerFunc)
func (*EchoGroup) GET ¶
func (g *EchoGroup) GET(path string, handler simplehttp.HandlerFunc)
func (*EchoGroup) HEAD ¶
func (g *EchoGroup) HEAD(path string, handler simplehttp.HandlerFunc)
func (*EchoGroup) OPTIONS ¶
func (g *EchoGroup) OPTIONS(path string, handler simplehttp.HandlerFunc)
func (*EchoGroup) PATCH ¶
func (g *EchoGroup) PATCH(path string, handler simplehttp.HandlerFunc)
func (*EchoGroup) POST ¶
func (g *EchoGroup) POST(path string, handler simplehttp.HandlerFunc)
func (*EchoGroup) PUT ¶
func (g *EchoGroup) PUT(path string, handler simplehttp.HandlerFunc)
func (*EchoGroup) StaticFile ¶
func (*EchoGroup) Use ¶
func (g *EchoGroup) Use(middleware ...simplehttp.Middleware)
type EchoServer ¶
type EchoServer struct {
// contains filtered or unexported fields
}
func (*EchoServer) DELETE ¶
func (s *EchoServer) DELETE(path string, handler simplehttp.HandlerFunc)
func (*EchoServer) GET ¶
func (s *EchoServer) GET(path string, handler simplehttp.HandlerFunc)
func (*EchoServer) Group ¶
func (s *EchoServer) Group(prefix string) simplehttp.Router
func (*EchoServer) HEAD ¶
func (s *EchoServer) HEAD(path string, handler simplehttp.HandlerFunc)
func (*EchoServer) OPTIONS ¶
func (s *EchoServer) OPTIONS(path string, handler simplehttp.HandlerFunc)
func (*EchoServer) PATCH ¶
func (s *EchoServer) PATCH(path string, handler simplehttp.HandlerFunc)
func (*EchoServer) POST ¶
func (s *EchoServer) POST(path string, handler simplehttp.HandlerFunc)
func (*EchoServer) PUT ¶
func (s *EchoServer) PUT(path string, handler simplehttp.HandlerFunc)
func (*EchoServer) Shutdown ¶
func (s *EchoServer) Shutdown(ctx context.Context) error
Shutdown is a no-op in Echo v5 as it's handled internally
func (*EchoServer) Start ¶
func (s *EchoServer) Start(address string) error
func (*EchoServer) Static ¶
func (s *EchoServer) Static(prefix, root string)
func (*EchoServer) StaticFile ¶
func (s *EchoServer) StaticFile(path, filepath string)
func (*EchoServer) Use ¶
func (s *EchoServer) Use(middleware ...simplehttp.Middleware)
func (*EchoServer) WebSocket ¶
func (s *EchoServer) WebSocket(path string, handler func(simplehttp.Websocket) error)
type EchoWebSocket ¶
type EchoWebSocket struct {
// contains filtered or unexported fields
}
EchoWebSocket implements MedaWebsocket interface using gorilla
func (*EchoWebSocket) Close ¶
func (ws *EchoWebSocket) Close() error
func (*EchoWebSocket) ReadJSON ¶
func (ws *EchoWebSocket) ReadJSON(v interface{}) error
func (*EchoWebSocket) ReadMessage ¶
func (ws *EchoWebSocket) ReadMessage() (messageType int, p []byte, err error)
func (*EchoWebSocket) WriteJSON ¶
func (ws *EchoWebSocket) WriteJSON(v interface{}) error
func (*EchoWebSocket) WriteMessage ¶
func (ws *EchoWebSocket) WriteMessage(messageType int, data []byte) error
Click to show internal directories.
Click to hide internal directories.