go-core is a comprehensive, modular collection of Go libraries designed to accelerate professional application development. It provides robust, production-grade utilities for error handling, configuration, logging, caching, database management, security, service orchestration, and more. Each package is crafted for extensibility, reliability, and seamless integration.
- Custom error types with stack traces and context
- Utility functions for error propagation and recovery
- In-memory, Redis, and distributed caching
- TTL, LRU eviction, serialization, and advanced cache configuration
- Structured config loading from files, flags, and environment
- Dynamic watching, validation, and default value registration
- Flexible logging framework with adapters for zerolog, standard log, and no-op
- Global logger registry, structured logging, and zero-allocation logger
- Log rotation and custom output targets
- Abstraction over GORM with automatic connection handling
- Schema migrations, transaction management, and multi-database support
- Simple API for command-line flag parsing
- Graceful shutdown and panic recovery utilities
- Estimate memory footprint of Go values
- Unique machine ID generation and hardware info (CPU, features)
- Comprehensive email sending and SMTP server functionality
- Security features: HELO validation, IP filtering, rate limiting
- Delivery tracking, retry logic, and template management
- Background job processing system
- In-memory, Redis, and RabbitMQ support
- Scheduling, middleware, job context, and distributed execution
- Cryptographic utilities: PGP, AES encryption/decryption
- Secure operations for sensitive data and communication
- Service lifecycle management and deployment
- Integration with kardianos/service, shutdown handling, and cross-platform support
- Configurable HTTP server with middleware support
- JSON-RPC over HTTP and WebSocket (requires Protocol Buffer definitions for server generation)
- Rate limiting, request metadata, and automatic method dispatch
- Build/version info embedding and management
- Precise control over application metadata
go get github.com/valentin-kaiser/go-core
apperror
: Advanced error handlingcache
: Multi-backend caching (memory, Redis)config
: Structured configuration managementdatabase
: Database abstraction and migrationsflag
: Command-line flag parsinginterruption
: Panic recovery and graceful shutdownlogging
: Flexible logging adapters and registrymachine
: Machine identification and hardware infomail
: Email sending, SMTP server, and securitymemsize
: Memory size estimationqueue
: Job/task queues and distributed processingsecurity
: Cryptography and secure operationsservice
: Service lifecycle and deploymentversion
: Build/version info managementweb
: HTTP server and middlewareweb/jrpc
: JSON-RPC over HTTP/WebSocketzlog
: Zero-allocation logger
See GoDoc for full API documentation and usage details.
Contributions, issues, and feature requests are welcome! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the BSD 3-Clause License. See LICENSE for details.