Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
415b232977
commit
356e20440b
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.26.0
|
// protoc-gen-go v1.26.0
|
||||||
// protoc v5.28.3
|
// protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-micro v3.10.4
|
// - protoc-gen-go-micro v3.10.4
|
||||||
// - protoc v5.28.3
|
// - protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -58,6 +58,5 @@ func RegisterTestServiceServer(s server.Server, sh TestServiceServer, opts ...se
|
|||||||
testService
|
testService
|
||||||
}
|
}
|
||||||
h := &testServiceServer{sh}
|
h := &testServiceServer{sh}
|
||||||
var nopts []server.HandlerOption
|
return s.Handle(s.NewHandler(&TestService{h}, opts...))
|
||||||
return s.Handle(s.NewHandler(&TestService{h}, append(nopts, opts...)...))
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-micro v3.10.4
|
// - protoc-gen-go-micro v3.10.4
|
||||||
// - protoc v5.28.3
|
// - protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package helloworld
|
package helloworld
|
||||||
@ -26,6 +26,8 @@ type Test_StreamClient interface {
|
|||||||
Context() context.Context
|
Context() context.Context
|
||||||
SendMsg(msg interface{}) error
|
SendMsg(msg interface{}) error
|
||||||
RecvMsg(msg interface{}) error
|
RecvMsg(msg interface{}) error
|
||||||
|
CloseAndRecv() (*proto.Response, error)
|
||||||
|
CloseSend() error
|
||||||
Close() error
|
Close() error
|
||||||
Header() metadata.Metadata
|
Header() metadata.Metadata
|
||||||
Send(msg *proto.Request) error
|
Send(msg *proto.Request) error
|
||||||
@ -41,6 +43,7 @@ type Test_StreamStream interface {
|
|||||||
Context() context.Context
|
Context() context.Context
|
||||||
SendMsg(msg interface{}) error
|
SendMsg(msg interface{}) error
|
||||||
RecvMsg(msg interface{}) error
|
RecvMsg(msg interface{}) error
|
||||||
|
SendAndClose(msg *proto.Response) error
|
||||||
Close() error
|
Close() error
|
||||||
Recv() (*proto.Request, error)
|
Recv() (*proto.Request, error)
|
||||||
Send(msg *proto.Response) error
|
Send(msg *proto.Response) error
|
||||||
|
@ -30,7 +30,7 @@ func (c *testClient) Call(ctx context.Context, req *proto.Request, opts ...clien
|
|||||||
return rsp, nil
|
return rsp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *testClient) Stream(ctx context.Context, opts ...client.CallOption) (Test_StreamClient, error) {
|
func (c *testClient) Stream(ctx context.Context, opts ...client.CallOption) (proto.Test_StreamClient, error) {
|
||||||
stream, err := c.c.Stream(ctx, c.c.NewRequest(c.name, "Test.Stream", &proto.Request{}), opts...)
|
stream, err := c.c.Stream(ctx, c.c.NewRequest(c.name, "Test.Stream", &proto.Request{}), opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -42,6 +42,18 @@ type testClientStream struct {
|
|||||||
stream client.Stream
|
stream client.Stream
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *testClientStream) CloseAndRecv() (*proto.Response, error) {
|
||||||
|
msg := &proto.Response{}
|
||||||
|
err := s.RecvMsg(msg)
|
||||||
|
if err == nil {
|
||||||
|
err = s.Close()
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return msg, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (s *testClientStream) Close() error {
|
func (s *testClientStream) Close() error {
|
||||||
return s.stream.Close()
|
return s.stream.Close()
|
||||||
}
|
}
|
||||||
@ -94,6 +106,13 @@ type testStreamStream struct {
|
|||||||
stream server.Stream
|
stream server.Stream
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *testStreamStream) SendAndClose(msg *proto.Response) error {
|
||||||
|
err := s.SendMsg(msg)
|
||||||
|
if err == nil {
|
||||||
|
err = s.stream.Close()
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
func (s *testStreamStream) Close() error {
|
func (s *testStreamStream) Close() error {
|
||||||
return s.stream.Close()
|
return s.stream.Close()
|
||||||
}
|
}
|
||||||
@ -131,6 +150,5 @@ func RegisterTestServer(s server.Server, sh proto.TestServer, opts ...server.Han
|
|||||||
test
|
test
|
||||||
}
|
}
|
||||||
h := &testServer{sh}
|
h := &testServer{sh}
|
||||||
var nopts []server.HandlerOption
|
return s.Handle(s.NewHandler(&Test{h}, opts...))
|
||||||
return s.Handle(s.NewHandler(&Test{h}, append(nopts, opts...)...))
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.26.0
|
// protoc-gen-go v1.26.0
|
||||||
// protoc v5.28.3
|
// protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package helloworld
|
package helloworld
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-grpc v1.5.1
|
// - protoc-gen-go-grpc v1.5.1
|
||||||
// - protoc v5.28.3
|
// - protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package helloworld
|
package helloworld
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.26.0
|
// protoc-gen-go v1.26.0
|
||||||
// protoc v5.28.3
|
// protoc v5.29.2
|
||||||
// source: github.proto
|
// source: github.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-micro v3.10.4
|
// - protoc-gen-go-micro v3.10.4
|
||||||
// - protoc v5.28.3
|
// - protoc v5.29.2
|
||||||
// source: github.proto
|
// source: github.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -98,7 +98,6 @@ func RegisterGithubServer(s server.Server, sh GithubServer, opts ...server.Handl
|
|||||||
github
|
github
|
||||||
}
|
}
|
||||||
h := &githubServer{sh}
|
h := &githubServer{sh}
|
||||||
var nopts []server.HandlerOption
|
opts = append(opts, v3.HandlerEndpoints(GithubServerEndpoints))
|
||||||
nopts = append(nopts, v3.HandlerEndpoints(GithubServerEndpoints))
|
return s.Handle(s.NewHandler(&Github{h}, opts...))
|
||||||
return s.Handle(s.NewHandler(&Github{h}, append(nopts, opts...)...))
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.26.0
|
// protoc-gen-go v1.26.0
|
||||||
// protoc v5.28.3
|
// protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-micro v3.10.4
|
// - protoc-gen-go-micro v3.10.4
|
||||||
// - protoc v5.28.3
|
// - protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -7,16 +7,11 @@ package pb
|
|||||||
import (
|
import (
|
||||||
context "context"
|
context "context"
|
||||||
_ "go.unistack.org/micro-client-http/v3"
|
_ "go.unistack.org/micro-client-http/v3"
|
||||||
v3 "go.unistack.org/micro-server-http/v3"
|
|
||||||
client "go.unistack.org/micro/v3/client"
|
client "go.unistack.org/micro/v3/client"
|
||||||
codec "go.unistack.org/micro/v3/codec"
|
codec "go.unistack.org/micro/v3/codec"
|
||||||
server "go.unistack.org/micro/v3/server"
|
server "go.unistack.org/micro/v3/server"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
TestServerEndpoints = []v3.EndpointMetadata{}
|
|
||||||
)
|
|
||||||
|
|
||||||
type testClient struct {
|
type testClient struct {
|
||||||
c client.Client
|
c client.Client
|
||||||
name string
|
name string
|
||||||
@ -51,7 +46,5 @@ func RegisterTestServer(s server.Server, sh TestServer, opts ...server.HandlerOp
|
|||||||
test
|
test
|
||||||
}
|
}
|
||||||
h := &testServer{sh}
|
h := &testServer{sh}
|
||||||
var nopts []server.HandlerOption
|
return s.Handle(s.NewHandler(&Test{h}, opts...))
|
||||||
nopts = append(nopts, v3.HandlerEndpoints(TestServerEndpoints))
|
|
||||||
return s.Handle(s.NewHandler(&Test{h}, append(nopts, opts...)...))
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.26.0
|
// protoc-gen-go v1.26.0
|
||||||
// protoc v5.28.3
|
// protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-micro v3.10.4
|
// - protoc-gen-go-micro v3.10.4
|
||||||
// - protoc v5.28.3
|
// - protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -7,15 +7,10 @@ package pb
|
|||||||
import (
|
import (
|
||||||
context "context"
|
context "context"
|
||||||
_ "go.unistack.org/micro-client-http/v3"
|
_ "go.unistack.org/micro-client-http/v3"
|
||||||
v3 "go.unistack.org/micro-server-http/v3"
|
|
||||||
client "go.unistack.org/micro/v3/client"
|
client "go.unistack.org/micro/v3/client"
|
||||||
server "go.unistack.org/micro/v3/server"
|
server "go.unistack.org/micro/v3/server"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
TestServerEndpoints = []v3.EndpointMetadata{}
|
|
||||||
)
|
|
||||||
|
|
||||||
type testClient struct {
|
type testClient struct {
|
||||||
c client.Client
|
c client.Client
|
||||||
name string
|
name string
|
||||||
@ -50,7 +45,5 @@ func RegisterTestServer(s server.Server, sh TestServer, opts ...server.HandlerOp
|
|||||||
test
|
test
|
||||||
}
|
}
|
||||||
h := &testServer{sh}
|
h := &testServer{sh}
|
||||||
var nopts []server.HandlerOption
|
return s.Handle(s.NewHandler(&Test{h}, opts...))
|
||||||
nopts = append(nopts, v3.HandlerEndpoints(TestServerEndpoints))
|
|
||||||
return s.Handle(s.NewHandler(&Test{h}, append(nopts, opts...)...))
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.26.0
|
// protoc-gen-go v1.26.0
|
||||||
// protoc v5.28.3
|
// protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-micro v3.10.4
|
// - protoc-gen-go-micro v3.10.4
|
||||||
// - protoc v5.28.3
|
// - protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -185,7 +185,6 @@ func RegisterTestServiceServer(s server.Server, sh TestServiceServer, opts ...se
|
|||||||
testService
|
testService
|
||||||
}
|
}
|
||||||
h := &testServiceServer{sh}
|
h := &testServiceServer{sh}
|
||||||
var nopts []server.HandlerOption
|
opts = append(opts, v3.HandlerEndpoints(TestServiceServerEndpoints))
|
||||||
nopts = append(nopts, v3.HandlerEndpoints(TestServiceServerEndpoints))
|
return s.Handle(s.NewHandler(&TestService{h}, opts...))
|
||||||
return s.Handle(s.NewHandler(&TestService{h}, append(nopts, opts...)...))
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.26.0
|
// protoc-gen-go v1.26.0
|
||||||
// protoc v5.28.3
|
// protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.26.0
|
// protoc-gen-go v1.26.0
|
||||||
// protoc v5.28.3
|
// protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-micro v3.10.4
|
// - protoc-gen-go-micro v3.10.4
|
||||||
// - protoc v5.28.3
|
// - protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -198,7 +198,6 @@ func RegisterTestServiceServer(s server.Server, sh TestServiceServer, opts ...se
|
|||||||
testService
|
testService
|
||||||
}
|
}
|
||||||
h := &testServiceServer{sh}
|
h := &testServiceServer{sh}
|
||||||
var nopts []server.HandlerOption
|
opts = append(opts, v3.HandlerEndpoints(TestServiceServerEndpoints))
|
||||||
nopts = append(nopts, v3.HandlerEndpoints(TestServiceServerEndpoints))
|
return s.Handle(s.NewHandler(&TestService{h}, opts...))
|
||||||
return s.Handle(s.NewHandler(&TestService{h}, append(nopts, opts...)...))
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-micro v3.10.4
|
// - protoc-gen-go-micro v3.10.4
|
||||||
// - protoc v5.28.3
|
// - protoc v5.29.2
|
||||||
// source: proto.proto
|
// source: proto.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -45,6 +45,5 @@ func RegisterTestServer(s server.Server, sh proto.TestServer, opts ...server.Han
|
|||||||
test
|
test
|
||||||
}
|
}
|
||||||
h := &testServer{sh}
|
h := &testServer{sh}
|
||||||
var nopts []server.HandlerOption
|
return s.Handle(s.NewHandler(&Test{h}, opts...))
|
||||||
return s.Handle(s.NewHandler(&Test{h}, append(nopts, opts...)...))
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-micro v3.10.4
|
// - protoc-gen-go-micro v3.10.4
|
||||||
// - protoc v5.28.3
|
// - protoc v5.29.2
|
||||||
// source: proto.proto
|
// source: proto.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -70,7 +70,6 @@ func RegisterTestServer(s server.Server, sh proto.TestServer, opts ...server.Han
|
|||||||
test
|
test
|
||||||
}
|
}
|
||||||
h := &testServer{sh}
|
h := &testServer{sh}
|
||||||
var nopts []server.HandlerOption
|
opts = append(opts, v3.HandlerEndpoints(TestServerEndpoints))
|
||||||
nopts = append(nopts, v3.HandlerEndpoints(TestServerEndpoints))
|
return s.Handle(s.NewHandler(&Test{h}, opts...))
|
||||||
return s.Handle(s.NewHandler(&Test{h}, append(nopts, opts...)...))
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.26.0
|
// protoc-gen-go v1.26.0
|
||||||
// protoc v5.28.3
|
// protoc v5.29.2
|
||||||
// source: ngpb.proto
|
// source: ngpb.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-grpc v1.5.1
|
// - protoc-gen-go-grpc v1.5.1
|
||||||
// - protoc v5.28.3
|
// - protoc v5.29.2
|
||||||
// source: ngpb.proto
|
// source: ngpb.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.26.0
|
// protoc-gen-go v1.26.0
|
||||||
// protoc v5.28.3
|
// protoc v5.29.2
|
||||||
// source: proto.proto
|
// source: proto.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-micro v3.10.4
|
// - protoc-gen-go-micro v3.10.4
|
||||||
// - protoc v5.28.3
|
// - protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package helloworld
|
package helloworld
|
||||||
@ -26,6 +26,8 @@ type Test_StreamCallClient interface {
|
|||||||
Context() context.Context
|
Context() context.Context
|
||||||
SendMsg(msg interface{}) error
|
SendMsg(msg interface{}) error
|
||||||
RecvMsg(msg interface{}) error
|
RecvMsg(msg interface{}) error
|
||||||
|
CloseAndRecv() (*proto.Response, error)
|
||||||
|
CloseSend() error
|
||||||
Close() error
|
Close() error
|
||||||
Header() metadata.Metadata
|
Header() metadata.Metadata
|
||||||
Send(msg *proto.Request) error
|
Send(msg *proto.Request) error
|
||||||
@ -41,6 +43,7 @@ type Test_StreamCallStream interface {
|
|||||||
Context() context.Context
|
Context() context.Context
|
||||||
SendMsg(msg interface{}) error
|
SendMsg(msg interface{}) error
|
||||||
RecvMsg(msg interface{}) error
|
RecvMsg(msg interface{}) error
|
||||||
|
SendAndClose(msg *proto.Response) error
|
||||||
Close() error
|
Close() error
|
||||||
Recv() (*proto.Request, error)
|
Recv() (*proto.Request, error)
|
||||||
Send(msg *proto.Response) error
|
Send(msg *proto.Response) error
|
||||||
|
@ -30,7 +30,7 @@ func (c *testClient) Call(ctx context.Context, req *proto.Request, opts ...clien
|
|||||||
return rsp, nil
|
return rsp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *testClient) StreamCall(ctx context.Context, opts ...client.CallOption) (Test_StreamCallClient, error) {
|
func (c *testClient) StreamCall(ctx context.Context, opts ...client.CallOption) (proto.Test_StreamCallClient, error) {
|
||||||
stream, err := c.c.Stream(ctx, c.c.NewRequest(c.name, "Test.StreamCall", &proto.Request{}), opts...)
|
stream, err := c.c.Stream(ctx, c.c.NewRequest(c.name, "Test.StreamCall", &proto.Request{}), opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -42,6 +42,18 @@ type testClientStreamCall struct {
|
|||||||
stream client.Stream
|
stream client.Stream
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *testClientStreamCall) CloseAndRecv() (*proto.Response, error) {
|
||||||
|
msg := &proto.Response{}
|
||||||
|
err := s.RecvMsg(msg)
|
||||||
|
if err == nil {
|
||||||
|
err = s.Close()
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return msg, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (s *testClientStreamCall) Close() error {
|
func (s *testClientStreamCall) Close() error {
|
||||||
return s.stream.Close()
|
return s.stream.Close()
|
||||||
}
|
}
|
||||||
@ -94,6 +106,13 @@ type testStreamCallStream struct {
|
|||||||
stream server.Stream
|
stream server.Stream
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *testStreamCallStream) SendAndClose(msg *proto.Response) error {
|
||||||
|
err := s.SendMsg(msg)
|
||||||
|
if err == nil {
|
||||||
|
err = s.stream.Close()
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
func (s *testStreamCallStream) Close() error {
|
func (s *testStreamCallStream) Close() error {
|
||||||
return s.stream.Close()
|
return s.stream.Close()
|
||||||
}
|
}
|
||||||
@ -131,6 +150,5 @@ func RegisterTestServer(s server.Server, sh proto.TestServer, opts ...server.Han
|
|||||||
test
|
test
|
||||||
}
|
}
|
||||||
h := &testServer{sh}
|
h := &testServer{sh}
|
||||||
var nopts []server.HandlerOption
|
return s.Handle(s.NewHandler(&Test{h}, opts...))
|
||||||
return s.Handle(s.NewHandler(&Test{h}, append(nopts, opts...)...))
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.26.0
|
// protoc-gen-go v1.26.0
|
||||||
// protoc v5.28.3
|
// protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package helloworld
|
package helloworld
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-grpc v1.5.1
|
// - protoc-gen-go-grpc v1.5.1
|
||||||
// - protoc v5.28.3
|
// - protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package helloworld
|
package helloworld
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.26.0
|
// protoc-gen-go v1.26.0
|
||||||
// protoc v5.28.3
|
// protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-micro v3.10.4
|
// - protoc-gen-go-micro v3.10.4
|
||||||
// - protoc v5.28.3
|
// - protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
@ -76,9 +76,8 @@ func RegisterTestDoubleServer(s server.Server, sh TestDoubleServer, opts ...serv
|
|||||||
testDouble
|
testDouble
|
||||||
}
|
}
|
||||||
h := &testDoubleServer{sh}
|
h := &testDoubleServer{sh}
|
||||||
var nopts []server.HandlerOption
|
opts = append(opts, v3.HandlerEndpoints(TestDoubleServerEndpoints))
|
||||||
nopts = append(nopts, v3.HandlerEndpoints(TestDoubleServerEndpoints))
|
return s.Handle(s.NewHandler(&TestDouble{h}, opts...))
|
||||||
return s.Handle(s.NewHandler(&TestDouble{h}, append(nopts, opts...)...))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -235,8 +234,8 @@ func (h *testServer) Call(ctx context.Context, req *CallReq, rsp *CallRsp) error
|
|||||||
ctx, cancel = context.WithTimeout(ctx, td)
|
ctx, cancel = context.WithTimeout(ctx, td)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
v3.FillRequest(ctx, req,
|
v3.FillRequest(ctx, req,
|
||||||
v3.Header("Clientid", "true"),
|
|
||||||
v3.Cookie("Csrftoken", "true"),
|
v3.Cookie("Csrftoken", "true"),
|
||||||
|
v3.Header("Clientid", "true"),
|
||||||
)
|
)
|
||||||
return h.TestServer.Call(ctx, req, rsp)
|
return h.TestServer.Call(ctx, req, rsp)
|
||||||
}
|
}
|
||||||
@ -256,7 +255,6 @@ func RegisterTestServer(s server.Server, sh TestServer, opts ...server.HandlerOp
|
|||||||
test
|
test
|
||||||
}
|
}
|
||||||
h := &testServer{sh}
|
h := &testServer{sh}
|
||||||
var nopts []server.HandlerOption
|
opts = append(opts, v3.HandlerEndpoints(TestServerEndpoints))
|
||||||
nopts = append(nopts, v3.HandlerEndpoints(TestServerEndpoints))
|
return s.Handle(s.NewHandler(&Test{h}, opts...))
|
||||||
return s.Handle(s.NewHandler(&Test{h}, append(nopts, opts...)...))
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.26.0
|
// protoc-gen-go v1.26.0
|
||||||
// protoc v5.28.3
|
// protoc v5.29.2
|
||||||
// source: test.proto
|
// source: test.proto
|
||||||
|
|
||||||
package pb
|
package pb
|
||||||
|
Loading…
x
Reference in New Issue
Block a user