user

package
v0.0.0-...-9254706 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	Login(ctx *fiber.Ctx) error
	Get(ctx *fiber.Ctx) error
	Me(ctx *fiber.Ctx) error
	Create(ctx *fiber.Ctx) error
	Update(ctx *fiber.Ctx) error
	UpdatePassword(ctx *fiber.Ctx) error
	Delete(ctx *fiber.Ctx) error
}

type CreateRequestPayload

type CreateRequestPayload struct {
	DisplayName string `json:"display_name" validate:"required,min=1,max=50"`
	Username    string `json:"username" validate:"required,min=5,max=30"`
	Email       string `json:"email" validate:"required,email"`
	Password    string `json:"password" validate:"required,min=8"`
}

type DeleteRequestPayload

type DeleteRequestPayload struct {
	Password string `json:"password" validate:"required,min=8"`
}

type LoginRequestPayload

type LoginRequestPayload struct {
	Username string `json:"username" validate:"required,min=5,max=30"`
	Password string `json:"password" validate:"required,min=8"`
}

type Router

type Router interface {
	Setup(app fiber.Router) fiber.Router
}

type Service

type Service interface {
	Login(rp *LoginRequestPayload) (*map[string]any, error)
	Get(id int) (*map[string]any, error)
	Me(loggedUserId int) (*map[string]any, error)
	Create(rp *CreateRequestPayload) (*map[string]any, error)
	Update(loggedUserId int, rp *UpdateRequestPayload) (*map[string]any, error)
	UpdatePassword(loggedUserId int, rp *UpdatePasswordRequestPayload) error
	Delete(loggedUserId int, rp *DeleteRequestPayload) error
}

type UpdatePasswordRequestPayload

type UpdatePasswordRequestPayload struct {
	OldPassword             string `json:"old_password" validate:"required,min=8"`
	NewPassword             string `json:"new_password" validate:"required,min=8"`
	NewPasswordConfirmation string `json:"new_password_confirmation" validate:"required,min=8"`
}

type UpdateRequestPayload

type UpdateRequestPayload struct {
	DisplayName string `json:"display_name" validate:"required,min=1,max=50"`
	Username    string `json:"username" validate:"required,min=5,max=30"`
	Email       string `json:"email" validate:"required,email"`
	Password    string `json:"password" validate:"required,min=8"`
}

Jump to

Keyboard shortcuts

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