- Centralize environment variable loading in config.MustLoad - Parse and validate all env vars once at initialization - Make config fields private and read-only - Remove public Getenv usage in favor of typed accessors - Improve validation and initialization order - Normalize enum naming to be idiomatic and avoid constant collisions
31 lines
536 B
Go
31 lines
536 B
Go
package header
|
|
|
|
type ResponseHeader interface {
|
|
Value(key string) string
|
|
Set(key string, value string)
|
|
Remove(key string)
|
|
Finalize() []byte
|
|
}
|
|
|
|
type responseHeader struct {
|
|
startLine []byte
|
|
headers map[string]string
|
|
}
|
|
|
|
type RequestHeader interface {
|
|
Value(key string) string
|
|
Set(key string, value string)
|
|
Remove(key string)
|
|
Finalize() []byte
|
|
Method() string
|
|
Path() string
|
|
Version() string
|
|
}
|
|
type requestHeader struct {
|
|
method string
|
|
path string
|
|
version string
|
|
startLine []byte
|
|
headers map[string]string
|
|
}
|