MCPcopy Index your code
hub / github.com/cloudwego/kitex-examples

github.com/cloudwego/kitex-examples @v0.4.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.4.2 ↗ · + Follow
10,863 symbols 21,606 edges 443 files 958 documented · 9%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Kitex Examples

English | 中文

How to run

You can go into the related examples for information on "how to run"

Bizdemo

  • bizdemo/kitex_gorm Example of using Kitex and gorm
  • bizdemo/kitex_gorm_gen Example of using Kitex and gorm_gen
  • bizdemo/kitex_zorm Example of using Kitex and zorm
  • bizdemo/kitex_ent Example of using Kitex and ent
  • bizdemo/kitex_swagger_gen Example of using Kitex and swagger generate
  • bizdemo/easy_note Example of using Kitex as a rpc framework to implement a simple note service with multiple middlewares
  • Bookinfo Example of using Kitex as the rpc framework to implement multi-functional book service programs including Istio, OpenTelemetry, etc.
  • Open Payment Platform Example of using Kitex as the rpc framework to demonstrate the usage of Kitex generic call, and builds an integrated payment platform.
  • Book Shop Example of using Kitex as a rpc framework to implement an e-commerce system including an ElasticSearch search engine
  • FreeCar Example of using Kitex as the rpc framework to implement cloud native time-sharing car rental system suite services

Basic features

  • basic Basic example of Kitex
  • async_call Example of using asynchronous call in Kitex server
  • codec Example of Kitex server and client using custom codecs
    • codec-Dubbo Example of Dubbo protocol codec launched by Kitex to support Kitex <-> Dubbo interoperability
  • long_connection Kitex example of using long connections between server and client
  • streaming Example of Kitex server and client using streams (based on GRPC/HTTP2, using Protobuf IDL)
  • thrift streaming Example of Kitex server and client using thrift streaming (based on GRPC/HTTP2, using Thrift IDL)
  • business_exception Example of Kitex server and client using business exceptions
  • middleware Kitex Example of using middleware between server and client

Governance Features

  • Example of kitex server using configuration center to connect to governance features
    • etcd Kitex server uses etcd as an example of connecting the configuration center with governance features
    • nacos Kitex server uses nacos as an example of connecting the configuration center with governance features
    • apollo Kitex server uses apollo as an example of connecting the configuration center with governance features
  • discovery Example of Kitex server and client using service registration and discovery
    • etcd Example of Kitex server and client using etcd as service registration center
    • nacos Kitex server and client use nacos as an example of service registration center
    • polaris Kitex server and client use polaris as an example of service registration center
    • zookeeper Example of Kitex server and client using zookeeper as service registration center
    • consul Example of Kitex server and client using consul as service registration center
    • servicecomb Kitex server and client use servicecomb as an example of service registration center
    • eureka Kitex server and client use eureka as an example of service registration center
    • dns Example of Kitex server and client using dns for service discovery
    • resolver_rule_based provides a rule-based resolver for Kitex. It allows users to configure rules in service discovery to filter service instances and implement traffic segmentation.
  • timeout Example of using timeout control between Kitex server and client
  • limit Example of using current limit on Kitex server
  • circuit_breaker Example of Kitex client using circuit breaker
  • retry Example of Kitex client using retry
  • load_balance Example of Kitex server and client using load balancing

Observability

  • opentelemetry Example of Kitex server and client using OpenTelemetry
  • prometheus Example of Kitex server and client using prometheus
  • klog Example of using klog logs on the Kitex server

Advanced features

  • frugal Kitex example of using frugal on the server and client
  • grpc_proxy Example of Kitex server and client using grpc_proxy
  • generic Kitex example of using generic calls between server and client
  • meta_info Example of Kitex server and client using meta information
  • server_hook Examples of customizing business logic before and after Kitex server startup/exit
  • server_sdk Example of Kitex server-side SDKization
  • profiler Example of Kitex server and client performance analysis using request cost metrics
  • proxyless Example of letting Kitex services run in proxyless mode and be managed uniformly by the service mesh
  • grpc_multi_service Example of Kitex server and client using grpc multiservice
  • thrift_multi_service Example of Kitex server and client using thrift (non-streaming) multiservice
  • protobuf_multi_service Example of Kitex server and client using protobuf (non-streaming) multiservice
  • goroutine_local_storage Example of Kitex server and client using goroutine_local_storage

