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

Method initConfig

server.go:87–100  ·  view source on GitHub ↗

initConfig init config from app config

(config *config.Config)

Source from the content-addressed store, hash-verified

85
86// initConfig init config from app config
87func (server *HttpServer) initConfig(config *config.Config) {
88 if config.Server.WriteTimeout > 0 {
89 server.stdServer.WriteTimeout = time.Duration(config.Server.WriteTimeout) * time.Millisecond
90 }
91 if config.Server.ReadTimeout > 0 {
92 server.stdServer.ReadTimeout = time.Duration(config.Server.ReadTimeout) * time.Millisecond
93 }
94 if config.Server.ReadHeaderTimeout > 0 {
95 server.stdServer.ReadHeaderTimeout = time.Duration(config.Server.ReadHeaderTimeout) * time.Millisecond
96 }
97 if config.Server.IdleTimeout > 0 {
98 server.stdServer.IdleTimeout = time.Duration(config.Server.IdleTimeout) * time.Millisecond
99 }
100}
101
102// ServerConfig a shortcut for App.Config.ServerConfig
103func (server *HttpServer) ServerConfig() *config.ServerNode {

Callers 1

initAppConfigMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected