mirror of
https://github.com/garethgeorge/backrest.git
synced 2025-12-13 01:05:48 +00:00
148 lines
5.3 KiB
Go
148 lines
5.3 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.3.0
|
|
// - protoc (unknown)
|
|
// source: v1/authentication.proto
|
|
|
|
package v1
|
|
|
|
import (
|
|
context "context"
|
|
types "github.com/garethgeorge/backrest/gen/go/types"
|
|
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
|
|
|
|
const (
|
|
Authentication_Login_FullMethodName = "/v1.Authentication/Login"
|
|
Authentication_HashPassword_FullMethodName = "/v1.Authentication/HashPassword"
|
|
)
|
|
|
|
// AuthenticationClient is the client API for Authentication 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 AuthenticationClient interface {
|
|
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
|
|
HashPassword(ctx context.Context, in *types.StringValue, opts ...grpc.CallOption) (*types.StringValue, error)
|
|
}
|
|
|
|
type authenticationClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewAuthenticationClient(cc grpc.ClientConnInterface) AuthenticationClient {
|
|
return &authenticationClient{cc}
|
|
}
|
|
|
|
func (c *authenticationClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) {
|
|
out := new(LoginResponse)
|
|
err := c.cc.Invoke(ctx, Authentication_Login_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *authenticationClient) HashPassword(ctx context.Context, in *types.StringValue, opts ...grpc.CallOption) (*types.StringValue, error) {
|
|
out := new(types.StringValue)
|
|
err := c.cc.Invoke(ctx, Authentication_HashPassword_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// AuthenticationServer is the server API for Authentication service.
|
|
// All implementations must embed UnimplementedAuthenticationServer
|
|
// for forward compatibility
|
|
type AuthenticationServer interface {
|
|
Login(context.Context, *LoginRequest) (*LoginResponse, error)
|
|
HashPassword(context.Context, *types.StringValue) (*types.StringValue, error)
|
|
mustEmbedUnimplementedAuthenticationServer()
|
|
}
|
|
|
|
// UnimplementedAuthenticationServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedAuthenticationServer struct {
|
|
}
|
|
|
|
func (UnimplementedAuthenticationServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
|
|
}
|
|
func (UnimplementedAuthenticationServer) HashPassword(context.Context, *types.StringValue) (*types.StringValue, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method HashPassword not implemented")
|
|
}
|
|
func (UnimplementedAuthenticationServer) mustEmbedUnimplementedAuthenticationServer() {}
|
|
|
|
// UnsafeAuthenticationServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to AuthenticationServer will
|
|
// result in compilation errors.
|
|
type UnsafeAuthenticationServer interface {
|
|
mustEmbedUnimplementedAuthenticationServer()
|
|
}
|
|
|
|
func RegisterAuthenticationServer(s grpc.ServiceRegistrar, srv AuthenticationServer) {
|
|
s.RegisterService(&Authentication_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Authentication_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(LoginRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthenticationServer).Login(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Authentication_Login_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthenticationServer).Login(ctx, req.(*LoginRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Authentication_HashPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(types.StringValue)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthenticationServer).HashPassword(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Authentication_HashPassword_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthenticationServer).HashPassword(ctx, req.(*types.StringValue))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Authentication_ServiceDesc is the grpc.ServiceDesc for Authentication service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Authentication_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "v1.Authentication",
|
|
HandlerType: (*AuthenticationServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Login",
|
|
Handler: _Authentication_Login_Handler,
|
|
},
|
|
{
|
|
MethodName: "HashPassword",
|
|
Handler: _Authentication_HashPassword_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "v1/authentication.proto",
|
|
}
|