grpc-ping/ping/ping_grpc.pb.go

102 lines
3.1 KiB
Go
Raw Normal View History

2021-07-07 15:13:36 +00:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package ping
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
// PingClient is the client API for Ping 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 PingClient interface {
Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
}
type pingClient struct {
cc grpc.ClientConnInterface
}
func NewPingClient(cc grpc.ClientConnInterface) PingClient {
return &pingClient{cc}
}
func (c *pingClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) {
out := new(PingResponse)
err := c.cc.Invoke(ctx, "/ping.ping/Ping", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// PingServer is the server API for Ping service.
// All implementations must embed UnimplementedPingServer
// for forward compatibility
type PingServer interface {
Ping(context.Context, *PingRequest) (*PingResponse, error)
mustEmbedUnimplementedPingServer()
}
// UnimplementedPingServer must be embedded to have forward compatible implementations.
type UnimplementedPingServer struct {
}
func (UnimplementedPingServer) Ping(context.Context, *PingRequest) (*PingResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
}
func (UnimplementedPingServer) mustEmbedUnimplementedPingServer() {}
// UnsafePingServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to PingServer will
// result in compilation errors.
type UnsafePingServer interface {
mustEmbedUnimplementedPingServer()
}
func RegisterPingServer(s grpc.ServiceRegistrar, srv PingServer) {
s.RegisterService(&Ping_ServiceDesc, srv)
}
func _Ping_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PingRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PingServer).Ping(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/ping.ping/Ping",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PingServer).Ping(ctx, req.(*PingRequest))
}
return interceptor(ctx, in, info, handler)
}
// Ping_ServiceDesc is the grpc.ServiceDesc for Ping service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Ping_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ping.ping",
HandlerType: (*PingServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Ping",
Handler: _Ping_Ping_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "ping/ping.proto",
}