cloudwego / cloudwego.github.io Goto Github PK
View Code? Open in Web Editor NEWWebsite for CloudWeGo
Home Page: https://www.cloudwego.io
License: Apache License 2.0
Website for CloudWeGo
Home Page: https://www.cloudwego.io
License: Apache License 2.0
Please add FAQ about kitex template and generator parameters.
Kitex除了支持生成Go语言外,是否未来有考虑支持Python, C/C++?
文档没对应更新哦,辛苦大大更新下,new thrift -module
can not find "github.com/cloudwego/kitex/sdk/message",maybe "github.com/cloudwego/kitex/pkg/remote/trans/invoke" i guess?
象springboot有对应的@jsonformat注解可以解决这样的问题,你们这个框架有吗?
还有 uint64 的数据 在java中应该是lang类型的吧,如果将lang类型json相应的时候,相应为string类型,否则,在浏览器段精度会缺失的。这些问题在你们的文档中没有体现。。。
clone 站点下来,本地hugo server启动站点.
点击顶部的文档,选择 一个项目 kitex,左侧的文档结构栏不显示。 只有点击具体某文档内容,左侧才会呈现该项目的文档结构?
跟用的hugo版本有关系吗
针对第2步和第3步。
会收到如下提示。
go get: installing executables with 'go get' in module mode is deprecated.
Use 'go install pkg@version' instead.
For more information, see https://golang.org/doc/go-get-install-deprecation
or run 'go help get' or 'go help install'.
是否更换到用go install
会更好?
Describe the bug
In this page :https://www.cloudwego.io/zh/docs/cwgo/getting-started/
This link is lost, both for En/Zh.
To Reproduce
Expected behavior
To the right page.
运行示例代码下的输出和上面示例代码对不上
输出部分文档如下:
如果不出意外,我们可以看到类似如下输出
$ {"message":"pong"}
到现在,我们已经成功启动了 Hertz Server,并完成了一次调用。
而上方示例代码如下:
func main() {
h := server.Default()
h.GET("/ping", func(c context.Context, ctx *app.RequestContext) {
ctx.JSON(consts.StatusOK, utils.H{"ping": "pong"})
})
h.Spin()
}
I noticed there's a quote for ginex
in the Kitex generic-call doc. Maybe we should change it to gin
or hertz
now ?
https://www.cloudwego.io/zh/docs/kitex/tutorials/advanced-feature/generic-call/
cli, err := genericclient.NewClient("destServiceName", g, opts...)
if err != nil {
panic(err)
}
// 构造request,或者从ginex获取
body := map[string]interface{}{
"text": "text",
"some": map[string]interface{}{
"id": 1,
"text": "text",
},
"req_items_map": map[string]interface{}{
"1": map[string]interface{}{
"id": 1,
"text": "text",
},
},
}
修改jwt的实现,添加一个从postform中获取token的配置是不是会更完美?
你好,对于通配路由中*path 的匹配情况:
路径 | 是否匹配 |
---|---|
/src/ | 匹配 |
/src/somefile.go | 匹配 |
/src/subdir/somefile.go | 不匹配 |
经过实际尝试,似乎第三种情况是会被匹配的,也就是通配路由可以跨越单个路径段。
不知道是不是我理解上有什么问题?
如果需要,我可以提供复现的代码和请求,不过只需要仿照上下文就可以了,subdir 多层也会被匹配
Not all trait items implemented, missing: Response
, Error
, Future
[E0046]
kitex -type thrift ${service_name} ${idl_name}.thrift
这里这种格式,提示如下。实际我是存在该文件的
Require exactly 1 IDL file.
[root@localhost super_faceimglocaloss]# ./faceimglocaloss
panic: Unsupported CPU, maybe it's too old to run Sonic.
goroutine 1 [running]:
github.com/bytedance/sonic/internal/native.init.0()
F:/golang/GOPATH/pkg/mod/github.com/bytedance/[email protected]/internal/native/dispatch_amd64.go:144 +0x1fb
我这是虚拟机,cpu太旧了,,不能用,这是要我放弃了
这是我在调用sh bulid.sh生成项目的时候遇到的一部分报错信息
../../gopath/pkg/mod/github.com/cloudwego/[email protected]/pkg/generic/thrift/base.go:63:14: not enough arguments in call to iprot.ReadStructBegin
have ()
want (context.Context)
../../gopath/pkg/mod/github.com/cloudwego/[email protected]/pkg/generic/thrift/base.go:68:34: not enough arguments in call to iprot.ReadFieldBegin
have ()
want (context.Context)
../../gopath/pkg/mod/github.com/cloudwego/[email protected]/pkg/generic/thrift/base.go:83:25: not enough arguments in call to iprot.Skip
have ("github.com/apache/thrift/lib/go/thrift".TType)
want (context.Context, "github.com/apache/thrift/lib/go/thrift".TType)
../../gopath/pkg/mod/github.com/cloudwego/[email protected]/pkg/generic/thrift/base.go:93:25: not enough arguments in call to iprot.Skip
have ("github.com/apache/thrift/lib/go/thrift".TType)
want (context.Context, "github.com/apache/thrift/lib/go/thrift".TType)
../../gopath/pkg/mod/github.com/cloudwego/[email protected]/pkg/generic/thrift/base.go:98:24: not enough arguments in call to iprot.Skip
have ("github.com/apache/thrift/lib/go/thrift".TType)
want (context.Context, "github.com/apache/thrift/lib/go/thrift".TType)
../../gopath/pkg/mod/github.com/cloudwego/[email protected]/pkg/generic/thrift/base.go:103:12: not enough arguments in call to iprot.ReadFieldEnd
have ()
want (context.Context)
这是我的example.thrift设置
namespace go api
struct Request {
1: string message
}
struct Response {
1: string message
}
service Echo {
Response echo(1: Request req)
}
这是我的handler.go的代码
package main
import (
"context"
api "example/kitex_gen/api"
)
// EchoImpl implements the last service interface defined in the IDL.
type EchoImpl struct{}
// Echo implements the EchoImpl interface.
func (s *EchoImpl) Echo(ctx context.Context, req *api.Request) (resp *api.Response, err error) {
// TODO: Your code here...
return &api.Response{Message: req.Message}, nil
}
这是当前的go.mod设置
module example
go 1.16
require (
github.com/apache/thrift v0.17.0
github.com/cloudwego/kitex v0.4.4
)
我运行的平台是wsl2,Linux版本是Ubuntu-20.04
七千多行代码,一半提示这个错误,因为生成的接口方法中多了context参数,不知如何解决,一个一个删太慢了
即使我不加module option一样会生成图片一样的代码
hz 版本
hz version v0.6.1
系统:macOS
go env:
nihilism@NihilismdeMacBook-Pro awesomeProject % go env
GO111MODULE="on"
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/nihilism/Library/Caches/go-build"
GOENV="/Users/nihilism/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/nihilism/sdk/go1.20.1/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/nihilism/sdk/go1.20.1:/Users/nihilism/sdk/go1.20.1/bin"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/Users/nihilism/sdk/go1.20.1"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/nihilism/sdk/go1.20.1/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.20.1"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/nihilism/GolandProjects/awesomeProject/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/hp/k_nbwpfd0813gzgswbrz0h5m0000gn/
There is no information in what type of failure triggers BackupRetry (TimeoutRetry is pretty obvious) in documenataion: https://www.cloudwego.io/docs/tutorials/basic-feature/retry/
windows10 go 1.18.6, occured UnsupporetedCPU ,maybe it‘s too old to run Sonic in Cloudwego/Hertz
https://www.cloudwego.io/zh/docs/hertz/reference/json/
默认关闭 html enscape
enscape应为escape
........\pkg\mod\github.com\cloudwego\[email protected]\pkg\network\standard\connection.go:50:25: undefined: unix.EPIPE
........\pkg\mod\github.com\cloudwego\[email protected]\pkg\network\standard\connection.go:50:55: undefined: unix.ENOTCONN
Mac M1 上编译报错这一块里面的
设置GOARCH参数为amd64(即GOARCH=amd64)。请去除该参数或设置为 `arm64``这句话应该是有歧义吧,我是设置为arm64才成功,那前面那句话设置为amd64是不是有问题
为什么没有proto的生成示例
数据绑定,日期如何绑定,比如前端传递日期格式yyyy-MM-dd HH:mm:ss
没有一个通用的api文档吗?
[background] 在尝试cwg kitex 命令行工具选项 --thrift-plugin validator
自定义检验器时,发现直接使用会报找不到 "thrift-gen-validator" 的错误 ,如下提示:
$ kitex --thrift-plugin validator -service ${MODULE} ${IDL_PATH}
exec: "thrift-gen-validator": executable file not found in $PATH
翻了一下文档,貌似没提示需要额外安装 go get github.com/cloudwego/thrift-gen-validator
然后 go install
一下,thrift-gen-validator
就安装到了 $GOPATH/bin/
下,可以被 kitex
命令行工具直接调用了。
所以提个小建议:可以在 validator doc 中添加一下提示。
在Kubernetes场景下应用kitex,由于Kubernetes不能处理长连接的负载均衡,所以需要一种能够定时刷新连接(根据时间或者已处理请求数)的连接池。
请问类似的连接池在kitex中有无提供,如果没有,我可能考虑会实现一下。
// 此时,hz 会把 model 生成在 "biz/mdoel"下
应该是:
// 此时,hz 会把 model 生成在 "biz/model"下
Is your feature request related to a problem? Please describe.
I'm a new user of kitex, I often forget how to use, I only remember some keywords, but finding documents by keywords is very difficult
Describe the solution you'd like
Add search for the doc.
h := server.Default(server.WithHostPorts("127.0.0.1:8080"))
v1 := h.Group("/v1")
h.GET("/get", func(ctx context.Context, c *app.RequestContext) {
c.String(consts.StatusOK, "get")
})
h.POST("/post", func(ctx context.Context, c *app.RequestContext) {
c.String(consts.StatusOK, "post")
})
这个地方的h.GET和h.POST应该是v1.GET和v1.POST吧
每类连接模型没有绝对好坏,取决于实际使用场景。连接多路复用虽然一般来说性能相对最好,但应用上必须依赖协议能够支持包序列号,且一些老框架服务可能也并不支持多路复用的方式调用。
这句话里有一处不明白,是“能够支持包序列号”,还是想表达“序列化”?
官网说默认提供的是 circuitbreaker.RPCInfo2Key,但是实际上是circuitbreak.RPCInfo2Key。并没有er
// build a new CBSuite
cbs := circuitbreak.NewCBSuite(circuitbreak.RPCInfo2Key)
c, err := userservice.NewClient(
consts.UserServiceName,
client.WithCircuitBreaker(cbs),
client.WithResolver(r),
client.WithMiddleware(mw.CommonMiddleware),
client.WithInstanceMW(mw.ClientMiddleware),
client.WithClientBasicInfo(&rpcinfo.EndpointBasicInfo{ServiceName: consts.ApiServiceName}),
)
Is your feature request related to a problem? Please describe.
This issue is part of Hertz Recipes, a purposal to improve documentation quality for Hertz's functionalities
I opened this issue to investigate and keep track of answers of the following problem:
Upon agreement of the community with regards to the question above, we should be finalised the documentation in both Chinese and English.
github.io url好像是cloudwego.github.io不是cloudwego.io(第一行readme)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.