@@ -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,29 +8,26 @@ package helloworld
|
||||
|
||||
import (
|
||||
context "context"
|
||||
v3 "go.unistack.org/micro-server-http/v3"
|
||||
proto "go.unistack.org/micro-tests/server/grpc/proto"
|
||||
api "go.unistack.org/micro/v3/api"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
)
|
||||
|
||||
var (
|
||||
TestName = "Test"
|
||||
|
||||
TestEndpoints = []api.Endpoint{
|
||||
)
|
||||
var (
|
||||
TestServerEndpoints = []v3.EndpointMetadata{
|
||||
{
|
||||
Name: "Test.Call",
|
||||
Path: []string{"/api/v0/test/call/TEST"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
Name: "Test.Call",
|
||||
Path: "/api/v0/test/call/TEST",
|
||||
Method: "POST",
|
||||
Body: "*",
|
||||
Stream: false,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
func NewTestEndpoints() []api.Endpoint {
|
||||
return TestEndpoints
|
||||
}
|
||||
|
||||
type TestClient interface {
|
||||
Call(ctx context.Context, req *proto.Request, opts ...client.CallOption) (*proto.Response, error)
|
||||
}
|
||||
|
@@ -1,13 +1,13 @@
|
||||
// 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 helloworld
|
||||
|
||||
import (
|
||||
context "context"
|
||||
v3 "go.unistack.org/micro-server-http/v3"
|
||||
proto "go.unistack.org/micro-tests/server/grpc/proto"
|
||||
api "go.unistack.org/micro/v3/api"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
server "go.unistack.org/micro/v3/server"
|
||||
)
|
||||
@@ -47,8 +47,6 @@ func RegisterTestServer(s server.Server, sh TestServer, opts ...server.HandlerOp
|
||||
}
|
||||
h := &testServer{sh}
|
||||
var nopts []server.HandlerOption
|
||||
for _, endpoint := range TestEndpoints {
|
||||
nopts = append(nopts, api.WithEndpoint(&endpoint))
|
||||
}
|
||||
nopts = append(nopts, v3.HandlerEndpoints(TestServerEndpoints))
|
||||
return s.Handle(s.NewHandler(&Test{h}, append(nopts, opts...)...))
|
||||
}
|
||||
|
@@ -107,7 +107,7 @@ func TestGRPCServer(t *testing.T) {
|
||||
server.Address("127.0.0.1:0"),
|
||||
server.Codec("text/plain", codec.NewCodec()),
|
||||
)
|
||||
if err = health.RegisterHealthServer(srv, health.NewHandler(health.Version("0.0.1"))); err != nil {
|
||||
if err = health.RegisterHealthServiceServer(srv, health.NewHandler(health.Version("0.0.1"))); err != nil {
|
||||
t.Fatalf("cant register health handler: %v", err)
|
||||
}
|
||||
|
||||
|
@@ -2,27 +2,31 @@ syntax = "proto3";
|
||||
|
||||
package helloworld;
|
||||
|
||||
option go_package = "go.unistack.org/micro-tests/server/grpc/proto;helloworld";
|
||||
import "api/annotations.proto";
|
||||
|
||||
option go_package = "go.unistack.org/micro-tests/server/grpc/proto;helloworld";
|
||||
|
||||
service Test {
|
||||
rpc Call(Request) returns (Response) {
|
||||
option (micro.api.http) = { post: "/api/v0/test/call/TEST"; body: "*"; };
|
||||
};
|
||||
rpc Call(Request) returns (Response) {
|
||||
option (micro.api.http) = {
|
||||
post: "/api/v0/test/call/TEST";
|
||||
body: "*";
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message Request {
|
||||
string uuid = 1;
|
||||
string name = 2;
|
||||
string name = 2;
|
||||
|
||||
Broken broken = 4;
|
||||
};
|
||||
Broken broken = 4;
|
||||
}
|
||||
|
||||
message Broken {
|
||||
string field = 1;
|
||||
};
|
||||
}
|
||||
|
||||
message Response {
|
||||
string msg = 1;
|
||||
Broken broken = 4;
|
||||
};
|
||||
string msg = 1;
|
||||
Broken broken = 4;
|
||||
}
|
||||
|
Reference in New Issue
Block a user