An example using Kitex
and thrift-gen-rpc-swagger
.
-
Defines
RPC
interfaces usingthrift
IDL -
Generates code using
Kitex
-
Utilizes
Gorm
andMySQL
-
Uses the
thrift-gen-rpc-swagger
plugin to generateSwagger
files and aSwagger UI
service -
/swagger
provides theSwagger
files andSwagger UI
server -
/handler.go
contains the basic logic for updating, adding, deleting, querying users and examples usingmetainfo
This example defines RPC
interfaces using thrift
IDL. The specific interface definitions can be found in user.thrift.
This example uses Kitex
for code generation. For more information on how to use Kitex
, refer to the Kitex documentation.
The Kitex
commands used can be found in the Makefile.
thrift-gen-rpc-swagger
generates Swagger
documentation and a Swagger UI
service through code generation.
For more details, refer to swagger-generate.
cd bizdemo/kitex_swagger_gen && docker-compose up
cd bizdemo/kitex_swagger_gen
go run .
cd bizdemo/kitex_swagger_gen/downstream_server
go run .