any-sync/syncproto/service_drpc.pb.go
Sergey Cherepanov 15af9eec36
drpc experiment
2022-07-14 16:59:01 +03:00

147 lines
4.2 KiB
Go

// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
// protoc-gen-go-drpc version: v0.0.32
// source: syncproto/proto/service.proto
package syncproto
import (
context "context"
errors "errors"
protojson "google.golang.org/protobuf/encoding/protojson"
proto "google.golang.org/protobuf/proto"
drpc "storj.io/drpc"
drpcerr "storj.io/drpc/drpcerr"
)
type drpcEncoding_File_syncproto_proto_service_proto struct{}
func (drpcEncoding_File_syncproto_proto_service_proto) Marshal(msg drpc.Message) ([]byte, error) {
return proto.Marshal(msg.(proto.Message))
}
func (drpcEncoding_File_syncproto_proto_service_proto) MarshalAppend(buf []byte, msg drpc.Message) ([]byte, error) {
return proto.MarshalOptions{}.MarshalAppend(buf, msg.(proto.Message))
}
func (drpcEncoding_File_syncproto_proto_service_proto) Unmarshal(buf []byte, msg drpc.Message) error {
return proto.Unmarshal(buf, msg.(proto.Message))
}
func (drpcEncoding_File_syncproto_proto_service_proto) JSONMarshal(msg drpc.Message) ([]byte, error) {
return protojson.Marshal(msg.(proto.Message))
}
func (drpcEncoding_File_syncproto_proto_service_proto) JSONUnmarshal(buf []byte, msg drpc.Message) error {
return protojson.Unmarshal(buf, msg.(proto.Message))
}
type DRPCAnytypeSyncClient interface {
DRPCConn() drpc.Conn
Ping(ctx context.Context) (DRPCAnytypeSync_PingClient, error)
}
type drpcAnytypeSyncClient struct {
cc drpc.Conn
}
func NewDRPCAnytypeSyncClient(cc drpc.Conn) DRPCAnytypeSyncClient {
return &drpcAnytypeSyncClient{cc}
}
func (c *drpcAnytypeSyncClient) DRPCConn() drpc.Conn { return c.cc }
func (c *drpcAnytypeSyncClient) Ping(ctx context.Context) (DRPCAnytypeSync_PingClient, error) {
stream, err := c.cc.NewStream(ctx, "/anytype.AnytypeSync/Ping", drpcEncoding_File_syncproto_proto_service_proto{})
if err != nil {
return nil, err
}
x := &drpcAnytypeSync_PingClient{stream}
return x, nil
}
type DRPCAnytypeSync_PingClient interface {
drpc.Stream
Send(*PingRequest) error
Recv() (*PingResponse, error)
}
type drpcAnytypeSync_PingClient struct {
drpc.Stream
}
func (x *drpcAnytypeSync_PingClient) Send(m *PingRequest) error {
return x.MsgSend(m, drpcEncoding_File_syncproto_proto_service_proto{})
}
func (x *drpcAnytypeSync_PingClient) Recv() (*PingResponse, error) {
m := new(PingResponse)
if err := x.MsgRecv(m, drpcEncoding_File_syncproto_proto_service_proto{}); err != nil {
return nil, err
}
return m, nil
}
func (x *drpcAnytypeSync_PingClient) RecvMsg(m *PingResponse) error {
return x.MsgRecv(m, drpcEncoding_File_syncproto_proto_service_proto{})
}
type DRPCAnytypeSyncServer interface {
Ping(DRPCAnytypeSync_PingStream) error
}
type DRPCAnytypeSyncUnimplementedServer struct{}
func (s *DRPCAnytypeSyncUnimplementedServer) Ping(DRPCAnytypeSync_PingStream) error {
return drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
}
type DRPCAnytypeSyncDescription struct{}
func (DRPCAnytypeSyncDescription) NumMethods() int { return 1 }
func (DRPCAnytypeSyncDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/anytype.AnytypeSync/Ping", drpcEncoding_File_syncproto_proto_service_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return nil, srv.(DRPCAnytypeSyncServer).
Ping(
&drpcAnytypeSync_PingStream{in1.(drpc.Stream)},
)
}, DRPCAnytypeSyncServer.Ping, true
default:
return "", nil, nil, nil, false
}
}
func DRPCRegisterAnytypeSync(mux drpc.Mux, impl DRPCAnytypeSyncServer) error {
return mux.Register(impl, DRPCAnytypeSyncDescription{})
}
type DRPCAnytypeSync_PingStream interface {
drpc.Stream
Send(*PingResponse) error
Recv() (*PingRequest, error)
}
type drpcAnytypeSync_PingStream struct {
drpc.Stream
}
func (x *drpcAnytypeSync_PingStream) Send(m *PingResponse) error {
return x.MsgSend(m, drpcEncoding_File_syncproto_proto_service_proto{})
}
func (x *drpcAnytypeSync_PingStream) Recv() (*PingRequest, error) {
m := new(PingRequest)
if err := x.MsgRecv(m, drpcEncoding_File_syncproto_proto_service_proto{}); err != nil {
return nil, err
}
return m, nil
}
func (x *drpcAnytypeSync_PingStream) RecvMsg(m *PingRequest) error {
return x.MsgRecv(m, drpcEncoding_File_syncproto_proto_service_proto{})
}