174 lines
6.3 KiB
Go
174 lines
6.3 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
|
|
package authentication
|
|
|
|
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
|
|
|
|
// 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 {
|
|
GetTokens(ctx context.Context, in *AuthCode, opts ...grpc.CallOption) (*AuthTokens, error)
|
|
RefreshTokens(ctx context.Context, in *AuthToken, opts ...grpc.CallOption) (*AuthTokens, error)
|
|
VerifyToken(ctx context.Context, in *AuthToken, opts ...grpc.CallOption) (*ValidationResult, error)
|
|
}
|
|
|
|
type authenticationClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewAuthenticationClient(cc grpc.ClientConnInterface) AuthenticationClient {
|
|
return &authenticationClient{cc}
|
|
}
|
|
|
|
func (c *authenticationClient) GetTokens(ctx context.Context, in *AuthCode, opts ...grpc.CallOption) (*AuthTokens, error) {
|
|
out := new(AuthTokens)
|
|
err := c.cc.Invoke(ctx, "/authentication.Authentication/GetTokens", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *authenticationClient) RefreshTokens(ctx context.Context, in *AuthToken, opts ...grpc.CallOption) (*AuthTokens, error) {
|
|
out := new(AuthTokens)
|
|
err := c.cc.Invoke(ctx, "/authentication.Authentication/RefreshTokens", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *authenticationClient) VerifyToken(ctx context.Context, in *AuthToken, opts ...grpc.CallOption) (*ValidationResult, error) {
|
|
out := new(ValidationResult)
|
|
err := c.cc.Invoke(ctx, "/authentication.Authentication/VerifyToken", 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 {
|
|
GetTokens(context.Context, *AuthCode) (*AuthTokens, error)
|
|
RefreshTokens(context.Context, *AuthToken) (*AuthTokens, error)
|
|
VerifyToken(context.Context, *AuthToken) (*ValidationResult, error)
|
|
mustEmbedUnimplementedAuthenticationServer()
|
|
}
|
|
|
|
// UnimplementedAuthenticationServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedAuthenticationServer struct {
|
|
}
|
|
|
|
func (UnimplementedAuthenticationServer) GetTokens(context.Context, *AuthCode) (*AuthTokens, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetTokens not implemented")
|
|
}
|
|
func (UnimplementedAuthenticationServer) RefreshTokens(context.Context, *AuthToken) (*AuthTokens, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method RefreshTokens not implemented")
|
|
}
|
|
func (UnimplementedAuthenticationServer) VerifyToken(context.Context, *AuthToken) (*ValidationResult, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method VerifyToken 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_GetTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(AuthCode)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthenticationServer).GetTokens(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/authentication.Authentication/GetTokens",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthenticationServer).GetTokens(ctx, req.(*AuthCode))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Authentication_RefreshTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(AuthToken)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthenticationServer).RefreshTokens(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/authentication.Authentication/RefreshTokens",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthenticationServer).RefreshTokens(ctx, req.(*AuthToken))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Authentication_VerifyToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(AuthToken)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthenticationServer).VerifyToken(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/authentication.Authentication/VerifyToken",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthenticationServer).VerifyToken(ctx, req.(*AuthToken))
|
|
}
|
|
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: "authentication.Authentication",
|
|
HandlerType: (*AuthenticationServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "GetTokens",
|
|
Handler: _Authentication_GetTokens_Handler,
|
|
},
|
|
{
|
|
MethodName: "RefreshTokens",
|
|
Handler: _Authentication_RefreshTokens_Handler,
|
|
},
|
|
{
|
|
MethodName: "VerifyToken",
|
|
Handler: _Authentication_VerifyToken_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "protobufs/authentication.proto",
|
|
}
|