added ezconf and updated modules with integration

This commit is contained in:
2026-01-13 21:18:35 +11:00
parent f8919e8398
commit 0ceeb37058
22 changed files with 2448 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
# HWS (H Web Server) - v0.2.2
# HWS (H Web Server) - v0.2.3
A lightweight, opinionated HTTP web server framework for Go built on top of the standard library's net/http.

35
hws/ezconf.go Normal file
View File

@@ -0,0 +1,35 @@
package hws
import "runtime"
// EZConfIntegration provides integration with ezconf for automatic configuration
type EZConfIntegration struct{}
// PackagePath returns the path to the hws package for source parsing
func (e EZConfIntegration) PackagePath() string {
_, filename, _, _ := runtime.Caller(0)
// Return directory of this file
return filename[:len(filename)-len("/ezconf.go")]
}
// ConfigFunc returns the ConfigFromEnv function for ezconf
func (e EZConfIntegration) ConfigFunc() func() (interface{}, error) {
return func() (interface{}, error) {
return ConfigFromEnv()
}
}
// Name returns the name to use when registering with ezconf
func (e EZConfIntegration) Name() string {
return "hws"
}
// GroupName returns the display name for grouping environment variables
func (e EZConfIntegration) GroupName() string {
return "HWS"
}
// NewEZConfIntegration creates a new EZConf integration helper
func NewEZConfIntegration() EZConfIntegration {
return EZConfIntegration{}
}