go-core

module
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2025 License: BSD-3-Clause

README

go-core

GoDoc License

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.

Key Features

Error Handling
  • Custom error types with stack traces and context
  • Utility functions for error propagation and recovery
Caching
  • In-memory, Redis, and distributed caching
  • TTL, LRU eviction, serialization, and advanced cache configuration
Configuration Management
  • Structured config loading from files, flags, and environment
  • Dynamic watching, validation, and default value registration
Logging
  • 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
Database
  • Abstraction over GORM with automatic connection handling
  • Schema migrations, transaction management, and multi-database support
Flags & Interruption
  • Simple API for command-line flag parsing
  • Graceful shutdown and panic recovery utilities
Memory & Machine Utilities
  • Estimate memory footprint of Go values
  • Unique machine ID generation and hardware info (CPU, features)
Mail
  • Comprehensive email sending and SMTP server functionality
  • Security features: HELO validation, IP filtering, rate limiting
  • Delivery tracking, retry logic, and template management
Queue & Task Processing
  • Background job processing system
  • In-memory, Redis, and RabbitMQ support
  • Scheduling, middleware, job context, and distributed execution
Security
  • Cryptographic utilities: PGP, AES encryption/decryption
  • Secure operations for sensitive data and communication
Service Management
  • Service lifecycle management and deployment
  • Integration with kardianos/service, shutdown handling, and cross-platform support
Web & RPC
  • 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
Versioning
  • Build/version info embedding and management
  • Precise control over application metadata

Installation

go get github.com/valentin-kaiser/go-core

Package Overview

  • apperror: Advanced error handling
  • cache: Multi-backend caching (memory, Redis)
  • config: Structured configuration management
  • database: Database abstraction and migrations
  • flag: Command-line flag parsing
  • interruption: Panic recovery and graceful shutdown
  • logging: Flexible logging adapters and registry
  • machine: Machine identification and hardware info
  • mail: Email sending, SMTP server, and security
  • memsize: Memory size estimation
  • queue: Job/task queues and distributed processing
  • security: Cryptography and secure operations
  • service: Service lifecycle and deployment
  • version: Build/version info management
  • web: HTTP server and middleware
  • web/jrpc: JSON-RPC over HTTP/WebSocket
  • zlog: Zero-allocation logger

Documentation

See GoDoc for full API documentation and usage details.

Contributing

Contributions, issues, and feature requests are welcome! Please see CONTRIBUTING.md for guidelines.

License

This project is licensed under the BSD 3-Clause License. See LICENSE for details.

Directories

Path Synopsis
Package apperror provides a custom error type that enhances standard Go errors with stack traces and support for additional nested errors.
Package apperror provides a custom error type that enhances standard Go errors with stack traces and support for additional nested errors.
Package cache provides a comprehensive caching solution with multiple backends and advanced features like TTL, LRU eviction, serialization, and distributed caching.
Package cache provides a comprehensive caching solution with multiple backends and advanced features like TTL, LRU eviction, serialization, and distributed caching.
Package config provides a simple, structured, and extensible way to manage application configuration in Go.
Package config provides a simple, structured, and extensible way to manage application configuration in Go.
Package database provides a robust and flexible abstraction over GORM, supporting both SQLite and MySQL/MariaDB as backend databases.
Package database provides a robust and flexible abstraction over GORM, supporting both SQLite and MySQL/MariaDB as backend databases.
Package flag provides a simple API for defining and parsing command-line flags in Go applications.
Package flag provides a simple API for defining and parsing command-line flags in Go applications.
Package interruption provides a simple mechanism for recovering from panics in both the main application and concurrently running goroutines.
Package interruption provides a simple mechanism for recovering from panics in both the main application and concurrently running goroutines.
Package logging provides a flexible and extensible logging framework with support for multiple adapters and log levels.
Package logging provides a flexible and extensible logging framework with support for multiple adapters and log levels.
log
Package log provides a convenient global logger interface that wraps the core logging functionality.
Package log provides a convenient global logger interface that wraps the core logging functionality.
Package machine provides utilities to generate unique machine IDs for licensing and identification purposes.
Package machine provides utilities to generate unique machine IDs for licensing and identification purposes.
Package mail provides comprehensive email sending and SMTP server functionality with support for templates, queuing, and notification handling.
Package mail provides comprehensive email sending and SMTP server functionality with support for templates, queuing, and notification handling.
internal/email
Package email allows to send email messages.
Package email allows to send email messages.
Package memsize provides utilities to estimate the memory footprint of Go values without relying on the reflect or unsafe packages for direct memory inspection.
Package memsize provides utilities to estimate the memory footprint of Go values without relying on the reflect or unsafe packages for direct memory inspection.
Package ptr provides helper functions to get pointers to basic types.
Package ptr provides helper functions to get pointers to basic types.
Package queue provides a comprehensive task queue and background job processing system with advanced scheduling capabilities.
Package queue provides a comprehensive task queue and background job processing system with advanced scheduling capabilities.
Package security provides cryptographic utilities and PGP and AES encryption/decryption functionality.
Package security provides cryptographic utilities and PGP and AES encryption/decryption functionality.
Package service provides a simple and robust way to create, manage, and deploy system services (daemons) in Go applications across different platforms.
Package service provides a simple and robust way to create, manage, and deploy system services (daemons) in Go applications across different platforms.
Package version provides utilities to manage, retrieve, and validate version information of a Go application at runtime, supporting multiple version formats including Semantic Versioning (SemVer) and Calendar Versioning (CalVer).
Package version provides utilities to manage, retrieve, and validate version information of a Go application at runtime, supporting multiple version formats including Semantic Versioning (SemVer) and Calendar Versioning (CalVer).
web
Package web provides a configurable HTTP web server with built-in support for common middleware patterns, file serving, and WebSocket handling.
Package web provides a configurable HTTP web server with built-in support for common middleware patterns, file serving, and WebSocket handling.
jrpc
Package jrpc provides a JSON-RPC over HTTP and WebSocket implementation with Protocol Buffer support.
Package jrpc provides a JSON-RPC over HTTP and WebSocket implementation with Protocol Buffer support.
Package zlog provides a simple and flexible logging utility built around the zerolog library.
Package zlog provides a simple and flexible logging utility built around the zerolog library.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL