usecases

package
v0.0.0-...-3122bcc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWrongCredentials = myerrors.NewErrorBadContentRequest("Некорректный логин или пароль")

Functions

This section is empty.

Types

type AuthService

type AuthService struct {
	// contains filtered or unexported fields
}

func NewAuthService

func NewAuthService(authStorage IAuthStorage) (*AuthService, error)

func (*AuthService) AddUser

func (a *AuthService) AddUser(ctx context.Context, email string, password string) (string, error)

func (*AuthService) Check

func (a *AuthService) Check(_ context.Context, rawJwt string) (uint64, error)

func (*AuthService) Delete

func (a *AuthService) Delete(ctx context.Context, rawJwt string) (string, error)

func (*AuthService) LoginUser

func (a *AuthService) LoginUser(ctx context.Context, email string, password string) (string, error)

type IAuthStorage

type IAuthStorage interface {
	AddUser(ctx context.Context, email string, password string) (*models.User, error)
	GetUser(ctx context.Context, email string) (*models.User, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL