MCPcopy Create free account
hub / github.com/devfeel/dotweb / NewHttpServer

Function NewHttpServer

server.go:55–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53)
54
55func NewHttpServer() *HttpServer {
56 server := &HttpServer{
57
58 Modules: make([]*HttpModule, 0),
59 lock_session: new(sync.RWMutex),
60 binder: newBinder(),
61 contextCreater: defaultContextCreater,
62 }
63 server.pool = &pool{
64 response: sync.Pool{
65 New: func() interface{} {
66 return &Response{}
67 },
68 },
69 request: sync.Pool{
70 New: func() interface{} {
71 return &Request{}
72 },
73 },
74 context: sync.Pool{
75 New: func() interface{} {
76 return server.contextCreater()
77 },
78 },
79 }
80 // setup router
81 server.router = NewRouter(server)
82 server.stdServer = &http.Server{Handler: server}
83 return server
84}
85
86// initConfig init config from app config
87func (server *HttpServer) initConfig(config *config.Config) {

Callers 3

TestNewHttpServerFunction · 0.85
TestSesionConfigFunction · 0.85
NewFunction · 0.85

Calls 2

newBinderFunction · 0.85
NewRouterFunction · 0.85

Tested by 2

TestNewHttpServerFunction · 0.68
TestSesionConfigFunction · 0.68