// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v6.32.1
// source: services/legacy/peer_api/peer_api.proto

package peer_api

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
)

// 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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	PeerService_GetPeers_FullMethodName     = "/peer_api.PeerService/GetPeers"
	PeerService_BanPeer_FullMethodName      = "/peer_api.PeerService/BanPeer"
	PeerService_UnbanPeer_FullMethodName    = "/peer_api.PeerService/UnbanPeer"
	PeerService_IsBanned_FullMethodName     = "/peer_api.PeerService/IsBanned"
	PeerService_ListBanned_FullMethodName   = "/peer_api.PeerService/ListBanned"
	PeerService_ClearBanned_FullMethodName  = "/peer_api.PeerService/ClearBanned"
	PeerService_GetPeerCount_FullMethodName = "/peer_api.PeerService/GetPeerCount"
)

// PeerServiceClient is the client API for PeerService 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.
//
// Add new service for peer operations
type PeerServiceClient interface {
	GetPeers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetPeersResponse, error)
	BanPeer(ctx context.Context, in *BanPeerRequest, opts ...grpc.CallOption) (*BanPeerResponse, error)
	UnbanPeer(ctx context.Context, in *UnbanPeerRequest, opts ...grpc.CallOption) (*UnbanPeerResponse, error)
	IsBanned(ctx context.Context, in *IsBannedRequest, opts ...grpc.CallOption) (*IsBannedResponse, error)
	ListBanned(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListBannedResponse, error)
	ClearBanned(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ClearBannedResponse, error)
	GetPeerCount(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetPeerCountResponse, error)
}

type peerServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewPeerServiceClient(cc grpc.ClientConnInterface) PeerServiceClient {
	return &peerServiceClient{cc}
}

func (c *peerServiceClient) GetPeers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetPeersResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GetPeersResponse)
	err := c.cc.Invoke(ctx, PeerService_GetPeers_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *peerServiceClient) BanPeer(ctx context.Context, in *BanPeerRequest, opts ...grpc.CallOption) (*BanPeerResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(BanPeerResponse)
	err := c.cc.Invoke(ctx, PeerService_BanPeer_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *peerServiceClient) UnbanPeer(ctx context.Context, in *UnbanPeerRequest, opts ...grpc.CallOption) (*UnbanPeerResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(UnbanPeerResponse)
	err := c.cc.Invoke(ctx, PeerService_UnbanPeer_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *peerServiceClient) IsBanned(ctx context.Context, in *IsBannedRequest, opts ...grpc.CallOption) (*IsBannedResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(IsBannedResponse)
	err := c.cc.Invoke(ctx, PeerService_IsBanned_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *peerServiceClient) ListBanned(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListBannedResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListBannedResponse)
	err := c.cc.Invoke(ctx, PeerService_ListBanned_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *peerServiceClient) ClearBanned(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ClearBannedResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ClearBannedResponse)
	err := c.cc.Invoke(ctx, PeerService_ClearBanned_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *peerServiceClient) GetPeerCount(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetPeerCountResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GetPeerCountResponse)
	err := c.cc.Invoke(ctx, PeerService_GetPeerCount_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// PeerServiceServer is the server API for PeerService service.
// All implementations must embed UnimplementedPeerServiceServer
// for forward compatibility.
//
// Add new service for peer operations
type PeerServiceServer interface {
	GetPeers(context.Context, *emptypb.Empty) (*GetPeersResponse, error)
	BanPeer(context.Context, *BanPeerRequest) (*BanPeerResponse, error)
	UnbanPeer(context.Context, *UnbanPeerRequest) (*UnbanPeerResponse, error)
	IsBanned(context.Context, *IsBannedRequest) (*IsBannedResponse, error)
	ListBanned(context.Context, *emptypb.Empty) (*ListBannedResponse, error)
	ClearBanned(context.Context, *emptypb.Empty) (*ClearBannedResponse, error)
	GetPeerCount(context.Context, *emptypb.Empty) (*GetPeerCountResponse, error)
	mustEmbedUnimplementedPeerServiceServer()
}

// UnimplementedPeerServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedPeerServiceServer struct{}

func (UnimplementedPeerServiceServer) GetPeers(context.Context, *emptypb.Empty) (*GetPeersResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetPeers not implemented")
}
func (UnimplementedPeerServiceServer) BanPeer(context.Context, *BanPeerRequest) (*BanPeerResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method BanPeer not implemented")
}
func (UnimplementedPeerServiceServer) UnbanPeer(context.Context, *UnbanPeerRequest) (*UnbanPeerResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UnbanPeer not implemented")
}
func (UnimplementedPeerServiceServer) IsBanned(context.Context, *IsBannedRequest) (*IsBannedResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method IsBanned not implemented")
}
func (UnimplementedPeerServiceServer) ListBanned(context.Context, *emptypb.Empty) (*ListBannedResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListBanned not implemented")
}
func (UnimplementedPeerServiceServer) ClearBanned(context.Context, *emptypb.Empty) (*ClearBannedResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ClearBanned not implemented")
}
func (UnimplementedPeerServiceServer) GetPeerCount(context.Context, *emptypb.Empty) (*GetPeerCountResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetPeerCount not implemented")
}
func (UnimplementedPeerServiceServer) mustEmbedUnimplementedPeerServiceServer() {}
func (UnimplementedPeerServiceServer) testEmbeddedByValue()                     {}

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

func RegisterPeerServiceServer(s grpc.ServiceRegistrar, srv PeerServiceServer) {
	// If the following call pancis, it indicates UnimplementedPeerServiceServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&PeerService_ServiceDesc, srv)
}

func _PeerService_GetPeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(emptypb.Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PeerServiceServer).GetPeers(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PeerService_GetPeers_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PeerServiceServer).GetPeers(ctx, req.(*emptypb.Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _PeerService_BanPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(BanPeerRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PeerServiceServer).BanPeer(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PeerService_BanPeer_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PeerServiceServer).BanPeer(ctx, req.(*BanPeerRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PeerService_UnbanPeer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UnbanPeerRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PeerServiceServer).UnbanPeer(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PeerService_UnbanPeer_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PeerServiceServer).UnbanPeer(ctx, req.(*UnbanPeerRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PeerService_IsBanned_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IsBannedRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PeerServiceServer).IsBanned(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PeerService_IsBanned_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PeerServiceServer).IsBanned(ctx, req.(*IsBannedRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PeerService_ListBanned_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(emptypb.Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PeerServiceServer).ListBanned(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PeerService_ListBanned_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PeerServiceServer).ListBanned(ctx, req.(*emptypb.Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _PeerService_ClearBanned_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(emptypb.Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PeerServiceServer).ClearBanned(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PeerService_ClearBanned_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PeerServiceServer).ClearBanned(ctx, req.(*emptypb.Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _PeerService_GetPeerCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(emptypb.Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PeerServiceServer).GetPeerCount(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PeerService_GetPeerCount_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PeerServiceServer).GetPeerCount(ctx, req.(*emptypb.Empty))
	}
	return interceptor(ctx, in, info, handler)
}

// PeerService_ServiceDesc is the grpc.ServiceDesc for PeerService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var PeerService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "peer_api.PeerService",
	HandlerType: (*PeerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetPeers",
			Handler:    _PeerService_GetPeers_Handler,
		},
		{
			MethodName: "BanPeer",
			Handler:    _PeerService_BanPeer_Handler,
		},
		{
			MethodName: "UnbanPeer",
			Handler:    _PeerService_UnbanPeer_Handler,
		},
		{
			MethodName: "IsBanned",
			Handler:    _PeerService_IsBanned_Handler,
		},
		{
			MethodName: "ListBanned",
			Handler:    _PeerService_ListBanned_Handler,
		},
		{
			MethodName: "ClearBanned",
			Handler:    _PeerService_ClearBanned_Handler,
		},
		{
			MethodName: "GetPeerCount",
			Handler:    _PeerService_GetPeerCount_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "services/legacy/peer_api/peer_api.proto",
}
