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

package v1

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

// PrometheusGatewayClient is the client API for PrometheusGateway 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 PrometheusGatewayClient interface {
	Handle(ctx context.Context, in *PromqlRequest, opts ...grpc.CallOption) (*PromqlResponse, error)
}

type prometheusGatewayClient struct {
	cc grpc.ClientConnInterface
}

func NewPrometheusGatewayClient(cc grpc.ClientConnInterface) PrometheusGatewayClient {
	return &prometheusGatewayClient{cc}
}

func (c *prometheusGatewayClient) Handle(ctx context.Context, in *PromqlRequest, opts ...grpc.CallOption) (*PromqlResponse, error) {
	out := new(PromqlResponse)
	err := c.cc.Invoke(ctx, "/greptime.v1.PrometheusGateway/Handle", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// PrometheusGatewayServer is the server API for PrometheusGateway service.
// All implementations must embed UnimplementedPrometheusGatewayServer
// for forward compatibility
type PrometheusGatewayServer interface {
	Handle(context.Context, *PromqlRequest) (*PromqlResponse, error)
	mustEmbedUnimplementedPrometheusGatewayServer()
}

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

func (UnimplementedPrometheusGatewayServer) Handle(context.Context, *PromqlRequest) (*PromqlResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Handle not implemented")
}
func (UnimplementedPrometheusGatewayServer) mustEmbedUnimplementedPrometheusGatewayServer() {}

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

func RegisterPrometheusGatewayServer(s grpc.ServiceRegistrar, srv PrometheusGatewayServer) {
	s.RegisterService(&PrometheusGateway_ServiceDesc, srv)
}

func _PrometheusGateway_Handle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PromqlRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PrometheusGatewayServer).Handle(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/greptime.v1.PrometheusGateway/Handle",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PrometheusGatewayServer).Handle(ctx, req.(*PromqlRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// PrometheusGateway_ServiceDesc is the grpc.ServiceDesc for PrometheusGateway service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var PrometheusGateway_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "greptime.v1.PrometheusGateway",
	HandlerType: (*PrometheusGatewayServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Handle",
			Handler:    _PrometheusGateway_Handle_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "greptime/v1/prom.proto",
}
