A collection of Go utilities and packages for Valksor projects.
go-toolkit provides a comprehensive set of reusable Go packages designed to accelerate development across Valksor projects. Each package is focused, well-tested, and ready for production use.
You're building a Go project and need:
- Configuration management (YAML/JSON, environment variables)
- CLI helpers (Cobra-based patterns, spinners, ASCII charts)
- Terminal display formatting with colors
- Build utilities (template compilation, asset minification)
- Event-driven communication between components
- JSON-RPC 2.0 protocol support for plugins
- Validation result tracking with severity levels
- Common utilities (caching, error handling, output processing)
- Retry logic with exponential backoff
- URL-safe slug generation
- Filename parsing and template expansion
- History tracking with auto-pruning
go get github.com/valksor/go-toolkit| Package | Description | Docs |
|---|---|---|
| cfg | Configuration loading, saving, and merging (YAML, JSON) | docs |
| env | Environment variable expansion and layered environments | docs |
| envconfig | Struct-based environment variable loading with validation | docs |
| project | Project detection and context management | docs |
| Package | Description | Docs |
|---|---|---|
| cli | Cobra CLI helpers and common patterns | docs |
| cli/disambiguate | Symfony-style command shortcuts (c:v → config validate) |
docs |
| display | Color formatting, spinners, and terminal output utilities | docs |
| log | Structured logging helpers | docs |
| Package | Description | Docs |
|---|---|---|
| qtcwrap | Wrapper for QuickTemplate (qtc) compiler | docs |
| minify | JavaScript and CSS minification with content-based hashing | docs |
| Package | Description | Docs |
|---|---|---|
| cache | Thread-safe in-memory TTL cache with automatic expiration | docs |
| chart | ASCII chart rendering (bar, line, pie) for terminal output | docs |
| errors | Error handling and wrapping utilities | docs |
| eventbus | Generic pub/sub event system with async publishing | docs |
| history | Generic JSON-persisted history tracking with auto-pruning | docs |
| jsonrpc | JSON-RPC 2.0 protocol types for plugin communication | docs |
| naming | Filename parsing, template expansion, and ticket ID extraction | docs |
| output | Output processing utilities including deduplicating writer | docs |
| paths | File path manipulation utilities | docs |
| retry | Retry operations with exponential backoff and jitter | docs |
| slug | Convert text to URL-safe slugs | docs |
| validate | Generic validation result system with severity levels | docs |
| version | Build version information helpers | docs |
Full documentation available at valksor.com/docs/go-toolkit
# Run tests
make test
# Run tests with coverage
make coverage
# Run quality checks (lint, format, security)
make quality
# Format code
make fmt
# Clean dependencies
make tidyBSD 3-Clause License