// Code generated by protoc-gen-go-drpc. DO NOT EDIT.
// protoc-gen-go-drpc version: v0.0.35-0.20250513201419-f7819ea69b55
// source: nodetags.proto

package pb

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_nodetags_proto struct{}

func (drpcEncoding_File_nodetags_proto) Marshal(msg drpc.Message) ([]byte, error) {
	return proto.Marshal(msg.(proto.Message))
}

func (drpcEncoding_File_nodetags_proto) Unmarshal(buf []byte, msg drpc.Message) error {
	return proto.Unmarshal(buf, msg.(proto.Message))
}

func (drpcEncoding_File_nodetags_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_nodetags_proto) JSONUnmarshal(buf []byte, msg drpc.Message) error {
	return jsonpb.Unmarshal(bytes.NewReader(buf), msg.(proto.Message))
}

type DRPCTagSignerClient interface {
	DRPCConn() drpc.Conn

	SignTags(ctx context.Context, in *SignTagsRequest) (*SignTagsResponse, error)
}

type drpcTagSignerClient struct {
	cc drpc.Conn
}

func NewDRPCTagSignerClient(cc drpc.Conn) DRPCTagSignerClient {
	return &drpcTagSignerClient{cc}
}

func (c *drpcTagSignerClient) DRPCConn() drpc.Conn { return c.cc }

func (c *drpcTagSignerClient) SignTags(ctx context.Context, in *SignTagsRequest) (*SignTagsResponse, error) {
	out := new(SignTagsResponse)
	err := c.cc.Invoke(ctx, "/node.TagSigner/SignTags", drpcEncoding_File_nodetags_proto{}, in, out)
	if err != nil {
		return nil, err
	}
	return out, nil
}

type DRPCTagSignerServer interface {
	SignTags(context.Context, *SignTagsRequest) (*SignTagsResponse, error)
}

type DRPCTagSignerUnimplementedServer struct{}

func (s *DRPCTagSignerUnimplementedServer) SignTags(context.Context, *SignTagsRequest) (*SignTagsResponse, error) {
	return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented)
}

type DRPCTagSignerDescription struct{}

func (DRPCTagSignerDescription) NumMethods() int { return 1 }

func (DRPCTagSignerDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) {
	switch n {
	case 0:
		return "/node.TagSigner/SignTags", drpcEncoding_File_nodetags_proto{},
			func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
				return srv.(DRPCTagSignerServer).
					SignTags(
						ctx,
						in1.(*SignTagsRequest),
					)
			}, DRPCTagSignerServer.SignTags, true
	default:
		return "", nil, nil, nil, false
	}
}

func DRPCRegisterTagSigner(mux drpc.Mux, impl DRPCTagSignerServer) error {
	return mux.Register(impl, DRPCTagSignerDescription{})
}

type DRPCTagSigner_SignTagsStream interface {
	drpc.Stream
	SendAndClose(*SignTagsResponse) error
}

type drpcTagSigner_SignTagsStream struct {
	drpc.Stream
}

func (x *drpcTagSigner_SignTagsStream) GetStream() drpc.Stream {
	return x.Stream
}

func (x *drpcTagSigner_SignTagsStream) SendAndClose(m *SignTagsResponse) error {
	if err := x.MsgSend(m, drpcEncoding_File_nodetags_proto{}); err != nil {
		return err
	}
	return x.CloseSend()
}
