Reduced number of exported identifiers

This commit is contained in:
Eduard Urbach 2024-03-22 15:18:54 +01:00
parent ef6dd6885e
commit d85c5fc1de
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0
2 changed files with 9 additions and 9 deletions

View File

@ -31,7 +31,7 @@ type server struct {
handlers []Handler
router router.Router[Handler]
errorHandler func(Context, error)
config Configuration
config config
}
// NewServer creates a new HTTP server.

View File

@ -2,13 +2,13 @@ package web
import "time"
// Configuration represents the server configuration.
type Configuration struct {
Timeout TimeoutConfiguration `json:"timeout"`
// config represents the server configuration.
type config struct {
Timeout timeoutConfig `json:"timeout"`
}
// TimeoutConfiguration lets you configure the different timeout durations.
type TimeoutConfiguration struct {
// timeoutConfig lets you configure the different timeout durations.
type timeoutConfig struct {
Idle time.Duration `json:"idle"`
Read time.Duration `json:"read"`
ReadHeader time.Duration `json:"readHeader"`
@ -17,9 +17,9 @@ type TimeoutConfiguration struct {
}
// Reset resets all fields to the default configuration.
func defaultConfig() Configuration {
return Configuration{
Timeout: TimeoutConfiguration{
func defaultConfig() config {
return config{
Timeout: timeoutConfig{
Idle: 3 * time.Minute,
Write: 2 * time.Minute,
Read: 5 * time.Second,