149 lines
4.4 KiB
Go
149 lines
4.4 KiB
Go
// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
|
|
// protoc-gen-go-drpc version: v0.0.32
|
|
// source: net/streampool/testservice/protos/testservice.proto
|
|
|
|
package testservice
|
|
|
|
import (
|
|
bytes "bytes"
|
|
context "context"
|
|
errors "errors"
|
|
jsonpb "github.com/gogo/protobuf/jsonpb"
|
|
proto "github.com/gogo/protobuf/proto"
|
|
drpc "storj.io/drpc"
|
|
drpcerr "storj.io/drpc/drpcerr"
|
|
)
|
|
|
|
type drpcEncoding_File_net_streampool_testservice_protos_testservice_proto struct{}
|
|
|
|
func (drpcEncoding_File_net_streampool_testservice_protos_testservice_proto) Marshal(msg drpc.Message) ([]byte, error) {
|
|
return proto.Marshal(msg.(proto.Message))
|
|
}
|
|
|
|
func (drpcEncoding_File_net_streampool_testservice_protos_testservice_proto) Unmarshal(buf []byte, msg drpc.Message) error {
|
|
return proto.Unmarshal(buf, msg.(proto.Message))
|
|
}
|
|
|
|
func (drpcEncoding_File_net_streampool_testservice_protos_testservice_proto) JSONMarshal(msg drpc.Message) ([]byte, error) {
|
|
var buf bytes.Buffer
|
|
err := new(jsonpb.Marshaler).Marshal(&buf, msg.(proto.Message))
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return buf.Bytes(), nil
|
|
}
|
|
|
|
func (drpcEncoding_File_net_streampool_testservice_protos_testservice_proto) JSONUnmarshal(buf []byte, msg drpc.Message) error {
|
|
return jsonpb.Unmarshal(bytes.NewReader(buf), msg.(proto.Message))
|
|
}
|
|
|
|
type DRPCTestClient interface {
|
|
DRPCConn() drpc.Conn
|
|
|
|
TestStream(ctx context.Context) (DRPCTest_TestStreamClient, error)
|
|
}
|
|
|
|
type drpcTestClient struct {
|
|
cc drpc.Conn
|
|
}
|
|
|
|
func NewDRPCTestClient(cc drpc.Conn) DRPCTestClient {
|
|
return &drpcTestClient{cc}
|
|
}
|
|
|
|
func (c *drpcTestClient) DRPCConn() drpc.Conn { return c.cc }
|
|
|
|
func (c *drpcTestClient) TestStream(ctx context.Context) (DRPCTest_TestStreamClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, "/testService.Test/TestStream", drpcEncoding_File_net_streampool_testservice_protos_testservice_proto{})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &drpcTest_TestStreamClient{stream}
|
|
return x, nil
|
|
}
|
|
|
|
type DRPCTest_TestStreamClient interface {
|
|
drpc.Stream
|
|
Send(*StreamMessage) error
|
|
Recv() (*StreamMessage, error)
|
|
}
|
|
|
|
type drpcTest_TestStreamClient struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcTest_TestStreamClient) Send(m *StreamMessage) error {
|
|
return x.MsgSend(m, drpcEncoding_File_net_streampool_testservice_protos_testservice_proto{})
|
|
}
|
|
|
|
func (x *drpcTest_TestStreamClient) Recv() (*StreamMessage, error) {
|
|
m := new(StreamMessage)
|
|
if err := x.MsgRecv(m, drpcEncoding_File_net_streampool_testservice_protos_testservice_proto{}); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (x *drpcTest_TestStreamClient) RecvMsg(m *StreamMessage) error {
|
|
return x.MsgRecv(m, drpcEncoding_File_net_streampool_testservice_protos_testservice_proto{})
|
|
}
|
|
|
|
type DRPCTestServer interface {
|
|
TestStream(DRPCTest_TestStreamStream) error
|
|
}
|
|
|
|
type DRPCTestUnimplementedServer struct{}
|
|
|
|
func (s *DRPCTestUnimplementedServer) TestStream(DRPCTest_TestStreamStream) error {
|
|
return drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
|
}
|
|
|
|
type DRPCTestDescription struct{}
|
|
|
|
func (DRPCTestDescription) NumMethods() int { return 1 }
|
|
|
|
func (DRPCTestDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
|
|
switch n {
|
|
case 0:
|
|
return "/testService.Test/TestStream", drpcEncoding_File_net_streampool_testservice_protos_testservice_proto{},
|
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
|
return nil, srv.(DRPCTestServer).
|
|
TestStream(
|
|
&drpcTest_TestStreamStream{in1.(drpc.Stream)},
|
|
)
|
|
}, DRPCTestServer.TestStream, true
|
|
default:
|
|
return "", nil, nil, nil, false
|
|
}
|
|
}
|
|
|
|
func DRPCRegisterTest(mux drpc.Mux, impl DRPCTestServer) error {
|
|
return mux.Register(impl, DRPCTestDescription{})
|
|
}
|
|
|
|
type DRPCTest_TestStreamStream interface {
|
|
drpc.Stream
|
|
Send(*StreamMessage) error
|
|
Recv() (*StreamMessage, error)
|
|
}
|
|
|
|
type drpcTest_TestStreamStream struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcTest_TestStreamStream) Send(m *StreamMessage) error {
|
|
return x.MsgSend(m, drpcEncoding_File_net_streampool_testservice_protos_testservice_proto{})
|
|
}
|
|
|
|
func (x *drpcTest_TestStreamStream) Recv() (*StreamMessage, error) {
|
|
m := new(StreamMessage)
|
|
if err := x.MsgRecv(m, drpcEncoding_File_net_streampool_testservice_protos_testservice_proto{}); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (x *drpcTest_TestStreamStream) RecvMsg(m *StreamMessage) error {
|
|
return x.MsgRecv(m, drpcEncoding_File_net_streampool_testservice_protos_testservice_proto{})
|
|
}
|