🛠️ Go Universal Toolkit - A feature-rich, high-performance Go toolkit collection that provides simple, efficient, and practical tool modules to help developers quickly build high-quality projects.
- 🚀 High Performance: Performance-optimized implementations
- 🧩 Modular Design: Independent modules, use as needed
- 🔧 Easy to Use: Simple API design, quick to get started
- 🛡️ Type Safe: Full utilization of Go's type system
- 📦 Zero Dependencies: Most modules have no external dependencies
- 🔄 Actively Maintained: Active development and maintenance
# Latest version (recommended)
go get github.com/Rehtt/Kit@latest
# Compatible with older Go versions
go get github.com/Rehtt/[email protected]
Requirements: Go 1.21+ (recommended) or Go 1.17+
package main
import (
"fmt"
"github.com/Rehtt/Kit/web"
"net/http"
)
func main() {
// Create web instance
app := web.New()
// Route definition
app.Get("/hello/:name", func(ctx *web.Context) {
name := ctx.GetUrlPathParam("name")
ctx.JSON(200, map[string]string{
"message": fmt.Sprintf("Hello, %s!", name),
"status": "success",
})
})
// Middleware support
app.Use(func(ctx *web.Context) {
ctx.Writer.Header().Set("X-Powered-By", "Kit")
ctx.Next()
})
// Start server
fmt.Println("Server starting on :8080")
http.ListenAndServe(":8080", app)
}
package main
import "github.com/Rehtt/Kit/log"
func main() {
// Basic logging
log.Info("Application started")
log.Error("Error occurred", "error", err)
// Structured logging
log.With("user_id", 123).Info("User logged in")
}
package main
import (
"github.com/Rehtt/Kit/cache"
"time"
)
func main() {
// Create cache instance
c := cache.New()
// Set cache
c.Set("key", "value", 5*time.Minute)
// Get cache
if value, ok := c.Get("key"); ok {
fmt.Println("Cache value:", value)
}
}
Kit
contains multiple independent modules that you can use as needed:
Module | Description | Features |
---|---|---|
web | Lightweight web framework | Routing, middleware, JSON support |
log | High-performance logging library | Structured logging, multiple levels, high performance |
cache | Universal cache interface | In-memory cache, TTL support |
db | Database tools | Condition building, query construction |
http | HTTP client | Request wrapper, retry mechanism |
Module | Description | Features |
---|---|---|
file | File operation tools | File I/O, path handling |
strings | String utilities | High-performance conversion, string processing |
random | Random number generation | Random strings, number generation |
util | General utilities | Snowflake ID, time tools |
struct | Struct tools | Comparison, tag reading, conversion |
Module | Description | Features |
---|---|---|
maps | Thread-safe Map | Concurrent safe, high performance |
queue | Queue implementation | Multiple queue types |
slice | Slice utilities | Slice operations, functional programming |
heap | Heap data structure | Priority queue, heap sort |
expiredMap | Expiring Map | Auto expiration, memory management |
Module | Description | Features |
---|---|---|
net | Network tools | Network detection, IP processing |
host | Host information | System info retrieval |
browser | Browser tools | Browser launch, control |
wireguard | WireGuard tools | VPN configuration, management |
Module | Description | Features |
---|---|---|
i18n | Internationalization support | Multi-language, localization |
yaml | YAML processing | Configuration file parsing |
cli | Command line tools | CLI application building |
generate | Code generation | Template generation, code generation |
vt | Virtual terminal | Terminal control, color output |
multiplex | Multiplexing | Connection multiplexing, load balancing |
Each module has detailed documentation and examples. Visit the corresponding module directory:
- Go 1.21+ (recommended)
- Git
# Clone the project
git clone https://github.com/Rehtt/Kit.git
cd Kit
# Run tests
go test ./...
# Build project
go build ./...
- Follow Go official code standards
- Use
gofmt
to format code - Write unit tests
- Add necessary documentation comments
We welcome and appreciate all forms of contributions!
- 🍴 Fork this project
- 🔧 Create a feature branch (
git checkout -b feature/amazing-feature
) - 💾 Commit your changes (
git commit -m 'Add some amazing feature'
) - 📤 Push to the branch (
git push origin feature/amazing-feature
) - 🔄 Create a Pull Request
- Submit Issues to report bugs or suggest new features
- Create Pull Requests to contribute code
- Improve documentation and examples
- Share usage experiences and best practices
- ✅ Actively Maintained: Regular updates and maintenance
- 🔄 Continuous Integration: Automated testing and building
- 📈 Continuous Improvement: Ongoing optimization based on community feedback
- 🛡️ Stable & Reliable: Proven in production environments
Thanks to all developers who have contributed to the Kit
project!
This project is open source under the MIT License.
If this project helps you, please give us a ⭐️ Star!
Made with ❤️ by Rehtt