services

package
v0.0.0-...-d3087b5 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const TOKEN_DURATION time.Duration = time.Minute * 30

Variables

View Source
var ErrEmailTaken error = errors.New("ErrEmailTaken")
View Source
var ErrInvalidPassword error = errors.New("ErrInvalidPassword")
View Source
var ErrInvalidToken error = errors.New("ErrInvalidToken")
View Source
var ErrParsingJWTToken error = errors.New("ErrParsingJWTToken")
View Source
var ErrPasswordIncorrect error = errors.New("ErrPasswordIncorrect")

Functions

This section is empty.

Types

type JWTScopeClaims

type JWTScopeClaims struct {
	UserID int32  `json:"userId"`
	Email  string `json:"email"`
	jwt.RegisteredClaims
}

type ServiceMesh

type ServiceMesh struct {
	UserAuthenticationService UserAuthenticationService
	// contains filtered or unexported fields
}

func NewServiceMesh

func NewServiceMesh(ctx context.Context, logger *slog.Logger, dbQueries *queries.Queries) ServiceMesh

type UserAuthenticationService

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

func NewUserAuthenticationService

func NewUserAuthenticationService(ctx context.Context, logger *slog.Logger, dbQueries *queries.Queries) UserAuthenticationService

func (*UserAuthenticationService) EmailIsValid

func (obj *UserAuthenticationService) EmailIsValid(email string) bool

func (*UserAuthenticationService) GenerateJWT

func (obj *UserAuthenticationService) GenerateJWT(user *queries.User) (string, error)

func (*UserAuthenticationService) HashPassword

func (obj *UserAuthenticationService) HashPassword(password string) (string, error)

func (*UserAuthenticationService) PasswordIsValid

func (obj *UserAuthenticationService) PasswordIsValid(password string) bool

func (*UserAuthenticationService) PasswordMatchesUserPassword

func (obj *UserAuthenticationService) PasswordMatchesUserPassword(passwordHash, password string) bool

func (*UserAuthenticationService) Signin

func (obj *UserAuthenticationService) Signin(ctx context.Context, email, password string) (string, error)

func (*UserAuthenticationService) Signup

func (obj *UserAuthenticationService) Signup(ctx context.Context, email string, password string) (*queries.User, error)

func (*UserAuthenticationService) UserFromEchoContext

func (obj *UserAuthenticationService) UserFromEchoContext(echoCtx echo.Context) (*queries.User, error)

Jump to

Keyboard shortcuts

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