// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             v4.25.3
// source: ipcache.proto

package rpc

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

const (
	IPCacheService_ListCache_FullMethodName  = "/controller_rpc.IPCacheService/ListCache"
	IPCacheService_WatchCache_FullMethodName = "/controller_rpc.IPCacheService/WatchCache"
)

// IPCacheServiceClient is the client API for IPCacheService 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 IPCacheServiceClient interface {
	ListCache(ctx context.Context, in *ListCacheRequest, opts ...grpc.CallOption) (*ListCacheResponse, error)
	WatchCache(ctx context.Context, in *WatchCacheRequest, opts ...grpc.CallOption) (IPCacheService_WatchCacheClient, error)
}

type iPCacheServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewIPCacheServiceClient(cc grpc.ClientConnInterface) IPCacheServiceClient {
	return &iPCacheServiceClient{cc}
}

func (c *iPCacheServiceClient) ListCache(ctx context.Context, in *ListCacheRequest, opts ...grpc.CallOption) (*ListCacheResponse, error) {
	out := new(ListCacheResponse)
	err := c.cc.Invoke(ctx, IPCacheService_ListCache_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *iPCacheServiceClient) WatchCache(ctx context.Context, in *WatchCacheRequest, opts ...grpc.CallOption) (IPCacheService_WatchCacheClient, error) {
	stream, err := c.cc.NewStream(ctx, &IPCacheService_ServiceDesc.Streams[0], IPCacheService_WatchCache_FullMethodName, opts...)
	if err != nil {
		return nil, err
	}
	x := &iPCacheServiceWatchCacheClient{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 IPCacheService_WatchCacheClient interface {
	Recv() (*WatchCacheResponse, error)
	grpc.ClientStream
}

type iPCacheServiceWatchCacheClient struct {
	grpc.ClientStream
}

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

// IPCacheServiceServer is the server API for IPCacheService service.
// All implementations must embed UnimplementedIPCacheServiceServer
// for forward compatibility
type IPCacheServiceServer interface {
	ListCache(context.Context, *ListCacheRequest) (*ListCacheResponse, error)
	WatchCache(*WatchCacheRequest, IPCacheService_WatchCacheServer) error
	mustEmbedUnimplementedIPCacheServiceServer()
}

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

func (UnimplementedIPCacheServiceServer) ListCache(context.Context, *ListCacheRequest) (*ListCacheResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListCache not implemented")
}
func (UnimplementedIPCacheServiceServer) WatchCache(*WatchCacheRequest, IPCacheService_WatchCacheServer) error {
	return status.Errorf(codes.Unimplemented, "method WatchCache not implemented")
}
func (UnimplementedIPCacheServiceServer) mustEmbedUnimplementedIPCacheServiceServer() {}

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

func RegisterIPCacheServiceServer(s grpc.ServiceRegistrar, srv IPCacheServiceServer) {
	s.RegisterService(&IPCacheService_ServiceDesc, srv)
}

func _IPCacheService_ListCache_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListCacheRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(IPCacheServiceServer).ListCache(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: IPCacheService_ListCache_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(IPCacheServiceServer).ListCache(ctx, req.(*ListCacheRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _IPCacheService_WatchCache_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(WatchCacheRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(IPCacheServiceServer).WatchCache(m, &iPCacheServiceWatchCacheServer{stream})
}

type IPCacheService_WatchCacheServer interface {
	Send(*WatchCacheResponse) error
	grpc.ServerStream
}

type iPCacheServiceWatchCacheServer struct {
	grpc.ServerStream
}

func (x *iPCacheServiceWatchCacheServer) Send(m *WatchCacheResponse) error {
	return x.ServerStream.SendMsg(m)
}

// IPCacheService_ServiceDesc is the grpc.ServiceDesc for IPCacheService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var IPCacheService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "controller_rpc.IPCacheService",
	HandlerType: (*IPCacheServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListCache",
			Handler:    _IPCacheService_ListCache_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "WatchCache",
			Handler:       _IPCacheService_WatchCache_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "ipcache.proto",
}
