1
0
mirror of https://github.com/labstack/echo.git synced 2024-11-24 08:22:21 +02:00
echo/engine/engine.go
Vishal Rana e1d789ecbb Logger as not an interface
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-03-06 09:52:32 -08:00

71 lines
1.1 KiB
Go

package engine
import (
"io"
"time"
"github.com/labstack/gommon/log"
)
type (
HandlerFunc func(Request, Response)
Engine interface {
SetHandler(HandlerFunc)
SetLogger(*log.Logger)
Start()
}
Request interface {
TLS() bool
Scheme() string
Host() string
URI() string
URL() URL
Header() Header
// Proto() string
// ProtoMajor() int
// ProtoMinor() int
RemoteAddress() string
Method() string
Body() io.ReadCloser
FormValue(string) string
Object() interface{}
}
Response interface {
Header() Header
WriteHeader(int)
Write(b []byte) (int, error)
Status() int
Size() int64
Committed() bool
SetWriter(io.Writer)
Writer() io.Writer
Object() interface{}
}
Header interface {
Add(string, string)
Del(string)
Get(string) string
Set(string, string)
Object() interface{}
}
URL interface {
SetPath(string)
Path() string
QueryValue(string) string
Object() interface{}
}
Config struct {
Address string
TLSCertfile string
TLSKeyfile string
ReadTimeout time.Duration
WriteTimeout time.Duration
}
)