mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-07 21:47:02 +09:00
220 lines
7.3 KiB
Go
220 lines
7.3 KiB
Go
// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
|
|
// protoc-gen-go-drpc version: v0.0.34
|
|
// source: commonspace/sync/synctestproto/protos/synctest.proto
|
|
|
|
package synctestproto
|
|
|
|
import (
|
|
bytes "bytes"
|
|
context "context"
|
|
errors "errors"
|
|
jsonpb "github.com/anyproto/protobuf/jsonpb"
|
|
proto "github.com/anyproto/protobuf/proto"
|
|
drpc "storj.io/drpc"
|
|
drpcerr "storj.io/drpc/drpcerr"
|
|
)
|
|
|
|
type drpcEncoding_File_commonspace_sync_synctestproto_protos_synctest_proto struct{}
|
|
|
|
func (drpcEncoding_File_commonspace_sync_synctestproto_protos_synctest_proto) Marshal(msg drpc.Message) ([]byte, error) {
|
|
return proto.Marshal(msg.(proto.Message))
|
|
}
|
|
|
|
func (drpcEncoding_File_commonspace_sync_synctestproto_protos_synctest_proto) Unmarshal(buf []byte, msg drpc.Message) error {
|
|
return proto.Unmarshal(buf, msg.(proto.Message))
|
|
}
|
|
|
|
func (drpcEncoding_File_commonspace_sync_synctestproto_protos_synctest_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_commonspace_sync_synctestproto_protos_synctest_proto) JSONUnmarshal(buf []byte, msg drpc.Message) error {
|
|
return jsonpb.Unmarshal(bytes.NewReader(buf), msg.(proto.Message))
|
|
}
|
|
|
|
type DRPCCounterSyncClient interface {
|
|
DRPCConn() drpc.Conn
|
|
|
|
CounterStreamRequest(ctx context.Context, in *CounterRequest) (DRPCCounterSync_CounterStreamRequestClient, error)
|
|
CounterStream(ctx context.Context) (DRPCCounterSync_CounterStreamClient, error)
|
|
}
|
|
|
|
type drpcCounterSyncClient struct {
|
|
cc drpc.Conn
|
|
}
|
|
|
|
func NewDRPCCounterSyncClient(cc drpc.Conn) DRPCCounterSyncClient {
|
|
return &drpcCounterSyncClient{cc}
|
|
}
|
|
|
|
func (c *drpcCounterSyncClient) DRPCConn() drpc.Conn { return c.cc }
|
|
|
|
func (c *drpcCounterSyncClient) CounterStreamRequest(ctx context.Context, in *CounterRequest) (DRPCCounterSync_CounterStreamRequestClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, "/synctest.CounterSync/CounterStreamRequest", drpcEncoding_File_commonspace_sync_synctestproto_protos_synctest_proto{})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &drpcCounterSync_CounterStreamRequestClient{stream}
|
|
if err := x.MsgSend(in, drpcEncoding_File_commonspace_sync_synctestproto_protos_synctest_proto{}); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
type DRPCCounterSync_CounterStreamRequestClient interface {
|
|
drpc.Stream
|
|
Recv() (*CounterIncrease, error)
|
|
}
|
|
|
|
type drpcCounterSync_CounterStreamRequestClient struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcCounterSync_CounterStreamRequestClient) GetStream() drpc.Stream {
|
|
return x.Stream
|
|
}
|
|
|
|
func (x *drpcCounterSync_CounterStreamRequestClient) Recv() (*CounterIncrease, error) {
|
|
m := new(CounterIncrease)
|
|
if err := x.MsgRecv(m, drpcEncoding_File_commonspace_sync_synctestproto_protos_synctest_proto{}); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (x *drpcCounterSync_CounterStreamRequestClient) RecvMsg(m *CounterIncrease) error {
|
|
return x.MsgRecv(m, drpcEncoding_File_commonspace_sync_synctestproto_protos_synctest_proto{})
|
|
}
|
|
|
|
func (c *drpcCounterSyncClient) CounterStream(ctx context.Context) (DRPCCounterSync_CounterStreamClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, "/synctest.CounterSync/CounterStream", drpcEncoding_File_commonspace_sync_synctestproto_protos_synctest_proto{})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &drpcCounterSync_CounterStreamClient{stream}
|
|
return x, nil
|
|
}
|
|
|
|
type DRPCCounterSync_CounterStreamClient interface {
|
|
drpc.Stream
|
|
Send(*CounterIncrease) error
|
|
Recv() (*CounterIncrease, error)
|
|
}
|
|
|
|
type drpcCounterSync_CounterStreamClient struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcCounterSync_CounterStreamClient) GetStream() drpc.Stream {
|
|
return x.Stream
|
|
}
|
|
|
|
func (x *drpcCounterSync_CounterStreamClient) Send(m *CounterIncrease) error {
|
|
return x.MsgSend(m, drpcEncoding_File_commonspace_sync_synctestproto_protos_synctest_proto{})
|
|
}
|
|
|
|
func (x *drpcCounterSync_CounterStreamClient) Recv() (*CounterIncrease, error) {
|
|
m := new(CounterIncrease)
|
|
if err := x.MsgRecv(m, drpcEncoding_File_commonspace_sync_synctestproto_protos_synctest_proto{}); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (x *drpcCounterSync_CounterStreamClient) RecvMsg(m *CounterIncrease) error {
|
|
return x.MsgRecv(m, drpcEncoding_File_commonspace_sync_synctestproto_protos_synctest_proto{})
|
|
}
|
|
|
|
type DRPCCounterSyncServer interface {
|
|
CounterStreamRequest(*CounterRequest, DRPCCounterSync_CounterStreamRequestStream) error
|
|
CounterStream(DRPCCounterSync_CounterStreamStream) error
|
|
}
|
|
|
|
type DRPCCounterSyncUnimplementedServer struct{}
|
|
|
|
func (s *DRPCCounterSyncUnimplementedServer) CounterStreamRequest(*CounterRequest, DRPCCounterSync_CounterStreamRequestStream) error {
|
|
return drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
|
}
|
|
|
|
func (s *DRPCCounterSyncUnimplementedServer) CounterStream(DRPCCounterSync_CounterStreamStream) error {
|
|
return drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
|
}
|
|
|
|
type DRPCCounterSyncDescription struct{}
|
|
|
|
func (DRPCCounterSyncDescription) NumMethods() int { return 2 }
|
|
|
|
func (DRPCCounterSyncDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
|
|
switch n {
|
|
case 0:
|
|
return "/synctest.CounterSync/CounterStreamRequest", drpcEncoding_File_commonspace_sync_synctestproto_protos_synctest_proto{},
|
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
|
return nil, srv.(DRPCCounterSyncServer).
|
|
CounterStreamRequest(
|
|
in1.(*CounterRequest),
|
|
&drpcCounterSync_CounterStreamRequestStream{in2.(drpc.Stream)},
|
|
)
|
|
}, DRPCCounterSyncServer.CounterStreamRequest, true
|
|
case 1:
|
|
return "/synctest.CounterSync/CounterStream", drpcEncoding_File_commonspace_sync_synctestproto_protos_synctest_proto{},
|
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
|
return nil, srv.(DRPCCounterSyncServer).
|
|
CounterStream(
|
|
&drpcCounterSync_CounterStreamStream{in1.(drpc.Stream)},
|
|
)
|
|
}, DRPCCounterSyncServer.CounterStream, true
|
|
default:
|
|
return "", nil, nil, nil, false
|
|
}
|
|
}
|
|
|
|
func DRPCRegisterCounterSync(mux drpc.Mux, impl DRPCCounterSyncServer) error {
|
|
return mux.Register(impl, DRPCCounterSyncDescription{})
|
|
}
|
|
|
|
type DRPCCounterSync_CounterStreamRequestStream interface {
|
|
drpc.Stream
|
|
Send(*CounterIncrease) error
|
|
}
|
|
|
|
type drpcCounterSync_CounterStreamRequestStream struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcCounterSync_CounterStreamRequestStream) Send(m *CounterIncrease) error {
|
|
return x.MsgSend(m, drpcEncoding_File_commonspace_sync_synctestproto_protos_synctest_proto{})
|
|
}
|
|
|
|
type DRPCCounterSync_CounterStreamStream interface {
|
|
drpc.Stream
|
|
Send(*CounterIncrease) error
|
|
Recv() (*CounterIncrease, error)
|
|
}
|
|
|
|
type drpcCounterSync_CounterStreamStream struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcCounterSync_CounterStreamStream) Send(m *CounterIncrease) error {
|
|
return x.MsgSend(m, drpcEncoding_File_commonspace_sync_synctestproto_protos_synctest_proto{})
|
|
}
|
|
|
|
func (x *drpcCounterSync_CounterStreamStream) Recv() (*CounterIncrease, error) {
|
|
m := new(CounterIncrease)
|
|
if err := x.MsgRecv(m, drpcEncoding_File_commonspace_sync_synctestproto_protos_synctest_proto{}); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (x *drpcCounterSync_CounterStreamStream) RecvMsg(m *CounterIncrease) error {
|
|
return x.MsgRecv(m, drpcEncoding_File_commonspace_sync_synctestproto_protos_synctest_proto{})
|
|
}
|