Comments (5)
别着急, 文档还没写清楚, 要先用工具生成api.pb.go
.
我在等文档都写好了再用它.
如果你真要使用rpc功能, 看看 https://github.com/bilibili/kratos/blob/master/doc/wiki-cn/warden-quickstart.md 这个文档, 但你会发现在 kratos tool kprotoc
这个命令无效, 因为 kprotoc
还没安装, 关键是没有文档写怎么安装 kprotoc
, 我来告诉你, kprotoc
这个东西在 https://github.com/bilibili/kratos/tree/master/tool/kprotoc, 你看看install_kprotoc.sh
应该就清楚了.
当然, 可能还会有坑, 这个命令不支持多gopath的情况, 所以可能你还要改改.
就算你真的生成了api.pb.go
, 成功运行后, 你会试着调用这个rpc, 当然, 这又是一个巨大的挑战, 因为还有discovery
的坑等着你...
这是一个文档还没写明白就着急开源的项目, 对前期的试用者是一个巨大的挑战, 当然也会让潜在的爱好者放弃.
from kratos.
@lealife 可以先关注,我们逐渐再完善中,也谢谢反馈。其实我们并不是强依赖discovery,naming是一个抽象,可以实现zk、etcd等,但是时间原因都还没来得及实现,也欢迎贡献PR
from kratos.
期待尽快完善!! 持续关注.
from kratos.
一键默认生成没有这个问题,自定义生成确实复现这个问题
from kratos.
GOOS
- macos: shoult always be successful, if not install
protoc
andgogo protobuf
, then run:cd kratos-demo/api
kratos tool kprotoc
cd kratos-demo/cmd & go build
- windows: install
protoc
andgogo protobuf
,then run:cd kratos-demo/api
protoc --gogofast_out=plugins=grpc:$GOPATH/src api.proto
cd kratos-demo/cmd & go build
- linux: install
protoc
first, then run:cd kratos-demo/api
kratos tool kprotoc
cd kratos-demo/cmd & go build
protoc:https://github.com/protocolbuffers/protobuf#protocol-compiler-installation
gogo protobuf:https://github.com/gogo/protobuf
kratos tool:https://github.com/bilibili/kratos/blob/master/doc/wiki-cn/kratos-tool.md
from kratos.
Related Issues (20)
- [Proposal] config feature roadmap HOT 22
- [Feature] replace kratos metrics with otel metrics HOT 3
- [The modification of header file information of http response does not take effect] ctx.Header().Set("Content-Type", "application/octet-stream") HOT 5
- [Question] How to return a custom response json? HOT 1
- Package version dependency issue HOT 4
- go generate ./...failed HOT 5
- [Feature]Add svrType related fields in proto to protoc-gen-go-http and http transport HOT 3
- proto file used to build the api document reported an error HOT 1
- consul watch, the server is offline and will not receive any notification HOT 6
- [Feature] Add NewClient method to gRPC Client HOT 3
- [Question] DDD的最佳实践方式?包括CQRS、Clean Architecture、六边形结构 HOT 5
- [Question]请教下kratos如何定义支持上传文件接口? HOT 3
- metrics statistics and usage issues [Question] HOT 5
- `stream` response in proto failed to generate http client HOT 6
- [Feature] Add kratos errors to buf remote plugin HOT 1
- [Question] I modified it based on examples/helloworld and found that client/main.go reported an error when executing. I am not sure if it is a BUG. HOT 1
- HTTPClient proto: syntax error (line 1:1): unexpected token 404 HOT 3
- [Question] how to set response content-type as xml for one method HOT 2
- [Question] HTTP Server. extra add route do not pass middleware. HOT 2
- I a new release due soon ? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kratos.