Reduced number of exported identifiers

This commit is contained in:
Eduard Urbach 2024-03-22 15:18:54 +01:00
parent 5fdb9a883d
commit 48f10f3ee7
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 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.

View File

@ -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,