service auth registration
This commit is contained in:
parent
6eda67db60
commit
287b1f5a30
7 changed files with 478 additions and 0 deletions
121
pkg/externalRegistration/v1/serviceRegistration_grpc.pb.go
Normal file
121
pkg/externalRegistration/v1/serviceRegistration_grpc.pb.go
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v6.33.1
|
||||
// source: proto/serviceRegistration.proto
|
||||
|
||||
package externalRegV1
|
||||
|
||||
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 (
|
||||
ExternalRegistration_AuthenticateOrRegister_FullMethodName = "/auth.registration.ExternalRegistration/AuthenticateOrRegister"
|
||||
)
|
||||
|
||||
// ExternalRegistrationClient is the client API for ExternalRegistration 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 ExternalRegistrationClient interface {
|
||||
AuthenticateOrRegister(ctx context.Context, in *RegistrationRequest, opts ...grpc.CallOption) (*RegistrationResponse, error)
|
||||
}
|
||||
|
||||
type externalRegistrationClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewExternalRegistrationClient(cc grpc.ClientConnInterface) ExternalRegistrationClient {
|
||||
return &externalRegistrationClient{cc}
|
||||
}
|
||||
|
||||
func (c *externalRegistrationClient) AuthenticateOrRegister(ctx context.Context, in *RegistrationRequest, opts ...grpc.CallOption) (*RegistrationResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RegistrationResponse)
|
||||
err := c.cc.Invoke(ctx, ExternalRegistration_AuthenticateOrRegister_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ExternalRegistrationServer is the server API for ExternalRegistration service.
|
||||
// All implementations must embed UnimplementedExternalRegistrationServer
|
||||
// for forward compatibility.
|
||||
type ExternalRegistrationServer interface {
|
||||
AuthenticateOrRegister(context.Context, *RegistrationRequest) (*RegistrationResponse, error)
|
||||
mustEmbedUnimplementedExternalRegistrationServer()
|
||||
}
|
||||
|
||||
// UnimplementedExternalRegistrationServer 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 UnimplementedExternalRegistrationServer struct{}
|
||||
|
||||
func (UnimplementedExternalRegistrationServer) AuthenticateOrRegister(context.Context, *RegistrationRequest) (*RegistrationResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AuthenticateOrRegister not implemented")
|
||||
}
|
||||
func (UnimplementedExternalRegistrationServer) mustEmbedUnimplementedExternalRegistrationServer() {}
|
||||
func (UnimplementedExternalRegistrationServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeExternalRegistrationServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ExternalRegistrationServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeExternalRegistrationServer interface {
|
||||
mustEmbedUnimplementedExternalRegistrationServer()
|
||||
}
|
||||
|
||||
func RegisterExternalRegistrationServer(s grpc.ServiceRegistrar, srv ExternalRegistrationServer) {
|
||||
// If the following call pancis, it indicates UnimplementedExternalRegistrationServer 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(&ExternalRegistration_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ExternalRegistration_AuthenticateOrRegister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RegistrationRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ExternalRegistrationServer).AuthenticateOrRegister(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ExternalRegistration_AuthenticateOrRegister_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ExternalRegistrationServer).AuthenticateOrRegister(ctx, req.(*RegistrationRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ExternalRegistration_ServiceDesc is the grpc.ServiceDesc for ExternalRegistration service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ExternalRegistration_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "auth.registration.ExternalRegistration",
|
||||
HandlerType: (*ExternalRegistrationServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "AuthenticateOrRegister",
|
||||
Handler: _ExternalRegistration_AuthenticateOrRegister_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "proto/serviceRegistration.proto",
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue