Introduction to the Easy Project
The Easy Project is an innovative collection of tools and plugins designed to simplify and enhance the development experience with Golang. It aims to streamline the workflow by integrating a variety of components and plugins, each catering to different aspects of a typical software project. This comprehensive toolkit provides essential functionalities necessary for building robust, scalable, and efficient applications.
Core Features
The Easy Project consists of several core components that can be categorized based on their functionalities:
gRPC Server
- Log Plugin: Enables efficient logging capabilities to track server activities.
- Metric Plugin: Provides tools for collecting and visualizing performance metrics.
- Recovery Plugin: Ensures the system can recover gracefully from unexpected failures.
- Timeout Plugin: Manages request timeouts to optimize server performance.
- Trace Plugin: Facilitates request tracing to monitor and diagnose complex systems.
gRPC Client
- Log Plugin: Similar to the server counterpart, it offers comprehensive logging support.
- Metric Plugin: Allows for the collection of client-side metrics.
- Timeout Plugin: Controls client request timeouts for better reliability.
- Trace Plugin: Helps in tracking and troubleshooting client requests.
HTTP Server
Built on github.com/gin-gonic/gin
, the HTTP server segment includes:
- Log Plugin, Metric Plugin, Recovery Plugin, Timeout Plugin, Trace Plugin: These function similarly to their gRPC counterparts, tailored for HTTP.
- Token Verification Plugin: Ensures secure communication by verifying tokens.
- Decryption Plugin: Adds an extra layer of data security through decryption.
- Header Passthrough Plugin: Manages HTTP headers efficiently.
HTTP Client
Designed using github.com/go-resty/resty/v2
, it includes:
- Log Plugin, Metric Plugin, Timeout Plugin, Trace Plugin: Enhance client-side HTTP requests similar to those in server settings.
Database and Cache
- Database: Utilizes
gorm.io/gorm
, integrating log, metric, timeout, and trace plugins, along with a scaffolding tool for database operations. - Redis: Supports caching through
github.com/go-redis/redis/v8
, with the standard log, metric, timeout, and trace support.
Additional Tools
- Logging Framework: The project uses
go.uber.org/zap
for logging. - Configuration Management: Handled by
github.com/spf13/viper
, providing flexible configuration solutions. - Monitoring Dashboard: Combines Prometheus and Grafana for real-time monitoring and analytics.
- Alerts: Integrates with Lark and DingTalk for alert notifications.
- Scaffolding: The scaffolding tool provided at
github.com/weblazy/easy-cli
assists in project setup. - Command-Line Interface (CLI): Uses
github.com/urfave/cli/v2
for creating command-line applications. - Scheduler:
github.com/robfig/cron
is included for scheduling tasks. - Tracing: Powered by
go.opentelemetry.io/otel/trace
for distributed tracing.
Community and Support
The Easy Project is community-driven and open to contributions. Users are encouraged to give feedback and contribute to the enhancement of the toolset. For technical support or collaboration inquiries, the developers can be reached via QQ (2276282419) or email ([email protected]). There's also a dedicated group for technical discussions on QQ with the number 33280853.
Testing and Reliability
Robust testing is emphasized with a straightforward unit testing command provided, ensuring high coverage and reliability of the codebase. To execute these tests and generate coverage reports, users can run:
go test -coverpkg=./... -coverprofile=coverage.data -timeout=5s ./...
go tool cover -html=coverage.data -o coverage.html
These capabilities make the Easy Project an invaluable resource for Golang developers aiming for efficiency and reliability in their projects.