storj/satellite/internalpb/delegated_repair_drpc.pb.go

116 lines
3.4 KiB
Go
Raw Normal View History

// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
// protoc-gen-go-drpc version: v0.0.33
// source: delegated_repair.proto
package internalpb
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_delegated_repair_proto struct{}
func (drpcEncoding_File_delegated_repair_proto) Marshal(msg drpc.Message) ([]byte, error) {
return proto.Marshal(msg.(proto.Message))
}
func (drpcEncoding_File_delegated_repair_proto) Unmarshal(buf []byte, msg drpc.Message) error {
return proto.Unmarshal(buf, msg.(proto.Message))
}
func (drpcEncoding_File_delegated_repair_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_delegated_repair_proto) JSONUnmarshal(buf []byte, msg drpc.Message) error {
return jsonpb.Unmarshal(bytes.NewReader(buf), msg.(proto.Message))
}
type DRPCRepairCoordinatorClient interface {
DRPCConn() drpc.Conn
RepairJob(ctx context.Context, in *RepairJobRequest) (*RepairJobResponse, error)
}
type drpcRepairCoordinatorClient struct {
cc drpc.Conn
}
func NewDRPCRepairCoordinatorClient(cc drpc.Conn) DRPCRepairCoordinatorClient {
return &drpcRepairCoordinatorClient{cc}
}
func (c *drpcRepairCoordinatorClient) DRPCConn() drpc.Conn { return c.cc }
func (c *drpcRepairCoordinatorClient) RepairJob(ctx context.Context, in *RepairJobRequest) (*RepairJobResponse, error) {
out := new(RepairJobResponse)
err := c.cc.Invoke(ctx, "/satellite.delegated_repair.RepairCoordinator/RepairJob", drpcEncoding_File_delegated_repair_proto{}, in, out)
if err != nil {
return nil, err
}
return out, nil
}
type DRPCRepairCoordinatorServer interface {
RepairJob(context.Context, *RepairJobRequest) (*RepairJobResponse, error)
}
type DRPCRepairCoordinatorUnimplementedServer struct{}
func (s *DRPCRepairCoordinatorUnimplementedServer) RepairJob(context.Context, *RepairJobRequest) (*RepairJobResponse, error) {
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
}
type DRPCRepairCoordinatorDescription struct{}
func (DRPCRepairCoordinatorDescription) NumMethods() int { return 1 }
func (DRPCRepairCoordinatorDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
switch n {
case 0:
return "/satellite.delegated_repair.RepairCoordinator/RepairJob", drpcEncoding_File_delegated_repair_proto{},
func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCRepairCoordinatorServer).
RepairJob(
ctx,
in1.(*RepairJobRequest),
)
}, DRPCRepairCoordinatorServer.RepairJob, true
default:
return "", nil, nil, nil, false
}
}
func DRPCRegisterRepairCoordinator(mux drpc.Mux, impl DRPCRepairCoordinatorServer) error {
return mux.Register(impl, DRPCRepairCoordinatorDescription{})
}
type DRPCRepairCoordinator_RepairJobStream interface {
drpc.Stream
SendAndClose(*RepairJobResponse) error
}
type drpcRepairCoordinator_RepairJobStream struct {
drpc.Stream
}
func (x *drpcRepairCoordinator_RepairJobStream) SendAndClose(m *RepairJobResponse) error {
if err := x.MsgSend(m, drpcEncoding_File_delegated_repair_proto{}); err != nil {
return err
}
return x.CloseSend()
}