MCPcopy Create free account
hub / github.com/go-dev-frame/sponge / NewHTTPServer_pbExample

Function NewHTTPServer_pbExample

internal/server/http.go:118–144  ·  view source on GitHub ↗

delete the templates code start NewHTTPServer_pbExample creates a new web server

(addr string, opts ...HTTPOption)

Source from the content-addressed store, hash-verified

116
117// NewHTTPServer_pbExample creates a new web server
118func NewHTTPServer_pbExample(addr string, opts ...HTTPOption) app.IServer { //nolint
119 o := defaultHTTPOptions()
120 o.apply(opts...)
121
122 if o.isProd {
123 gin.SetMode(gin.ReleaseMode)
124 } else {
125 gin.SetMode(gin.DebugMode)
126 }
127
128 router := routers.NewRouter_pbExample()
129 server := &http.Server{
130 Addr: addr,
131 Handler: router,
132 //ReadTimeout: time.Second*30,
133 //WriteTimeout: time.Second*60,
134 IdleTimeout: time.Second * 60,
135 MaxHeaderBytes: 1 << 20,
136 }
137
138 return &httpServer{
139 addr: addr,
140 server: newServer(server, o.tls),
141 iRegistry: o.iRegistry,
142 instance: o.instance,
143 }
144}
145
146// delete the templates code end

Callers 3

CreateServicesFunction · 0.92
CreateServicesFunction · 0.92
TestHTTPServerFunction · 0.85

Calls 4

NewRouter_pbExampleFunction · 0.92
defaultHTTPOptionsFunction · 0.85
newServerFunction · 0.85
applyMethod · 0.65

Tested by 1

TestHTTPServerFunction · 0.68