A minimalist framework for building scalable microservices and distributed systems in Go.
- 🚀 Multiple protocol support (HTTP/gRPC/TCP/UDP/WebSocket)
- 🔌 Pluggable service registry (Consul/mDNS)
- 📊 Built-in metrics and tracing (Prometheus/OpenTelemetry)
- ⚙️ Configuration management with Viper
- 🔄 Cron job scheduling
- 🐳 Runtime integration (Docker/Nomad)
go get github.com/go-sicky/sicky
package main
import (
"svc/handler"
rgConsul "github.com/go-sicky/sicky/registry/consul"
"github.com/go-sicky/sicky/runtime"
"github.com/go-sicky/sicky/server"
srvGRPC "github.com/go-sicky/sicky/server/grpc"
srvHTTP "github.com/go-sicky/sicky/server/http"
"github.com/go-sicky/sicky/service"
"github.com/go-sicky/sicky/service/sicky"
)
type Config struct {
Server struct {
GRPC *srvGRPC.Config `json:"grpc" yaml:"grpc" mapstructure:"grpc"`
HTTP *srvHTTP.Config `json:"http" yaml:"http" mapstructure:"http"`
} `json:"server" yaml:"server" mapstructure:"server"`
Registry struct {
Consul *rgConsul.Config `json:"consul" yaml:"consul" mapstructure:"consul"`
} `json:"registry" yaml:"registry" mapstructure:"registry"`
Runtime *runtime.Config `json:"runtime" yaml:"runtime" mapstructure:"runtime"`
Sicky *sicky.Config `json:"sicky" yaml:"sicky" mapstructure:"sicky"`
}
const (
AppName = "svc.sicky"
Version = "latest"
)
func main() {
// Initialize runtime
runtime.Init(AppName)
runtime.LoadConfig(&Config{})
runtime.Start(config.Runtime)
// Create servers
httpServer := srvHTTP.New(&server.Options{
Name: AppName + "@http",
}, config.Server.HTTP)
httpServer.Handle(handler.NewHTTPGeneral())
grpcServer := srvGRPC.New(&server.Options{
Name: AppName + "@grpc",
}, config.Server.GRPC)
grpcServer.Handle(handler.NewGRPCGeneral())
// Configure registry
consulRegistry := rgConsul.New(nil, config.Registry.Consul)
// Create service
service := sicky.New(&service.Options{
Name: AppName,
}, config.Sicky)
service.Servers(httpServer, grpcServer)
service.Registries(consulRegistry)
// Start service
service.Run()
}
server:
http:
addr: ":8080"
grpc:
addr: ":9090"
registry:
consul:
address: "localhost:8500"
runtime:
shutdown_timeout: 30s
- GoFiber - Web framework
- Viper - Configuration management
- OpenTelemetry - Distributed tracing
- Bun - SQL ORM
- Swag - API documentation
- gRPC-Go - RPC framework
- Prometheus - Metrics monitoring
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.