go-zero
go-zero copied to clipboard
How to use the project layout from third party libraries on generating api?
如果不能支持,像k8s里面的结构很大,拷贝过来写很麻烦。能不能直接支持
Give a demo please, I didn't get it.
type (
ApiLog {
ClusterId string json:"cluster_id"
audit.EventList//"k8s.io/apiserver/pkg/apis/audit" audit.EventList这个就是k8s的库中的一个结构体
}
)
@server( group: logtest prefix: api ) service Gateway {
@doc(
summary: "test"
)
@handler ApiLogPush
post /logtest/api_log (ApiLog) returns (Empty);
}
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
@kevwan i got the same problems here for example, i am writing a web server to provide mutating webhooks, the input is from package "sigs.k8s.io/controller-runtime/pkg/webhook/admission", request body struct is "admission.Request".
How can i define it in api files?