Kitex generated code

  • protobuf Example of using Kitex and protobuf to generate server code
  • template Example of using Kitex custom template to generate server code
  • thrift Example of using Kitex and thrift to generate server code
  • protobuf Example of using Kitex and protobuf to generate server code

Note

All commands to execute the example should be executed under "kitex-examples".

Execute 'regenerate-idl.sh' to re-generate all kitex_gen (include sub mods)

Extension points exported contracts — how you extend this code

ServiceA_ChatClient (Interface)
(no doc) [8 implementers]
grpcproxy/kitex_gen/grpcproxy/servicea/client.go
ArgsGetter (Interface)
(no doc) [65 implementers]
profiler/server/main.go
TestService_EchoServer (Interface)
(no doc) [8 implementers]
generic_streaming/thrift/kitex_gen/echo/streaming.go
StreamingService_StreamResponseEchoClient (Interface)
(no doc) [14 implementers]
generic_streaming/pb/kitex_gen/pb/streamingservice/client.go
Echo_StreamResponseEchoClient (Interface)
(no doc) [14 implementers]
streaming/kitex_gen/pbapi/echo/client.go
Hello (Interface)
(no doc) [50 implementers]
hello/kitex_gen/api/hello.go
GreetService (Interface)
(no doc) [5 implementers]
proxyless/service/codec/thrift/kitex_gen/proxyless/greet.go
Committer (Interface)
Committer is the interface that wraps the Commit method. [3 implementers]
bizdemo/kitex_ent/ent/tx.go

Core symbols most depended-on inside this repo

Errorf
called by 175
klog/custom/logger.go
FastWriteNocopy
called by 171
bizdemo/kitex_swagger_gen/kitex_gen/openapi/k-openapi.go
Write
called by 170
bizdemo/kitex_swagger_gen/kitex_gen/openapi/openapi.go
DeepEqual
called by 170
bizdemo/kitex_swagger_gen/kitex_gen/openapi/openapi.go
BLength
called by 170
bizdemo/kitex_swagger_gen/kitex_gen/openapi/k-openapi.go
InitDefault
called by 122
bizdemo/kitex_swagger_gen/kitex_gen/openapi/openapi.go
Error
called by 117
bizdemo/kitex_ent/ent/enttest/enttest.go
Fatal
called by 94
klog/custom/logger.go

Shape

Method 8,818
Function 1,326
Struct 584
Interface 99
TypeAlias 22
FuncType 14

Languages

Go100%

Modules by API surface

bizdemo/kitex_swagger_gen/kitex_gen/openapi/openapi.go2,170 symbols
bizdemo/kitex_swagger_gen/kitex_gen/openapi/k-openapi.go1,220 symbols
bizdemo/easy_note/kitex_gen/notedemo/note.go388 symbols
bizdemo/kitex_zorm/kitex_gen/user/user.go325 symbols
bizdemo/kitex_swagger_gen/kitex_gen/user/user.go325 symbols
bizdemo/kitex_gorm_gen/kitex_gen/user/user.go325 symbols
bizdemo/kitex_gorm/kitex_gen/user/user.go325 symbols
bizdemo/kitex_ent/kitex_gen/user/user.go325 symbols
bizdemo/easy_note/kitex_gen/notedemo/k-note.go224 symbols
bizdemo/kitex_zorm/kitex_gen/user/k-user.go184 symbols
bizdemo/kitex_swagger_gen/kitex_gen/user/k-user.go184 symbols
bizdemo/kitex_gorm_gen/kitex_gen/user/k-user.go184 symbols

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add kitex-examples \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page