@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-micro v3.5.3
|
||||
// - protoc-gen-go-micro v3.10.1
|
||||
// - protoc v3.21.12
|
||||
// source: test.proto
|
||||
|
||||
@@ -8,47 +8,46 @@ package pb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
api "go.unistack.org/micro/v3/api"
|
||||
v3 "go.unistack.org/micro-server-http/v3"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
)
|
||||
|
||||
var (
|
||||
TestServiceName = "TestService"
|
||||
|
||||
TestServiceEndpoints = []api.Endpoint{
|
||||
)
|
||||
var (
|
||||
TestServiceServerEndpoints = []v3.EndpointMetadata{
|
||||
{
|
||||
Name: "TestService.LookupUser",
|
||||
Path: []string{"/v1/user/{name}"},
|
||||
Method: []string{"GET"},
|
||||
Handler: "rpc",
|
||||
Name: "TestService.LookupUser",
|
||||
Path: "/v1/user/{name}",
|
||||
Method: "GET",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "TestService.UpdateUser",
|
||||
Path: []string{"/v1/user/{name}"},
|
||||
Method: []string{"PUT"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
Name: "TestService.UpdateUser",
|
||||
Path: "/v1/user/{name}",
|
||||
Method: "PUT",
|
||||
Body: "*",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "TestService.DeleteUser",
|
||||
Path: []string{"/v1/user/{name}"},
|
||||
Method: []string{"DELETE"},
|
||||
Handler: "rpc",
|
||||
Name: "TestService.DeleteUser",
|
||||
Path: "/v1/user/{name}",
|
||||
Method: "DELETE",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "TestService.MailUser",
|
||||
Path: []string{"/v1/user/{name}/mail"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
Name: "TestService.MailUser",
|
||||
Path: "/v1/user/{name}/mail",
|
||||
Method: "POST",
|
||||
Body: "*",
|
||||
Stream: false,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
func NewTestServiceEndpoints() []api.Endpoint {
|
||||
return TestServiceEndpoints
|
||||
}
|
||||
|
||||
type TestServiceClient interface {
|
||||
LookupUser(ctx context.Context, req *LookupUserReq, opts ...client.CallOption) (*LookupUserRsp, error)
|
||||
UpdateUser(ctx context.Context, req *UpdateUserReq, opts ...client.CallOption) (*UpdateUserRsp, error)
|
||||
|
@@ -1,13 +1,14 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.5.3
|
||||
// protoc-gen-go-micro version: v3.10.1
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
context "context"
|
||||
v3 "go.unistack.org/micro-client-http/v3"
|
||||
api "go.unistack.org/micro/v3/api"
|
||||
v31 "go.unistack.org/micro-server-http/v3"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
server "go.unistack.org/micro/v3/server"
|
||||
http "net/http"
|
||||
@@ -38,6 +39,7 @@ func (c *testServiceClient) LookupUser(ctx context.Context, req *LookupUserReq,
|
||||
rsp := &LookupUserRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.LookupUser", req), rsp, opts...)
|
||||
if err != nil {
|
||||
fmt.Printf("AAA1 %v\n", err)
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
@@ -59,6 +61,7 @@ func (c *testServiceClient) UpdateUser(ctx context.Context, req *UpdateUserReq,
|
||||
rsp := &UpdateUserRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.UpdateUser", req), rsp, opts...)
|
||||
if err != nil {
|
||||
fmt.Printf("AAA2 %v\n", err)
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
@@ -79,6 +82,7 @@ func (c *testServiceClient) DeleteUser(ctx context.Context, req *DeleteUserReq,
|
||||
rsp := &DeleteUserRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.DeleteUser", req), rsp, opts...)
|
||||
if err != nil {
|
||||
fmt.Printf("AAA3 %v\n", err)
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
@@ -100,6 +104,7 @@ func (c *testServiceClient) MailUser(ctx context.Context, req *MailUserReq, opts
|
||||
rsp := &MailUserRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.MailUser", req), rsp, opts...)
|
||||
if err != nil {
|
||||
fmt.Printf("AAA4 %v\n", err)
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
@@ -153,8 +158,6 @@ func RegisterTestServiceServer(s server.Server, sh TestServiceServer, opts ...se
|
||||
}
|
||||
h := &testServiceServer{sh}
|
||||
var nopts []server.HandlerOption
|
||||
for _, endpoint := range TestServiceEndpoints {
|
||||
nopts = append(nopts, api.WithEndpoint(&endpoint))
|
||||
}
|
||||
nopts = append(nopts, v31.HandlerEndpoints(TestServiceServerEndpoints))
|
||||
return s.Handle(s.NewHandler(&TestService{h}, append(nopts, opts...)...))
|
||||
}
|
||||
|
Reference in New Issue
Block a user