-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathespresso.go
51 lines (39 loc) · 1.03 KB
/
espresso.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
42
43
44
45
46
47
48
49
50
51
package espresso
import (
"context"
internal "espresso/internal"
_ "espresso/modules" // 注册全部模块到mvc
"github.com/dan-and-dna/minilog"
"github.com/prometheus/client_golang/prometheus"
)
type App = internal.App
type Option = internal.Option
type Plugin = internal.Plugin
type Handler = internal.Handler
func New(applyOptions ...Option) *App {
return internal.New(applyOptions...)
}
func Logger(logger *minilog.MiniLog) Option {
return internal.Logger(logger)
}
func Metric(registry *prometheus.Registry) Option {
return internal.Metric(registry)
}
func Http(address string) Option {
return internal.Http(address)
}
func Grpc(address string) Option {
return internal.Grpc(address)
}
func RuntimeStat(address string) Option {
return internal.RuntimeStat(address)
}
func PProf(enable bool) Option {
return internal.PProf(enable)
}
func ModuleContext(f func(ctx context.Context) context.Context) Option {
return internal.ModuleContext(f)
}
func ModulePlugin(plugin Plugin) Option {
return internal.ModulePlugin(plugin)
}