-
-
Notifications
You must be signed in to change notification settings - Fork 69
/
types.go
41 lines (33 loc) · 913 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package atreugo
import (
"github.com/erikdubbelboer/fasthttp"
"github.com/savsgio/go-logger"
"github.com/thehowl/fasthttprouter"
)
// private
// public
// Config config for Atreugo
type Config struct {
Host string
Port int
LogLevel string
Compress bool
TLSEnable bool
CertKey string
CertFile string
GracefulEnable bool
}
// Atreugo struct for make up a server
type Atreugo struct {
server *fasthttp.Server
router *fasthttprouter.Router
middlewares []Middleware
log *logger.Logger
cfg *Config
}
// View must process incoming requests.
type View func(ctx *fasthttp.RequestCtx) error
// Middleware must process all incoming requests before defined views.
type Middleware func(ctx *fasthttp.RequestCtx) (int, error)
// JSON is a map whose key is a string and whose value an interface
type JSON map[string]interface{}