286 lines
11 KiB
Go
286 lines
11 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.5.1
|
|
// - protoc v5.28.3
|
|
// source: helios/auth/auth.proto
|
|
|
|
package pbauth
|
|
|
|
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 (
|
|
AuthService_Register_FullMethodName = "/helios.auth.AuthService/Register"
|
|
AuthService_SignIn_FullMethodName = "/helios.auth.AuthService/SignIn"
|
|
AuthService_SignInVerify_FullMethodName = "/helios.auth.AuthService/SignInVerify"
|
|
AuthService_SignOut_FullMethodName = "/helios.auth.AuthService/SignOut"
|
|
AuthService_AuthedHuman_FullMethodName = "/helios.auth.AuthService/AuthedHuman"
|
|
)
|
|
|
|
// AuthServiceClient is the client API for AuthService 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 AuthServiceClient interface {
|
|
// Returns "ALREADY_EXISTS" if the email is already registered.
|
|
Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
|
|
// Sends email with a code.
|
|
SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*SignInResponse, error)
|
|
// Verifies the code and returns a token.
|
|
SignInVerify(ctx context.Context, in *SignInVerifyRequest, opts ...grpc.CallOption) (*SignInVerifyResponse, error)
|
|
// Expires the session, if have one with provided token in "authorization" metadata
|
|
SignOut(ctx context.Context, in *SignOutRequest, opts ...grpc.CallOption) (*SignOutResponse, error)
|
|
// Returns the authed human based on session_token in metadata. Returns unauthenticated otherwise.
|
|
// Requires session token in "authorization" metadata.
|
|
AuthedHuman(ctx context.Context, in *AuthedHumanRequest, opts ...grpc.CallOption) (*AuthedHumanResponse, error)
|
|
}
|
|
|
|
type authServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {
|
|
return &authServiceClient{cc}
|
|
}
|
|
|
|
func (c *authServiceClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(RegisterResponse)
|
|
err := c.cc.Invoke(ctx, AuthService_Register_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *authServiceClient) SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*SignInResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(SignInResponse)
|
|
err := c.cc.Invoke(ctx, AuthService_SignIn_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *authServiceClient) SignInVerify(ctx context.Context, in *SignInVerifyRequest, opts ...grpc.CallOption) (*SignInVerifyResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(SignInVerifyResponse)
|
|
err := c.cc.Invoke(ctx, AuthService_SignInVerify_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *authServiceClient) SignOut(ctx context.Context, in *SignOutRequest, opts ...grpc.CallOption) (*SignOutResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(SignOutResponse)
|
|
err := c.cc.Invoke(ctx, AuthService_SignOut_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *authServiceClient) AuthedHuman(ctx context.Context, in *AuthedHumanRequest, opts ...grpc.CallOption) (*AuthedHumanResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(AuthedHumanResponse)
|
|
err := c.cc.Invoke(ctx, AuthService_AuthedHuman_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// AuthServiceServer is the server API for AuthService service.
|
|
// All implementations must embed UnimplementedAuthServiceServer
|
|
// for forward compatibility.
|
|
type AuthServiceServer interface {
|
|
// Returns "ALREADY_EXISTS" if the email is already registered.
|
|
Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
|
|
// Sends email with a code.
|
|
SignIn(context.Context, *SignInRequest) (*SignInResponse, error)
|
|
// Verifies the code and returns a token.
|
|
SignInVerify(context.Context, *SignInVerifyRequest) (*SignInVerifyResponse, error)
|
|
// Expires the session, if have one with provided token in "authorization" metadata
|
|
SignOut(context.Context, *SignOutRequest) (*SignOutResponse, error)
|
|
// Returns the authed human based on session_token in metadata. Returns unauthenticated otherwise.
|
|
// Requires session token in "authorization" metadata.
|
|
AuthedHuman(context.Context, *AuthedHumanRequest) (*AuthedHumanResponse, error)
|
|
mustEmbedUnimplementedAuthServiceServer()
|
|
}
|
|
|
|
// UnimplementedAuthServiceServer 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 UnimplementedAuthServiceServer struct{}
|
|
|
|
func (UnimplementedAuthServiceServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
|
|
}
|
|
func (UnimplementedAuthServiceServer) SignIn(context.Context, *SignInRequest) (*SignInResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SignIn not implemented")
|
|
}
|
|
func (UnimplementedAuthServiceServer) SignInVerify(context.Context, *SignInVerifyRequest) (*SignInVerifyResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SignInVerify not implemented")
|
|
}
|
|
func (UnimplementedAuthServiceServer) SignOut(context.Context, *SignOutRequest) (*SignOutResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SignOut not implemented")
|
|
}
|
|
func (UnimplementedAuthServiceServer) AuthedHuman(context.Context, *AuthedHumanRequest) (*AuthedHumanResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method AuthedHuman not implemented")
|
|
}
|
|
func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
|
|
func (UnimplementedAuthServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to AuthServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeAuthServiceServer interface {
|
|
mustEmbedUnimplementedAuthServiceServer()
|
|
}
|
|
|
|
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {
|
|
// If the following call pancis, it indicates UnimplementedAuthServiceServer 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(&AuthService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _AuthService_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(RegisterRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthServiceServer).Register(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AuthService_Register_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthServiceServer).Register(ctx, req.(*RegisterRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AuthService_SignIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SignInRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthServiceServer).SignIn(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AuthService_SignIn_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthServiceServer).SignIn(ctx, req.(*SignInRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AuthService_SignInVerify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SignInVerifyRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthServiceServer).SignInVerify(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AuthService_SignInVerify_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthServiceServer).SignInVerify(ctx, req.(*SignInVerifyRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AuthService_SignOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SignOutRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthServiceServer).SignOut(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AuthService_SignOut_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthServiceServer).SignOut(ctx, req.(*SignOutRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AuthService_AuthedHuman_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(AuthedHumanRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthServiceServer).AuthedHuman(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: AuthService_AuthedHuman_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthServiceServer).AuthedHuman(ctx, req.(*AuthedHumanRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var AuthService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "helios.auth.AuthService",
|
|
HandlerType: (*AuthServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Register",
|
|
Handler: _AuthService_Register_Handler,
|
|
},
|
|
{
|
|
MethodName: "SignIn",
|
|
Handler: _AuthService_SignIn_Handler,
|
|
},
|
|
{
|
|
MethodName: "SignInVerify",
|
|
Handler: _AuthService_SignInVerify_Handler,
|
|
},
|
|
{
|
|
MethodName: "SignOut",
|
|
Handler: _AuthService_SignOut_Handler,
|
|
},
|
|
{
|
|
MethodName: "AuthedHuman",
|
|
Handler: _AuthService_AuthedHuman_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "helios/auth/auth.proto",
|
|
}
|