// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v3.5.0
// source: healthz.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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	Healthz_CheckReadiness_FullMethodName = "/dikastes.Healthz/CheckReadiness"
	Healthz_CheckLiveness_FullMethodName  = "/dikastes.Healthz/CheckLiveness"
)

// HealthzClient is the client API for Healthz 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.
//
// Healthz reports readiness and liveness.
type HealthzClient interface {
	CheckReadiness(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
	CheckLiveness(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
}

type healthzClient struct {
	cc grpc.ClientConnInterface
}

func NewHealthzClient(cc grpc.ClientConnInterface) HealthzClient {
	return &healthzClient{cc}
}

func (c *healthzClient) CheckReadiness(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(HealthCheckResponse)
	err := c.cc.Invoke(ctx, Healthz_CheckReadiness_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *healthzClient) CheckLiveness(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(HealthCheckResponse)
	err := c.cc.Invoke(ctx, Healthz_CheckLiveness_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// HealthzServer is the server API for Healthz service.
// All implementations must embed UnimplementedHealthzServer
// for forward compatibility.
//
// Healthz reports readiness and liveness.
type HealthzServer interface {
	CheckReadiness(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
	CheckLiveness(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
	mustEmbedUnimplementedHealthzServer()
}

// UnimplementedHealthzServer 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 UnimplementedHealthzServer struct{}

func (UnimplementedHealthzServer) CheckReadiness(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CheckReadiness not implemented")
}
func (UnimplementedHealthzServer) CheckLiveness(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CheckLiveness not implemented")
}
func (UnimplementedHealthzServer) mustEmbedUnimplementedHealthzServer() {}
func (UnimplementedHealthzServer) testEmbeddedByValue()                 {}

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

func RegisterHealthzServer(s grpc.ServiceRegistrar, srv HealthzServer) {
	// If the following call pancis, it indicates UnimplementedHealthzServer 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(&Healthz_ServiceDesc, srv)
}

func _Healthz_CheckReadiness_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(HealthCheckRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(HealthzServer).CheckReadiness(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Healthz_CheckReadiness_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(HealthzServer).CheckReadiness(ctx, req.(*HealthCheckRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Healthz_CheckLiveness_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(HealthCheckRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(HealthzServer).CheckLiveness(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Healthz_CheckLiveness_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(HealthzServer).CheckLiveness(ctx, req.(*HealthCheckRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Healthz_ServiceDesc is the grpc.ServiceDesc for Healthz service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Healthz_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "dikastes.Healthz",
	HandlerType: (*HealthzServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CheckReadiness",
			Handler:    _Healthz_CheckReadiness_Handler,
		},
		{
			MethodName: "CheckLiveness",
			Handler:    _Healthz_CheckLiveness_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "healthz.proto",
}
