mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-07 21:47:02 +09:00
268 lines
8.2 KiB
Go
268 lines
8.2 KiB
Go
// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
|
|
// protoc-gen-go-drpc version: v0.0.32
|
|
// source: commonfile/fileproto/protos/file.proto
|
|
|
|
package fileproto
|
|
|
|
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_commonfile_fileproto_protos_file_proto struct{}
|
|
|
|
func (drpcEncoding_File_commonfile_fileproto_protos_file_proto) Marshal(msg drpc.Message) ([]byte, error) {
|
|
return proto.Marshal(msg.(proto.Message))
|
|
}
|
|
|
|
func (drpcEncoding_File_commonfile_fileproto_protos_file_proto) Unmarshal(buf []byte, msg drpc.Message) error {
|
|
return proto.Unmarshal(buf, msg.(proto.Message))
|
|
}
|
|
|
|
func (drpcEncoding_File_commonfile_fileproto_protos_file_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_commonfile_fileproto_protos_file_proto) JSONUnmarshal(buf []byte, msg drpc.Message) error {
|
|
return jsonpb.Unmarshal(bytes.NewReader(buf), msg.(proto.Message))
|
|
}
|
|
|
|
type DRPCFileClient interface {
|
|
DRPCConn() drpc.Conn
|
|
|
|
GetBlocks(ctx context.Context) (DRPCFile_GetBlocksClient, error)
|
|
PushBlock(ctx context.Context, in *PushBlockRequest) (*PushBlockResponse, error)
|
|
DeleteBlocks(ctx context.Context, in *DeleteBlocksRequest) (*DeleteBlocksResponse, error)
|
|
Check(ctx context.Context, in *CheckRequest) (*CheckResponse, error)
|
|
}
|
|
|
|
type drpcFileClient struct {
|
|
cc drpc.Conn
|
|
}
|
|
|
|
func NewDRPCFileClient(cc drpc.Conn) DRPCFileClient {
|
|
return &drpcFileClient{cc}
|
|
}
|
|
|
|
func (c *drpcFileClient) DRPCConn() drpc.Conn { return c.cc }
|
|
|
|
func (c *drpcFileClient) GetBlocks(ctx context.Context) (DRPCFile_GetBlocksClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, "/anyFile.File/GetBlocks", drpcEncoding_File_commonfile_fileproto_protos_file_proto{})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &drpcFile_GetBlocksClient{stream}
|
|
return x, nil
|
|
}
|
|
|
|
type DRPCFile_GetBlocksClient interface {
|
|
drpc.Stream
|
|
Send(*GetBlockRequest) error
|
|
Recv() (*GetBlockResponse, error)
|
|
}
|
|
|
|
type drpcFile_GetBlocksClient struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcFile_GetBlocksClient) Send(m *GetBlockRequest) error {
|
|
return x.MsgSend(m, drpcEncoding_File_commonfile_fileproto_protos_file_proto{})
|
|
}
|
|
|
|
func (x *drpcFile_GetBlocksClient) Recv() (*GetBlockResponse, error) {
|
|
m := new(GetBlockResponse)
|
|
if err := x.MsgRecv(m, drpcEncoding_File_commonfile_fileproto_protos_file_proto{}); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (x *drpcFile_GetBlocksClient) RecvMsg(m *GetBlockResponse) error {
|
|
return x.MsgRecv(m, drpcEncoding_File_commonfile_fileproto_protos_file_proto{})
|
|
}
|
|
|
|
func (c *drpcFileClient) PushBlock(ctx context.Context, in *PushBlockRequest) (*PushBlockResponse, error) {
|
|
out := new(PushBlockResponse)
|
|
err := c.cc.Invoke(ctx, "/anyFile.File/PushBlock", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, in, out)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *drpcFileClient) DeleteBlocks(ctx context.Context, in *DeleteBlocksRequest) (*DeleteBlocksResponse, error) {
|
|
out := new(DeleteBlocksResponse)
|
|
err := c.cc.Invoke(ctx, "/anyFile.File/DeleteBlocks", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, in, out)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *drpcFileClient) Check(ctx context.Context, in *CheckRequest) (*CheckResponse, error) {
|
|
out := new(CheckResponse)
|
|
err := c.cc.Invoke(ctx, "/anyFile.File/Check", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, in, out)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
type DRPCFileServer interface {
|
|
GetBlocks(DRPCFile_GetBlocksStream) error
|
|
PushBlock(context.Context, *PushBlockRequest) (*PushBlockResponse, error)
|
|
DeleteBlocks(context.Context, *DeleteBlocksRequest) (*DeleteBlocksResponse, error)
|
|
Check(context.Context, *CheckRequest) (*CheckResponse, error)
|
|
}
|
|
|
|
type DRPCFileUnimplementedServer struct{}
|
|
|
|
func (s *DRPCFileUnimplementedServer) GetBlocks(DRPCFile_GetBlocksStream) error {
|
|
return drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
|
}
|
|
|
|
func (s *DRPCFileUnimplementedServer) PushBlock(context.Context, *PushBlockRequest) (*PushBlockResponse, error) {
|
|
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
|
}
|
|
|
|
func (s *DRPCFileUnimplementedServer) DeleteBlocks(context.Context, *DeleteBlocksRequest) (*DeleteBlocksResponse, error) {
|
|
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
|
}
|
|
|
|
func (s *DRPCFileUnimplementedServer) Check(context.Context, *CheckRequest) (*CheckResponse, error) {
|
|
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
|
|
}
|
|
|
|
type DRPCFileDescription struct{}
|
|
|
|
func (DRPCFileDescription) NumMethods() int { return 4 }
|
|
|
|
func (DRPCFileDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
|
|
switch n {
|
|
case 0:
|
|
return "/anyFile.File/GetBlocks", drpcEncoding_File_commonfile_fileproto_protos_file_proto{},
|
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
|
return nil, srv.(DRPCFileServer).
|
|
GetBlocks(
|
|
&drpcFile_GetBlocksStream{in1.(drpc.Stream)},
|
|
)
|
|
}, DRPCFileServer.GetBlocks, true
|
|
case 1:
|
|
return "/anyFile.File/PushBlock", drpcEncoding_File_commonfile_fileproto_protos_file_proto{},
|
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
|
return srv.(DRPCFileServer).
|
|
PushBlock(
|
|
ctx,
|
|
in1.(*PushBlockRequest),
|
|
)
|
|
}, DRPCFileServer.PushBlock, true
|
|
case 2:
|
|
return "/anyFile.File/DeleteBlocks", drpcEncoding_File_commonfile_fileproto_protos_file_proto{},
|
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
|
return srv.(DRPCFileServer).
|
|
DeleteBlocks(
|
|
ctx,
|
|
in1.(*DeleteBlocksRequest),
|
|
)
|
|
}, DRPCFileServer.DeleteBlocks, true
|
|
case 3:
|
|
return "/anyFile.File/Check", drpcEncoding_File_commonfile_fileproto_protos_file_proto{},
|
|
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
|
|
return srv.(DRPCFileServer).
|
|
Check(
|
|
ctx,
|
|
in1.(*CheckRequest),
|
|
)
|
|
}, DRPCFileServer.Check, true
|
|
default:
|
|
return "", nil, nil, nil, false
|
|
}
|
|
}
|
|
|
|
func DRPCRegisterFile(mux drpc.Mux, impl DRPCFileServer) error {
|
|
return mux.Register(impl, DRPCFileDescription{})
|
|
}
|
|
|
|
type DRPCFile_GetBlocksStream interface {
|
|
drpc.Stream
|
|
Send(*GetBlockResponse) error
|
|
Recv() (*GetBlockRequest, error)
|
|
}
|
|
|
|
type drpcFile_GetBlocksStream struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcFile_GetBlocksStream) Send(m *GetBlockResponse) error {
|
|
return x.MsgSend(m, drpcEncoding_File_commonfile_fileproto_protos_file_proto{})
|
|
}
|
|
|
|
func (x *drpcFile_GetBlocksStream) Recv() (*GetBlockRequest, error) {
|
|
m := new(GetBlockRequest)
|
|
if err := x.MsgRecv(m, drpcEncoding_File_commonfile_fileproto_protos_file_proto{}); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (x *drpcFile_GetBlocksStream) RecvMsg(m *GetBlockRequest) error {
|
|
return x.MsgRecv(m, drpcEncoding_File_commonfile_fileproto_protos_file_proto{})
|
|
}
|
|
|
|
type DRPCFile_PushBlockStream interface {
|
|
drpc.Stream
|
|
SendAndClose(*PushBlockResponse) error
|
|
}
|
|
|
|
type drpcFile_PushBlockStream struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcFile_PushBlockStream) SendAndClose(m *PushBlockResponse) error {
|
|
if err := x.MsgSend(m, drpcEncoding_File_commonfile_fileproto_protos_file_proto{}); err != nil {
|
|
return err
|
|
}
|
|
return x.CloseSend()
|
|
}
|
|
|
|
type DRPCFile_DeleteBlocksStream interface {
|
|
drpc.Stream
|
|
SendAndClose(*DeleteBlocksResponse) error
|
|
}
|
|
|
|
type drpcFile_DeleteBlocksStream struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcFile_DeleteBlocksStream) SendAndClose(m *DeleteBlocksResponse) error {
|
|
if err := x.MsgSend(m, drpcEncoding_File_commonfile_fileproto_protos_file_proto{}); err != nil {
|
|
return err
|
|
}
|
|
return x.CloseSend()
|
|
}
|
|
|
|
type DRPCFile_CheckStream interface {
|
|
drpc.Stream
|
|
SendAndClose(*CheckResponse) error
|
|
}
|
|
|
|
type drpcFile_CheckStream struct {
|
|
drpc.Stream
|
|
}
|
|
|
|
func (x *drpcFile_CheckStream) SendAndClose(m *CheckResponse) error {
|
|
if err := x.MsgSend(m, drpcEncoding_File_commonfile_fileproto_protos_file_proto{}); err != nil {
|
|
return err
|
|
}
|
|
return x.CloseSend()
|
|
}
|