20 lines
516 B
Go
20 lines
516 B
Go
package server
|
|
|
|
import "time"
|
|
|
|
// Config holds configuration for the TCP server
|
|
type Config struct {
|
|
Address string
|
|
Timeouts TimeoutConfig
|
|
}
|
|
|
|
// TimeoutConfig holds timeout configuration
|
|
type TimeoutConfig struct {
|
|
// Read timeout protects against slowloris attacks (clients sending data slowly)
|
|
Read time.Duration
|
|
// Write timeout protects against slow readers (clients reading responses slowly)
|
|
Write time.Duration
|
|
// Connection timeout is the maximum total connection lifetime
|
|
Connection time.Duration
|
|
}
|