17
server/combo/mgpb/micro_errors.pb.go
Normal file
17
server/combo/mgpb/micro_errors.pb.go
Normal file
@@ -0,0 +1,17 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.10.4
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
protojson "google.golang.org/protobuf/encoding/protojson"
|
||||
)
|
||||
|
||||
var (
|
||||
marshaler = protojson.MarshalOptions{}
|
||||
)
|
||||
|
||||
func (m *Error) Error() string {
|
||||
buf, _ := marshaler.Marshal(m)
|
||||
return string(buf)
|
||||
}
|
@@ -1,14 +1,13 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-micro v3.10.2
|
||||
// - protoc v3.21.12
|
||||
// - protoc-gen-go-micro v3.10.4
|
||||
// - protoc v5.28.3
|
||||
// source: proto.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
v3 "go.unistack.org/micro-server-http/v3"
|
||||
proto "go.unistack.org/micro-tests/server/combo/proto"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
)
|
||||
@@ -16,17 +15,6 @@ import (
|
||||
var (
|
||||
TestName = "Test"
|
||||
)
|
||||
var (
|
||||
TestServerEndpoints = []v3.EndpointMetadata{
|
||||
{
|
||||
Name: "Test.Call",
|
||||
Path: "/Call",
|
||||
Method: "POST",
|
||||
Body: "*",
|
||||
Stream: false,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
type TestClient interface {
|
||||
Call(ctx context.Context, req *proto.CallReq, opts ...client.CallOption) (*proto.CallRsp, error)
|
||||
|
@@ -1,12 +1,11 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.10.2
|
||||
// protoc-gen-go-micro version: v3.10.4
|
||||
// source: proto.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
v3 "go.unistack.org/micro-server-http/v3"
|
||||
proto "go.unistack.org/micro-tests/server/combo/proto"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
server "go.unistack.org/micro/v3/server"
|
||||
@@ -17,7 +16,7 @@ type testClient struct {
|
||||
name string
|
||||
}
|
||||
|
||||
func NewTestClient(name string, c client.Client) TestClient {
|
||||
func NewTestClient(name string, c client.Client) proto.TestClient {
|
||||
return &testClient{c: c, name: name}
|
||||
}
|
||||
|
||||
@@ -31,14 +30,14 @@ func (c *testClient) Call(ctx context.Context, req *proto.CallReq, opts ...clien
|
||||
}
|
||||
|
||||
type testServer struct {
|
||||
TestServer
|
||||
proto.TestServer
|
||||
}
|
||||
|
||||
func (h *testServer) Call(ctx context.Context, req *proto.CallReq, rsp *proto.CallRsp) error {
|
||||
return h.TestServer.Call(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func RegisterTestServer(s server.Server, sh TestServer, opts ...server.HandlerOption) error {
|
||||
func RegisterTestServer(s server.Server, sh proto.TestServer, opts ...server.HandlerOption) error {
|
||||
type test interface {
|
||||
Call(ctx context.Context, req *proto.CallReq, rsp *proto.CallRsp) error
|
||||
}
|
||||
@@ -47,6 +46,5 @@ func RegisterTestServer(s server.Server, sh TestServer, opts ...server.HandlerOp
|
||||
}
|
||||
h := &testServer{sh}
|
||||
var nopts []server.HandlerOption
|
||||
nopts = append(nopts, v3.HandlerEndpoints(TestServerEndpoints))
|
||||
return s.Handle(s.NewHandler(&Test{h}, append(nopts, opts...)...))
|
||||
}
|
||||
|
Reference in New Issue
Block a user