Documentation
¶
Overview ¶
Package config provides configuration management for the Zero HTTP server. It supports loading configuration from environment variables with sensible defaults. Options (WithConfig/WithPort/etc) override everything.
Index ¶
- type Config
- func (c *Config) GetAddr() string
- func (c *Config) SetHost(host string)
- func (c *Config) SetIdleTimeout(timeout time.Duration)
- func (c *Config) SetMaxJSONBodySize(size int64)
- func (c *Config) SetMaxUploadedFileSize(size int64)
- func (c *Config) SetPort(port int)
- func (c *Config) SetReadTimeout(timeout time.Duration)
- func (c *Config) SetWriteTimeout(timeout time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Host string
Port int
ReadTimeout time.Duration
WriteTimeout time.Duration
IdleTimeout time.Duration
MaxJSONBodySize int64
MaxUploadedFileSize int64
}
Config holds the server configuration
func Load ¶
func Load() *Config
Load loads configuration from environment variables with sensible defaults. Unparseable env values are logged at WARN level and the default is used.
func (*Config) SetIdleTimeout ¶
SetIdleTimeout sets the idle timeout
func (*Config) SetMaxJSONBodySize ¶
SetMaxJSONBodySize sets the maximum JSON body size in bytes
func (*Config) SetMaxUploadedFileSize ¶
SetMaxUploadedFileSize sets the maximum uploaded file size in bytes
func (*Config) SetReadTimeout ¶
SetReadTimeout sets the read timeout
func (*Config) SetWriteTimeout ¶
SetWriteTimeout sets the write timeout