A collection of specialized Go modules for building modern web applications with focus on performance, developer experience, and production readiness.
These modules were extracted from the main Vairogs project to provide reusable, well-tested components that can be used independently or together in any Go application. Each module follows Go best practices with comprehensive documentation, full test coverage, and semantic versioning.
Generic environment variable configuration loader and validator for Go. Supports merging multiple sources, struct mapping, and tag-based validation.
package main
import (
"fmt"
"reflect"
"github.com/vairogs-go/envconfig"
)
type AppConfig struct {
Environment string `required:"true"`
Debug bool
}
func main() {
config := &AppConfig{}
envMaps := []map[string]string{
envconfig.GetEnvs(),
}
merged := envconfig.MergeEnvMaps(envMaps...)
err := envconfig.FillStructFromEnv("", reflect.ValueOf(config).Elem(), merged)
if err != nil {
panic(fmt.Sprintf("Failed to load config: %v", err))
}
validator := envconfig.NewValidator()
err = validator.ValidateStruct(config)
if err != nil {
panic(fmt.Sprintf("Invalid config: %v", err))
}
fmt.Printf("Environment: %s\n", config.Environment)
}
Go API wrapper for the QuickTemplate compiler (qtc). Simplifies template compilation and integration.
package main
import "github.com/vairogs-go/qtcwrap"
func main() {
// Compile all .qtpl files in the templates directory
qtcwrap.CompileDirectory("templates")
}
JavaScript and CSS minification with content-based hashing for cache-busting. Supports bundles and single files.
package main
import (
"log"
"github.com/vairogs-go/minify"
)
func main() {
config := minify.Config{
BundlesFile: "bundles.json",
OutputDir: "./assets/static",
}
if err := minify.ProcessBundles(config); err != nil {
log.Fatal(err)
}
}
- Zero Dependencies: Minimal external dependencies, only essential libraries
- Production Ready: Comprehensive error handling and edge case coverage
- Developer Friendly: Extensive documentation with practical examples
- Performance Focused: Optimized for production workloads
- Test Coverage: 100% test coverage with benchmarks and edge cases
All modules follow consistent patterns:
- Comprehensive documentation with examples
- Full test coverage including error scenarios
- Semantic versioning with detailed changelogs
- BSD 3-Clause licensing
- Go 1.24+ compatibility
- Main Organization: github.com/vairogs
- Documentation: Available in each module's README
- Issues: Report issues in individual module repositories