mirror of
https://github.com/dev6699/yolotriton.git
synced 2025-09-26 19:51:13 +08:00
146 lines
5.3 KiB
Go
146 lines
5.3 KiB
Go
// Copyright 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
//
|
|
// Redistribution and use in source and binary forms, with or without
|
|
// modification, are permitted provided that the following conditions
|
|
// are met:
|
|
// * Redistributions of source code must retain the above copyright
|
|
// notice, this list of conditions and the following disclaimer.
|
|
// * Redistributions in binary form must reproduce the above copyright
|
|
// notice, this list of conditions and the following disclaimer in the
|
|
// documentation and/or other materials provided with the distribution.
|
|
// * Neither the name of NVIDIA CORPORATION nor the names of its
|
|
// contributors may be used to endorse or promote products derived
|
|
// from this software without specific prior written permission.
|
|
//
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
|
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
|
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.3.0
|
|
// - protoc v3.12.4
|
|
// source: health.proto
|
|
|
|
package grpc_client
|
|
|
|
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 (
|
|
Health_Check_FullMethodName = "/grpc.health.v1.Health/Check"
|
|
)
|
|
|
|
// HealthClient is the client API for Health 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 HealthClient interface {
|
|
// @@ .. cpp:var:: rpc Check(HealthCheckRequest) returns
|
|
// @@ (HealthCheckResponse)
|
|
// @@
|
|
// @@ Get serving status of the inference server.
|
|
// @@
|
|
Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
|
|
}
|
|
|
|
type healthClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewHealthClient(cc grpc.ClientConnInterface) HealthClient {
|
|
return &healthClient{cc}
|
|
}
|
|
|
|
func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) {
|
|
out := new(HealthCheckResponse)
|
|
err := c.cc.Invoke(ctx, Health_Check_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// HealthServer is the server API for Health service.
|
|
// All implementations must embed UnimplementedHealthServer
|
|
// for forward compatibility
|
|
type HealthServer interface {
|
|
// @@ .. cpp:var:: rpc Check(HealthCheckRequest) returns
|
|
// @@ (HealthCheckResponse)
|
|
// @@
|
|
// @@ Get serving status of the inference server.
|
|
// @@
|
|
Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
|
|
mustEmbedUnimplementedHealthServer()
|
|
}
|
|
|
|
// UnimplementedHealthServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedHealthServer struct {
|
|
}
|
|
|
|
func (UnimplementedHealthServer) Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Check not implemented")
|
|
}
|
|
func (UnimplementedHealthServer) mustEmbedUnimplementedHealthServer() {}
|
|
|
|
// UnsafeHealthServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to HealthServer will
|
|
// result in compilation errors.
|
|
type UnsafeHealthServer interface {
|
|
mustEmbedUnimplementedHealthServer()
|
|
}
|
|
|
|
func RegisterHealthServer(s grpc.ServiceRegistrar, srv HealthServer) {
|
|
s.RegisterService(&Health_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Health_Check_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.(HealthServer).Check(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Health_Check_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(HealthServer).Check(ctx, req.(*HealthCheckRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Health_ServiceDesc is the grpc.ServiceDesc for Health service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Health_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "grpc.health.v1.Health",
|
|
HandlerType: (*HealthServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Check",
|
|
Handler: _Health_Check_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "health.proto",
|
|
}
|