mirror of
https://github.com/labstack/echo.git
synced 2025-07-09 01:15:54 +02:00
59
engine/engine.go
Normal file
59
engine/engine.go
Normal file
@ -0,0 +1,59 @@
|
||||
package engine
|
||||
|
||||
import "io"
|
||||
|
||||
type (
|
||||
Type uint8
|
||||
|
||||
HandlerFunc func(Request, Response)
|
||||
|
||||
Engine interface {
|
||||
Start()
|
||||
}
|
||||
|
||||
Request interface {
|
||||
Header() Header
|
||||
// Proto() string
|
||||
// ProtoMajor() int
|
||||
// ProtoMinor() int
|
||||
RemoteAddress() string
|
||||
Method() string
|
||||
URI() string
|
||||
URL() URL
|
||||
Body() io.ReadCloser
|
||||
FormValue(string) string
|
||||
}
|
||||
|
||||
Response interface {
|
||||
Header() Header
|
||||
WriteHeader(int)
|
||||
Write(b []byte) (int, error)
|
||||
Status() int
|
||||
Size() int64
|
||||
Committed() bool
|
||||
}
|
||||
|
||||
Header interface {
|
||||
Add(string, string)
|
||||
Del(string)
|
||||
Get(string) string
|
||||
Set(string, string)
|
||||
}
|
||||
|
||||
URL interface {
|
||||
Scheme() string
|
||||
SetPath(string)
|
||||
Path() string
|
||||
Host() string
|
||||
QueryValue(string) string
|
||||
}
|
||||
|
||||
Config struct {
|
||||
Address string
|
||||
}
|
||||
)
|
||||
|
||||
const (
|
||||
Standard Type = iota
|
||||
FastHTTP
|
||||
)
|
Reference in New Issue
Block a user