Documentation
¶
Index ¶
- func NewRepository(dbExecutor db.DBTX, logger *zerolog.Logger) *repository
- func Routes(h *Handler, authMW *middle.AuthMiddleware) chi.Router
- type ChangePasswordRequest
- type CreateUserCmd
- type GetProfileResponse
- type Handler
- func (h *Handler) ChangePassword(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetProfile(w http.ResponseWriter, r *http.Request)
- func (h *Handler) LogIn(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Register(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SetupStatus(w http.ResponseWriter, r *http.Request)
- func (h *Handler) UpdateProfile(w http.ResponseWriter, r *http.Request)
- type LogInRequest
- type LogInResponse
- type LogInUserCmd
- type LogInUserResult
- type RegisterRequest
- type RegisterResponse
- type Service
- func (s *Service) ChangePassword(ctx context.Context, userID uuid.UUID, currentPw, newPw string) error
- func (s *Service) DecrementMonitorCount(ctx context.Context, userID uuid.UUID) error
- func (s *Service) GetProfile(ctx context.Context, userId uuid.UUID) (User, error)
- func (s *Service) GetUserByID(ctx context.Context, userID uuid.UUID) (User, error)
- func (s *Service) IncrementMonitorCount(ctx context.Context, userID uuid.UUID) error
- func (s *Service) IsUserActive(ctx context.Context, userID uuid.UUID) (bool, error)
- func (s *Service) LogIn(ctx context.Context, data LogInUserCmd) (LogInUserResult, error)
- func (s *Service) Register(ctx context.Context, data CreateUserCmd) (uuid.UUID, error)
- func (s *Service) SetupStatus(ctx context.Context) (bool, error)
- func (s *Service) UpdateProfile(ctx context.Context, userID uuid.UUID, name string) error
- type SetupStatusResponse
- type UpdateProfileRequest
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChangePasswordRequest ¶ added in v0.1.2
type CreateUserCmd ¶
type GetProfileResponse ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) ChangePassword ¶ added in v0.1.2
func (h *Handler) ChangePassword(w http.ResponseWriter, r *http.Request)
func (*Handler) GetProfile ¶
func (h *Handler) GetProfile(w http.ResponseWriter, r *http.Request)
func (*Handler) SetupStatus ¶ added in v0.1.2
func (h *Handler) SetupStatus(w http.ResponseWriter, r *http.Request)
func (*Handler) UpdateProfile ¶ added in v0.1.2
func (h *Handler) UpdateProfile(w http.ResponseWriter, r *http.Request)
type LogInRequest ¶
type LogInResponse ¶
type LogInUserCmd ¶
type LogInUserResult ¶
type RegisterRequest ¶
type RegisterResponse ¶
type RegisterResponse struct {
UserID string `json:"user_id"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo *repository, tokenSvc *security.TokenService) *Service
func (*Service) ChangePassword ¶ added in v0.1.2
func (*Service) DecrementMonitorCount ¶ added in v0.1.2
func (*Service) GetProfile ¶
func (*Service) GetUserByID ¶
func (*Service) IncrementMonitorCount ¶
func (*Service) IsUserActive ¶ added in v0.1.2
func (*Service) LogIn ¶
func (s *Service) LogIn(ctx context.Context, data LogInUserCmd) (LogInUserResult, error)
func (*Service) SetupStatus ¶ added in v0.1.2
type SetupStatusResponse ¶ added in v0.1.2
type SetupStatusResponse struct {
RegistrationsEnabled bool `json:"registrations_enabled"`
}
type UpdateProfileRequest ¶ added in v0.1.2
type UpdateProfileRequest struct {
Name string `json:"name" validate:"required,min=2,max=100"`
}
Click to show internal directories.
Click to hide internal directories.