user

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUser

func CreateUser(ctx context.Context, email, password string, userService *Service, groupService groupService, groupName, namespace, userType string) error

func NewRepository

func NewRepository(db *gorm.DB) *repository

func Routes

func Routes(r *gin.Engine, authenticationMiddleware middleware.AuthenticationMiddleware, authorizationMiddleware middleware.AuthorizationMiddleware, handler Handler)

Types

type Handler

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

func NewHandler

func NewHandler(logger *slog.Logger, hostname string, sameSiteMode http.SameSite, accessTokenExpirationSeconds int, refreshTokenExpirationSeconds int, refreshTokenRememberMeExpirationSeconds int, publicKey rsa.PublicKey, userService *Service, tokenService tokenService) Handler

func (Handler) Delete

func (h Handler) Delete(c *gin.Context)

Delete user

func (Handler) FindAll

func (h Handler) FindAll(c *gin.Context)

FindAll user

func (Handler) FindById

func (h Handler) FindById(c *gin.Context)

FindById user

func (Handler) Me

func (h Handler) Me(c *gin.Context)

Me user

func (Handler) RefreshToken

func (h Handler) RefreshToken(c *gin.Context)

RefreshToken user

func (Handler) RequestPasswordReset

func (h Handler) RequestPasswordReset(c *gin.Context)

func (Handler) ResetPassword

func (h Handler) ResetPassword(c *gin.Context)

func (Handler) SignIn

func (h Handler) SignIn(c *gin.Context)

SignIn user

func (Handler) SignOut

func (h Handler) SignOut(c *gin.Context)

SignOut user

func (Handler) SignUp

func (h Handler) SignUp(c *gin.Context)

SignUp user

func (Handler) Update

func (h Handler) Update(c *gin.Context)

Update user

func (Handler) ValidateEmail

func (h Handler) ValidateEmail(c *gin.Context)

ValidateEmail validate users email

type RefreshTokenRequest

type RefreshTokenRequest struct {
	RefreshToken string `json:"refreshToken"`
}

type RequestPasswordResetRequest

type RequestPasswordResetRequest struct {
	Email string `json:"email" binding:"required,email"`
}

type ResetPasswordRequest

type ResetPasswordRequest struct {
	Token    string `json:"token" binding:"required"`
	Password string `json:"password" binding:"required,gte=24,lte=128"`
}

type Service

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

func NewService

func NewService(uiUrl string, passwordTokenTtl uint, repository *repository, dialer dailer) *Service

func (Service) Delete

func (s Service) Delete(ctx context.Context, id uint) error

func (Service) FindAll

func (s Service) FindAll(ctx context.Context) ([]*model.User, error)

func (Service) FindById

func (s Service) FindById(ctx context.Context, id uint) (*model.User, error)

func (Service) FindOrCreate

func (s Service) FindOrCreate(ctx context.Context, email string, password string) (*model.User, error)

func (Service) RequestPasswordReset

func (s Service) RequestPasswordReset(ctx context.Context, email string) error

func (Service) ResetPassword

func (s Service) ResetPassword(ctx context.Context, token string, password string) error

func (Service) Save

func (s Service) Save(ctx context.Context, user *model.User) error

func (Service) SignIn

func (s Service) SignIn(ctx context.Context, email string, password string) (*model.User, error)

func (Service) SignUp

func (s Service) SignUp(ctx context.Context, email string, password string) (*model.User, error)

func (Service) Update

func (s Service) Update(ctx context.Context, id uint, email, password string) (*model.User, error)

func (Service) ValidateEmail

func (s Service) ValidateEmail(ctx context.Context, token uuid.UUID) error

Jump to

Keyboard shortcuts

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