WithKeepAliveEndpoint enables a keep-alive endpoint with the provided timeout and callback.
(timeout time.Duration, onTimeout func())
| 129 | |
| 130 | // WithKeepAliveEndpoint enables a keep-alive endpoint with the provided timeout and callback. |
| 131 | func WithKeepAliveEndpoint(timeout time.Duration, onTimeout func()) ServerOption { |
| 132 | return func(cfg *serverOptionConfig) { |
| 133 | if timeout <= 0 || onTimeout == nil { |
| 134 | return |
| 135 | } |
| 136 | cfg.keepAliveEnabled = true |
| 137 | cfg.keepAliveTimeout = timeout |
| 138 | cfg.keepAliveOnTimeout = onTimeout |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | // WithRequestLoggerFactory customises request logger creation. |
| 143 | func WithRequestLoggerFactory(factory func(*config.Config, string) logging.RequestLogger) ServerOption { |
no outgoing calls
no test coverage detected