From d85c5fc1defdbc27beaa43f60a38fed7e8760542 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Fri, 22 Mar 2024 15:18:54 +0100 Subject: [PATCH] Reduced number of exported identifiers --- Server.go | 2 +- Configuration.go => config.go | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) rename Configuration.go => config.go (58%) diff --git a/Server.go b/Server.go index d0e76da..9fde8cc 100644 --- a/Server.go +++ b/Server.go @@ -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. diff --git a/Configuration.go b/config.go similarity index 58% rename from Configuration.go rename to config.go index 79e9374..6f590c4 100644 --- a/Configuration.go +++ b/config.go @@ -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,