1
0
mirror of https://github.com/go-kratos/kratos.git synced 2026-05-22 10:15:24 +02:00

add path pattern for http (#1076)

* add path pattern for http
This commit is contained in:
longxboy
2021-06-17 17:34:27 +08:00
committed by GitHub
parent a50bbbd0d5
commit 8baa2ede4b
13 changed files with 106 additions and 43 deletions
+7 -3
View File
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-http. DO NOT EDIT.
// versions:
// protoc-gen-go-http v2.0.0-rc3
// protoc-gen-go-http v2.0.0-rc5
package metadata
@@ -84,8 +84,10 @@ func NewMetadataHTTPClient(client *http.Client) MetadataHTTPClient {
func (c *MetadataHTTPClientImpl) GetServiceDesc(ctx context.Context, in *GetServiceDescRequest, opts ...http.CallOption) (*GetServiceDescReply, error) {
var out GetServiceDescReply
path := binding.EncodeURL("/services/{name}", in, true)
pattern := "/services/{name}"
path := binding.EncodeURL(pattern, in, true)
opts = append(opts, http.Operation("/kratos.api.Metadata/GetServiceDesc"))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
if err != nil {
return nil, err
@@ -95,8 +97,10 @@ func (c *MetadataHTTPClientImpl) GetServiceDesc(ctx context.Context, in *GetServ
func (c *MetadataHTTPClientImpl) ListServices(ctx context.Context, in *ListServicesRequest, opts ...http.CallOption) (*ListServicesReply, error) {
var out ListServicesReply
path := binding.EncodeURL("/services", in, true)
pattern := "/services"
path := binding.EncodeURL(pattern, in, true)
opts = append(opts, http.Operation("/kratos.api.Metadata/ListServices"))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
if err != nil {
return nil, err