initConfig init config from app config
(config *config.Config)
| 85 | |
| 86 | // initConfig init config from app config |
| 87 | func (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 |
| 103 | func (server *HttpServer) ServerConfig() *config.ServerNode { |