config

package
v0.0.0-...-a1d1f9a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port               string        // SERVER_PORT (default "8080")
	LimitPerSec        int           // LIMIT_PER_SEC (default 20000)
	ReadTimeout        time.Duration // READ_TIMEOUT (default 30s)
	WriteTimeout       time.Duration // WRITE_TIMEOUT (default 30s)
	IdleTimeout        time.Duration // IDLE_TIMEOUT (default 120s)
	ShutdownTimeout    time.Duration // SHUTDOWN_TIMEOUT (default 30s)
	MaxConnsPerIP      int           // MAX_CONNS_PER_IP (default 10000)
	MaxRequestsPerConn int           // MAX_REQS_PER_CONN (default 1000)
}

Config holds runtime configuration. Every field maps to an env var.

func LoadConfig

func LoadConfig() *Config

LoadConfig reads env vars and returns a Config with production-ready defaults.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL