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

package proto

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

// GeoIpServiceClient is the client API for GeoIpService 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 GeoIpServiceClient interface {
	Country(ctx context.Context, in *CountryRequest, opts ...grpc.CallOption) (*CountryResponse, error)
	City(ctx context.Context, in *CityRequest, opts ...grpc.CallOption) (*CityResponse, error)
	CityLite(ctx context.Context, in *CityLiteRequest, opts ...grpc.CallOption) (*CityLiteResponse, error)
}

type geoIpServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewGeoIpServiceClient(cc grpc.ClientConnInterface) GeoIpServiceClient {
	return &geoIpServiceClient{cc}
}

func (c *geoIpServiceClient) Country(ctx context.Context, in *CountryRequest, opts ...grpc.CallOption) (*CountryResponse, error) {
	out := new(CountryResponse)
	err := c.cc.Invoke(ctx, "/geoip.GeoIpService/Country", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *geoIpServiceClient) City(ctx context.Context, in *CityRequest, opts ...grpc.CallOption) (*CityResponse, error) {
	out := new(CityResponse)
	err := c.cc.Invoke(ctx, "/geoip.GeoIpService/City", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *geoIpServiceClient) CityLite(ctx context.Context, in *CityLiteRequest, opts ...grpc.CallOption) (*CityLiteResponse, error) {
	out := new(CityLiteResponse)
	err := c.cc.Invoke(ctx, "/geoip.GeoIpService/CityLite", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// GeoIpServiceServer is the server API for GeoIpService service.
// All implementations must embed UnimplementedGeoIpServiceServer
// for forward compatibility
type GeoIpServiceServer interface {
	Country(context.Context, *CountryRequest) (*CountryResponse, error)
	City(context.Context, *CityRequest) (*CityResponse, error)
	CityLite(context.Context, *CityLiteRequest) (*CityLiteResponse, error)
	mustEmbedUnimplementedGeoIpServiceServer()
}

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

func (UnimplementedGeoIpServiceServer) Country(context.Context, *CountryRequest) (*CountryResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Country not implemented")
}
func (UnimplementedGeoIpServiceServer) City(context.Context, *CityRequest) (*CityResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method City not implemented")
}
func (UnimplementedGeoIpServiceServer) CityLite(context.Context, *CityLiteRequest) (*CityLiteResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CityLite not implemented")
}
func (UnimplementedGeoIpServiceServer) mustEmbedUnimplementedGeoIpServiceServer() {}

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

func RegisterGeoIpServiceServer(s grpc.ServiceRegistrar, srv GeoIpServiceServer) {
	s.RegisterService(&GeoIpService_ServiceDesc, srv)
}

func _GeoIpService_Country_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CountryRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GeoIpServiceServer).Country(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/geoip.GeoIpService/Country",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GeoIpServiceServer).Country(ctx, req.(*CountryRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _GeoIpService_City_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CityRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GeoIpServiceServer).City(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/geoip.GeoIpService/City",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GeoIpServiceServer).City(ctx, req.(*CityRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _GeoIpService_CityLite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CityLiteRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(GeoIpServiceServer).CityLite(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/geoip.GeoIpService/CityLite",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(GeoIpServiceServer).CityLite(ctx, req.(*CityLiteRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// GeoIpService_ServiceDesc is the grpc.ServiceDesc for GeoIpService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var GeoIpService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "geoip.GeoIpService",
	HandlerType: (*GeoIpServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Country",
			Handler:    _GeoIpService_Country_Handler,
		},
		{
			MethodName: "City",
			Handler:    _GeoIpService_City_Handler,
		},
		{
			MethodName: "CityLite",
			Handler:    _GeoIpService_CityLite_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/grpc/geoip.proto",
}
