160 lines
5.4 KiB
Go
160 lines
5.4 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.5.1
|
|
// - protoc v3.21.12
|
|
// source: grpc.proto
|
|
|
|
package grpc
|
|
|
|
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 (
|
|
Whoami_Whoami_FullMethodName = "/whoami.Whoami/Whoami"
|
|
Whoami_Bench_FullMethodName = "/whoami.Whoami/Bench"
|
|
)
|
|
|
|
// WhoamiClient is the client API for Whoami 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 WhoamiClient interface {
|
|
Whoami(ctx context.Context, in *WhoamiRequest, opts ...grpc.CallOption) (*WhoamiReply, error)
|
|
Bench(ctx context.Context, in *BenchRequest, opts ...grpc.CallOption) (*BenchReply, error)
|
|
}
|
|
|
|
type whoamiClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewWhoamiClient(cc grpc.ClientConnInterface) WhoamiClient {
|
|
return &whoamiClient{cc}
|
|
}
|
|
|
|
func (c *whoamiClient) Whoami(ctx context.Context, in *WhoamiRequest, opts ...grpc.CallOption) (*WhoamiReply, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(WhoamiReply)
|
|
err := c.cc.Invoke(ctx, Whoami_Whoami_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *whoamiClient) Bench(ctx context.Context, in *BenchRequest, opts ...grpc.CallOption) (*BenchReply, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(BenchReply)
|
|
err := c.cc.Invoke(ctx, Whoami_Bench_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// WhoamiServer is the server API for Whoami service.
|
|
// All implementations must embed UnimplementedWhoamiServer
|
|
// for forward compatibility.
|
|
type WhoamiServer interface {
|
|
Whoami(context.Context, *WhoamiRequest) (*WhoamiReply, error)
|
|
Bench(context.Context, *BenchRequest) (*BenchReply, error)
|
|
mustEmbedUnimplementedWhoamiServer()
|
|
}
|
|
|
|
// UnimplementedWhoamiServer 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 UnimplementedWhoamiServer struct{}
|
|
|
|
func (UnimplementedWhoamiServer) Whoami(context.Context, *WhoamiRequest) (*WhoamiReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Whoami not implemented")
|
|
}
|
|
func (UnimplementedWhoamiServer) Bench(context.Context, *BenchRequest) (*BenchReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Bench not implemented")
|
|
}
|
|
func (UnimplementedWhoamiServer) mustEmbedUnimplementedWhoamiServer() {}
|
|
func (UnimplementedWhoamiServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeWhoamiServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to WhoamiServer will
|
|
// result in compilation errors.
|
|
type UnsafeWhoamiServer interface {
|
|
mustEmbedUnimplementedWhoamiServer()
|
|
}
|
|
|
|
func RegisterWhoamiServer(s grpc.ServiceRegistrar, srv WhoamiServer) {
|
|
// If the following call pancis, it indicates UnimplementedWhoamiServer 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(&Whoami_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Whoami_Whoami_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(WhoamiRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(WhoamiServer).Whoami(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Whoami_Whoami_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(WhoamiServer).Whoami(ctx, req.(*WhoamiRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Whoami_Bench_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(BenchRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(WhoamiServer).Bench(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Whoami_Bench_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(WhoamiServer).Bench(ctx, req.(*BenchRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Whoami_ServiceDesc is the grpc.ServiceDesc for Whoami service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Whoami_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "whoami.Whoami",
|
|
HandlerType: (*WhoamiServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Whoami",
|
|
Handler: _Whoami_Whoami_Handler,
|
|
},
|
|
{
|
|
MethodName: "Bench",
|
|
Handler: _Whoami_Bench_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "grpc.proto",
|
|
}
|