// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v3.12.4
// source: dice.proto

package dice

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// RollServiceClient is the client API for RollService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type RollServiceClient interface {
	Roll(ctx context.Context, in *RollRequest, opts ...grpc.CallOption) (*RollResponse, error)
	GetRolls(ctx context.Context, in *GetRollsRequest, opts ...grpc.CallOption) (RollService_GetRollsClient, error)
}

type rollServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewRollServiceClient(cc grpc.ClientConnInterface) RollServiceClient {
	return &rollServiceClient{cc}
}

func (c *rollServiceClient) Roll(ctx context.Context, in *RollRequest, opts ...grpc.CallOption) (*RollResponse, error) {
	out := new(RollResponse)
	err := c.cc.Invoke(ctx, "/RollService/Roll", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *rollServiceClient) GetRolls(ctx context.Context, in *GetRollsRequest, opts ...grpc.CallOption) (RollService_GetRollsClient, error) {
	stream, err := c.cc.NewStream(ctx, &RollService_ServiceDesc.Streams[0], "/RollService/GetRolls", opts...)
	if err != nil {
		return nil, err
	}
	x := &rollServiceGetRollsClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type RollService_GetRollsClient interface {
	Recv() (*RollTable, error)
	grpc.ClientStream
}

type rollServiceGetRollsClient struct {
	grpc.ClientStream
}

func (x *rollServiceGetRollsClient) Recv() (*RollTable, error) {
	m := new(RollTable)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// RollServiceServer is the server API for RollService service.
// All implementations must embed UnimplementedRollServiceServer
// for forward compatibility
type RollServiceServer interface {
	Roll(context.Context, *RollRequest) (*RollResponse, error)
	GetRolls(*GetRollsRequest, RollService_GetRollsServer) error
	mustEmbedUnimplementedRollServiceServer()
}

// UnimplementedRollServiceServer must be embedded to have forward compatible implementations.
type UnimplementedRollServiceServer struct {
}

func (UnimplementedRollServiceServer) Roll(context.Context, *RollRequest) (*RollResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Roll not implemented")
}
func (UnimplementedRollServiceServer) GetRolls(*GetRollsRequest, RollService_GetRollsServer) error {
	return status.Errorf(codes.Unimplemented, "method GetRolls not implemented")
}
func (UnimplementedRollServiceServer) mustEmbedUnimplementedRollServiceServer() {}

// UnsafeRollServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to RollServiceServer will
// result in compilation errors.
type UnsafeRollServiceServer interface {
	mustEmbedUnimplementedRollServiceServer()
}

func RegisterRollServiceServer(s grpc.ServiceRegistrar, srv RollServiceServer) {
	s.RegisterService(&RollService_ServiceDesc, srv)
}

func _RollService_Roll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RollRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RollServiceServer).Roll(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/RollService/Roll",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RollServiceServer).Roll(ctx, req.(*RollRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RollService_GetRolls_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(GetRollsRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(RollServiceServer).GetRolls(m, &rollServiceGetRollsServer{stream})
}

type RollService_GetRollsServer interface {
	Send(*RollTable) error
	grpc.ServerStream
}

type rollServiceGetRollsServer struct {
	grpc.ServerStream
}

func (x *rollServiceGetRollsServer) Send(m *RollTable) error {
	return x.ServerStream.SendMsg(m)
}

// RollService_ServiceDesc is the grpc.ServiceDesc for RollService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var RollService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "RollService",
	HandlerType: (*RollServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Roll",
			Handler:    _RollService_Roll_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetRolls",
			Handler:       _RollService_GetRolls_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "dice.proto",
}
