go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

How to use the project layout from third party libraries on generating api?

Open testwill opened this issue 2 years ago • 3 comments

如果不能支持,像k8s里面的结构很大,拷贝过来写很麻烦。能不能直接支持

testwill avatar May 17 '23 06:05 testwill

Give a demo please, I didn't get it.

kevwan avatar May 17 '23 14:05 kevwan

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);

}

testwill avatar May 24 '23 09:05 testwill

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar May 29 '24 01:05 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Aug 27 '24 01:08 github-actions[bot]

@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?

panhow avatar Mar 07 '25 06:03 panhow