Skip to content

Repository files navigation

Ginny

Schema-driven Go RPC framework built on ConnectRPC.
基于 ConnectRPC 的 Schema 驱动 Go RPC 框架。

Protocols: gRPC + Connect + gRPC-Web | 协议支持:gRPC + Connect + gRPC-Web 三协议


Features | 功能特性

FeatureDescription
ConnectRPCgRPC + Connect + gRPC-Web, browser-native, no proxy
Vanguard RESTLegacy REST client compatibility, no code changes
Dual PortsApp(:8080) for RPC, Admin(:8081) for health/metrics/pprof
Lifecycle HooksOrdered start/stop with priority
slog LoggingPluggable handler, inject Zap or custom backend
Connect ErrorsError details with business codes (errs.New(code, bizCode, msg))
OpenTelemetryBuilt-in tracing interceptor
Three-layer InterceptorsHTTP middleware → Connect → Per-service
gRPC Health + ReflectionStandard protocols, grpcurl/grpcui ready
koanf ConfigMulti-source: files + env vars + remote
Explicit DINo Wire. Config → Logger → Server → App
ginnytestOne-line test server with full interceptor chain
Go 1.24Native http.Protocols h2c, enhanced ServeMux

Installation | 安装

Requires Go 1.24+. | 需要 Go 1.24+。

go get github.com/goriller/ginny/v2

Code generation:

go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest

Optional: Buf CLI replaces protoc. Templates in buf/.

Quick Start | 快速开始

package main
import (
"context""github.com/goriller/ginny/v2""github.com/goriller/ginny/v2/config""github.com/goriller/ginny/v2/server"
)
funcmain() {
cfg:=config.MustLoad()
srv:=server.New()
app, _:=ginny.New(
ginny.WithConfig(cfg),
ginny.WithServer(srv),
)
app.Start(context.Background())
}
go run main.go
curl http://localhost:8081/healthz # → {"status":"ok"}

Documentation | 文档

License

MIT

About

Schema-driven Go RPC framework built on ConnectRPC.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages