By allanger
Commit link: 1d3ceb07da
Pipeline link: https://ci.badhouseplants.net/repos/34/pipeline/30
163 lines
6.1 KiB
Go
163 lines
6.1 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.6.1
|
|
// - protoc (unknown)
|
|
// source: email/v1/email_v1.proto
|
|
|
|
package email
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
|
)
|
|
|
|
// 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 (
|
|
EmailValidation_SendRequest_FullMethodName = "/email.EmailValidation/SendRequest"
|
|
EmailValidation_ValidateEmail_FullMethodName = "/email.EmailValidation/ValidateEmail"
|
|
)
|
|
|
|
// EmailValidationClient is the client API for EmailValidation 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.
|
|
//
|
|
// A service that should handle email validation
|
|
type EmailValidationClient interface {
|
|
SendRequest(ctx context.Context, in *RequestValidation, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
ValidateEmail(ctx context.Context, in *ConfirmValidation, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
|
}
|
|
|
|
type emailValidationClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewEmailValidationClient(cc grpc.ClientConnInterface) EmailValidationClient {
|
|
return &emailValidationClient{cc}
|
|
}
|
|
|
|
func (c *emailValidationClient) SendRequest(ctx context.Context, in *RequestValidation, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(emptypb.Empty)
|
|
err := c.cc.Invoke(ctx, EmailValidation_SendRequest_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *emailValidationClient) ValidateEmail(ctx context.Context, in *ConfirmValidation, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(emptypb.Empty)
|
|
err := c.cc.Invoke(ctx, EmailValidation_ValidateEmail_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// EmailValidationServer is the server API for EmailValidation service.
|
|
// All implementations should embed UnimplementedEmailValidationServer
|
|
// for forward compatibility.
|
|
//
|
|
// A service that should handle email validation
|
|
type EmailValidationServer interface {
|
|
SendRequest(context.Context, *RequestValidation) (*emptypb.Empty, error)
|
|
ValidateEmail(context.Context, *ConfirmValidation) (*emptypb.Empty, error)
|
|
}
|
|
|
|
// UnimplementedEmailValidationServer should 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 UnimplementedEmailValidationServer struct{}
|
|
|
|
func (UnimplementedEmailValidationServer) SendRequest(context.Context, *RequestValidation) (*emptypb.Empty, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method SendRequest not implemented")
|
|
}
|
|
func (UnimplementedEmailValidationServer) ValidateEmail(context.Context, *ConfirmValidation) (*emptypb.Empty, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method ValidateEmail not implemented")
|
|
}
|
|
func (UnimplementedEmailValidationServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeEmailValidationServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to EmailValidationServer will
|
|
// result in compilation errors.
|
|
type UnsafeEmailValidationServer interface {
|
|
mustEmbedUnimplementedEmailValidationServer()
|
|
}
|
|
|
|
func RegisterEmailValidationServer(s grpc.ServiceRegistrar, srv EmailValidationServer) {
|
|
// If the following call panics, it indicates UnimplementedEmailValidationServer 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(&EmailValidation_ServiceDesc, srv)
|
|
}
|
|
|
|
func _EmailValidation_SendRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(RequestValidation)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(EmailValidationServer).SendRequest(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: EmailValidation_SendRequest_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(EmailValidationServer).SendRequest(ctx, req.(*RequestValidation))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _EmailValidation_ValidateEmail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ConfirmValidation)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(EmailValidationServer).ValidateEmail(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: EmailValidation_ValidateEmail_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(EmailValidationServer).ValidateEmail(ctx, req.(*ConfirmValidation))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// EmailValidation_ServiceDesc is the grpc.ServiceDesc for EmailValidation service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var EmailValidation_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "email.EmailValidation",
|
|
HandlerType: (*EmailValidationServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "SendRequest",
|
|
Handler: _EmailValidation_SendRequest_Handler,
|
|
},
|
|
{
|
|
MethodName: "ValidateEmail",
|
|
Handler: _EmailValidation_ValidateEmail_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "email/v1/email_v1.proto",
|
|
}
|