Documentation ¶
Index ¶
- Variables
- type ActivationCodeDTO
- type CustomClaims
- type EditorDTO
- type Handler
- func (h *Handler) ActivateUser(c *fiber.Ctx) error
- func (h *Handler) DeleteUserHandler(c *fiber.Ctx) error
- func (h *Handler) GetAllStatsHandler(c *fiber.Ctx) error
- func (h *Handler) LoginUserHandler(c *fiber.Ctx) error
- func (h *Handler) RegisterEditorHandler(c *fiber.Ctx) error
- func (h *Handler) RegisterUserHandler(c *fiber.Ctx) error
- func (h *Handler) SetupApp(app *fiber.App)
- type Page
- type Repository
- func (r *Repository) ActivateUser(userID string) (*User, error)
- func (r *Repository) AddActivationCode(email, activationCode string) error
- func (r *Repository) DeleteActivationCode(code string) error
- func (r *Repository) DeleteUser(userID string) error
- func (r *Repository) GetCodesCount() (int64, error)
- func (r *Repository) GetCoinsCount() (int64, error)
- func (r *Repository) GetFavListsCount() (int64, error)
- func (r *Repository) GetNewsCount() (int64, error)
- func (r *Repository) GetSpotsCount() (int64, error)
- func (r *Repository) GetTransactionsCount() (int64, error)
- func (r *Repository) GetUser(userID string) (*User, error)
- func (r *Repository) GetUserByEmail(email string) (*User, error)
- func (r *Repository) GetUsers(page, size int) ([]User, int, error)
- func (r *Repository) RegisterUser(user User) (*User, error)
- type Service
- func (s *Service) ActivateUser(email, code string) (*Token, *User, error)
- func (s *Service) DeleteUser(userID string) error
- func (s *Service) GetAllStats() (*Stats, error)
- func (s *Service) GetUsersPageableResponse(pageNumber, size int) (*UsersPageableResponse, error)
- func (s *Service) LoginUser(userCredentialsDTO UserCredentialsDTO) (*Token, *fiber.Cookie, error)
- func (s *Service) RegisterEditor(editorDTO EditorDTO) (*User, error)
- func (s *Service) RegisterUser(userDTO UserDTO) (*User, error)
- type Stats
- type Token
- type User
- type UserCredentialsDTO
- type UserDTO
- type UsersPageableResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var UserAlreadyActivated error = errors.New("User already activated!")
View Source
var UserAlreadyExistError error = errors.New("User already exists")
View Source
var UserNotFound error = errors.New("User not found!")
Functions ¶
This section is empty.
Types ¶
type ActivationCodeDTO ¶
type CustomClaims ¶
type CustomClaims struct { UserType string `json:"userType"` jwt.StandardClaims }
type Handler ¶
type Handler struct {
Service Service
}
func NewHandler ¶
func (*Handler) ActivateUser ¶
func (*Handler) DeleteUserHandler ¶
func (*Handler) GetAllStatsHandler ¶
func (*Handler) LoginUserHandler ¶
func (*Handler) RegisterEditorHandler ¶
func (*Handler) RegisterUserHandler ¶
type Repository ¶
func NewRepository ¶
func NewRepository(uri string) Repository
func (*Repository) ActivateUser ¶
func (r *Repository) ActivateUser(userID string) (*User, error)
func (*Repository) AddActivationCode ¶
func (r *Repository) AddActivationCode(email, activationCode string) error
func (*Repository) DeleteActivationCode ¶
func (r *Repository) DeleteActivationCode(code string) error
func (*Repository) DeleteUser ¶
func (r *Repository) DeleteUser(userID string) error
func (*Repository) GetCodesCount ¶
func (r *Repository) GetCodesCount() (int64, error)
func (*Repository) GetCoinsCount ¶
func (r *Repository) GetCoinsCount() (int64, error)
func (*Repository) GetFavListsCount ¶
func (r *Repository) GetFavListsCount() (int64, error)
func (*Repository) GetNewsCount ¶
func (r *Repository) GetNewsCount() (int64, error)
func (*Repository) GetSpotsCount ¶
func (r *Repository) GetSpotsCount() (int64, error)
func (*Repository) GetTransactionsCount ¶
func (r *Repository) GetTransactionsCount() (int64, error)
func (*Repository) GetUserByEmail ¶
func (r *Repository) GetUserByEmail(email string) (*User, error)
func (*Repository) RegisterUser ¶
func (r *Repository) RegisterUser(user User) (*User, error)
type Service ¶
type Service struct {
Repository Repository
}
func NewService ¶
func NewService(repository Repository) Service
func (*Service) ActivateUser ¶
func (*Service) DeleteUser ¶
func (*Service) GetAllStats ¶
func (*Service) GetUsersPageableResponse ¶
func (s *Service) GetUsersPageableResponse(pageNumber, size int) (*UsersPageableResponse, error)
func (*Service) LoginUser ¶
func (s *Service) LoginUser(userCredentialsDTO UserCredentialsDTO) (*Token, *fiber.Cookie, error)
func (*Service) RegisterEditor ¶
type User ¶
type User struct { ID string `json:"id" bson:"id"` FirstName string `json:"firstName" bson:"firstName"` LastName string `json:"lastName" bson:"lastName""` Email string `json:"email" bson:"email""` Phone string `json:"phone" bson:"phone""` Password string `json:"password" bson:"password"` IsEmailActivate bool `json:"isEmailActivate" bson:"isEmailActivate"` UserType string `json:"userType" bson:"userType"` CreatedAt time.Time `json:"createdAt" bson:"createdAt"` }
type UserCredentialsDTO ¶
type UsersPageableResponse ¶
Click to show internal directories.
Click to hide internal directories.