2023-11-01 16:21:17 -04:00
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
2021-10-19 17:21:41 -04:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2023-11-01 16:21:17 -04:00
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: testing/interceptor/v1/greeter.proto
2021-10-19 17:21:41 -04:00
package interceptor
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
2023-11-01 16:21:17 -04:00
const (
GreeterService_SayHello_FullMethodName = "/testing.interceptor.v1.GreeterService/SayHello"
)
2021-10-19 17:21:41 -04:00
// GreeterServiceClient is the client API for GreeterService 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 GreeterServiceClient interface {
// Sends a greeting
SayHello ( ctx context . Context , in * SayHelloRequest , opts ... grpc . CallOption ) ( * SayHelloResponse , error )
}
type greeterServiceClient struct {
cc grpc . ClientConnInterface
}
func NewGreeterServiceClient ( cc grpc . ClientConnInterface ) GreeterServiceClient {
return & greeterServiceClient { cc }
}
func ( c * greeterServiceClient ) SayHello ( ctx context . Context , in * SayHelloRequest , opts ... grpc . CallOption ) ( * SayHelloResponse , error ) {
out := new ( SayHelloResponse )
2023-11-01 16:21:17 -04:00
err := c . cc . Invoke ( ctx , GreeterService_SayHello_FullMethodName , in , out , opts ... )
2021-10-19 17:21:41 -04:00
if err != nil {
return nil , err
}
return out , nil
}
// GreeterServiceServer is the server API for GreeterService service.
// All implementations must embed UnimplementedGreeterServiceServer
// for forward compatibility
type GreeterServiceServer interface {
// Sends a greeting
SayHello ( context . Context , * SayHelloRequest ) ( * SayHelloResponse , error )
mustEmbedUnimplementedGreeterServiceServer ()
}
// UnimplementedGreeterServiceServer must be embedded to have forward compatible implementations.
type UnimplementedGreeterServiceServer struct {
}
func ( UnimplementedGreeterServiceServer ) SayHello ( context . Context , * SayHelloRequest ) ( * SayHelloResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method SayHello not implemented" )
}
func ( UnimplementedGreeterServiceServer ) mustEmbedUnimplementedGreeterServiceServer () {}
// UnsafeGreeterServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to GreeterServiceServer will
// result in compilation errors.
type UnsafeGreeterServiceServer interface {
mustEmbedUnimplementedGreeterServiceServer ()
}
func RegisterGreeterServiceServer ( s grpc . ServiceRegistrar , srv GreeterServiceServer ) {
s . RegisterService ( & GreeterService_ServiceDesc , srv )
}
func _GreeterService_SayHello_Handler ( srv interface {}, ctx context . Context , dec func ( interface {}) error , interceptor grpc . UnaryServerInterceptor ) ( interface {}, error ) {
in := new ( SayHelloRequest )
if err := dec ( in ); err != nil {
return nil , err
}
if interceptor == nil {
return srv .( GreeterServiceServer ). SayHello ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2023-11-01 16:21:17 -04:00
FullMethod : GreeterService_SayHello_FullMethodName ,
2021-10-19 17:21:41 -04:00
}
handler := func ( ctx context . Context , req interface {}) ( interface {}, error ) {
return srv .( GreeterServiceServer ). SayHello ( ctx , req .( * SayHelloRequest ))
}
return interceptor ( ctx , in , info , handler )
}
// GreeterService_ServiceDesc is the grpc.ServiceDesc for GreeterService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var GreeterService_ServiceDesc = grpc . ServiceDesc {
ServiceName : "testing.interceptor.v1.GreeterService" ,
HandlerType : ( * GreeterServiceServer )( nil ),
Methods : [] grpc . MethodDesc {
{
MethodName : "SayHello" ,
Handler : _GreeterService_SayHello_Handler ,
},
},
Streams : [] grpc . StreamDesc {},
Metadata : "testing/interceptor/v1/greeter.proto" ,
}