2022-03-21 13:08:38 +03:00
|
|
|
// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
|
2023-01-07 19:16:48 +03:00
|
|
|
// protoc-gen-go-drpc version: v0.0.32
|
2022-03-21 13:08:38 +03:00
|
|
|
// source: test.proto
|
|
|
|
|
|
|
|
package pb
|
|
|
|
|
|
|
|
import (
|
|
|
|
context "context"
|
|
|
|
errors "errors"
|
|
|
|
proto "google.golang.org/protobuf/proto"
|
|
|
|
drpc "storj.io/drpc"
|
|
|
|
drpcerr "storj.io/drpc/drpcerr"
|
|
|
|
)
|
|
|
|
|
|
|
|
type drpcEncoding_File_test_proto struct{}
|
|
|
|
|
|
|
|
func (drpcEncoding_File_test_proto) Marshal(msg drpc.Message) ([]byte, error) {
|
|
|
|
return proto.Marshal(msg.(proto.Message))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (drpcEncoding_File_test_proto) MarshalAppend(buf []byte, msg drpc.Message) ([]byte, error) {
|
|
|
|
return proto.MarshalOptions{}.MarshalAppend(buf, msg.(proto.Message))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (drpcEncoding_File_test_proto) Unmarshal(buf []byte, msg drpc.Message) error {
|
|
|
|
return proto.Unmarshal(buf, msg.(proto.Message))
|
|
|
|
}
|
|
|
|
|
|
|
|
type DRPCTestClient interface {
|
|
|
|
DRPCConn() drpc.Conn
|
|
|
|
|
2023-01-07 19:16:48 +03:00
|
|
|
Call(ctx context.Context, in *CallReq) (*CallRsp, error)
|
2022-03-21 13:08:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type drpcTestClient struct {
|
|
|
|
cc drpc.Conn
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewDRPCTestClient(cc drpc.Conn) DRPCTestClient {
|
|
|
|
return &drpcTestClient{cc}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *drpcTestClient) DRPCConn() drpc.Conn { return c.cc }
|
|
|
|
|
2023-01-07 19:16:48 +03:00
|
|
|
func (c *drpcTestClient) Call(ctx context.Context, in *CallReq) (*CallRsp, error) {
|
|
|
|
out := new(CallRsp)
|
2022-03-21 13:08:38 +03:00
|
|
|
err := c.cc.Invoke(ctx, "/test.v1.Test/Call", drpcEncoding_File_test_proto{}, in, out)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return out, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type DRPCTestServer interface {
|
2023-01-07 19:16:48 +03:00
|
|
|
Call(context.Context, *CallReq) (*CallRsp, error)
|
2022-03-21 13:08:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type DRPCTestUnimplementedServer struct{}
|
|
|
|
|
2023-01-07 19:16:48 +03:00
|
|
|
func (s *DRPCTestUnimplementedServer) Call(context.Context, *CallReq) (*CallRsp, error) {
|
2022-03-21 13:08:38 +03:00
|
|
|
return nil, 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 "/test.v1.Test/Call", drpcEncoding_File_test_proto{},
|
|
|
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
|
|
|
return srv.(DRPCTestServer).
|
|
|
|
Call(
|
|
|
|
ctx,
|
2023-01-07 19:16:48 +03:00
|
|
|
in1.(*CallReq),
|
2022-03-21 13:08:38 +03:00
|
|
|
)
|
|
|
|
}, DRPCTestServer.Call, true
|
|
|
|
default:
|
|
|
|
return "", nil, nil, nil, false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func DRPCRegisterTest(mux drpc.Mux, impl DRPCTestServer) error {
|
|
|
|
return mux.Register(impl, DRPCTestDescription{})
|
|
|
|
}
|
|
|
|
|
|
|
|
type DRPCTest_CallStream interface {
|
|
|
|
drpc.Stream
|
2023-01-07 19:16:48 +03:00
|
|
|
SendAndClose(*CallRsp) error
|
2022-03-21 13:08:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type drpcTest_CallStream struct {
|
|
|
|
drpc.Stream
|
|
|
|
}
|
|
|
|
|
2023-01-07 19:16:48 +03:00
|
|
|
func (x *drpcTest_CallStream) SendAndClose(m *CallRsp) error {
|
2022-03-21 13:08:38 +03:00
|
|
|
if err := x.MsgSend(m, drpcEncoding_File_test_proto{}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
return x.CloseSend()
|
|
|
|
}
|