Reduced number of exported identifiers
This commit is contained in:
parent
ef6dd6885e
commit
d85c5fc1de
@ -31,7 +31,7 @@ type server struct {
|
|||||||
handlers []Handler
|
handlers []Handler
|
||||||
router router.Router[Handler]
|
router router.Router[Handler]
|
||||||
errorHandler func(Context, error)
|
errorHandler func(Context, error)
|
||||||
config Configuration
|
config config
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewServer creates a new HTTP server.
|
// NewServer creates a new HTTP server.
|
||||||
|
@ -2,13 +2,13 @@ package web
|
|||||||
|
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
// Configuration represents the server configuration.
|
// config represents the server configuration.
|
||||||
type Configuration struct {
|
type config struct {
|
||||||
Timeout TimeoutConfiguration `json:"timeout"`
|
Timeout timeoutConfig `json:"timeout"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// TimeoutConfiguration lets you configure the different timeout durations.
|
// timeoutConfig lets you configure the different timeout durations.
|
||||||
type TimeoutConfiguration struct {
|
type timeoutConfig struct {
|
||||||
Idle time.Duration `json:"idle"`
|
Idle time.Duration `json:"idle"`
|
||||||
Read time.Duration `json:"read"`
|
Read time.Duration `json:"read"`
|
||||||
ReadHeader time.Duration `json:"readHeader"`
|
ReadHeader time.Duration `json:"readHeader"`
|
||||||
@ -17,9 +17,9 @@ type TimeoutConfiguration struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reset resets all fields to the default configuration.
|
// Reset resets all fields to the default configuration.
|
||||||
func defaultConfig() Configuration {
|
func defaultConfig() config {
|
||||||
return Configuration{
|
return config{
|
||||||
Timeout: TimeoutConfiguration{
|
Timeout: timeoutConfig{
|
||||||
Idle: 3 * time.Minute,
|
Idle: 3 * time.Minute,
|
||||||
Write: 2 * time.Minute,
|
Write: 2 * time.Minute,
|
||||||
Read: 5 * time.Second,
|
Read: 5 * time.Second,
|
Loading…
Reference in New Issue
Block a user