Documentation ¶
Index ¶
- Variables
- type CreateUserRequest
- type RegisterRequest
- type UserHandler
- type UserResponse
- type UserService
- type UserServiceImpl
- func (service *UserServiceImpl) CheckPassword(password string, hashedPassword string) error
- func (service *UserServiceImpl) Create(ctx context.Context, req CreateUserRequest) (db.User, error)
- func (service *UserServiceImpl) GetAll(ctx context.Context) ([]db.User, error)
- func (service *UserServiceImpl) GetByEmail(ctx context.Context, email string) (db.User, error)
- func (service *UserServiceImpl) GetByID(ctx context.Context, id int64) (db.User, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var UserEventsChannel = make(chan *pb.Event)
user events channel
Functions ¶
This section is empty.
Types ¶
type CreateUserRequest ¶
type RegisterRequest ¶
type UserHandler ¶
type UserHandler struct { // https://stackoverflow.com/questions/28014591/nameless-fields-in-go-structs UserService *validator.Validate }
func NewUserHandler ¶
func NewUserHandler(service UserService, validate *validator.Validate) UserHandler
func (*UserHandler) GetAllUsers ¶
func (h *UserHandler) GetAllUsers(ctx *gin.Context)
TODO query params
func (*UserHandler) Register ¶
func (h *UserHandler) Register(ctx *gin.Context)
type UserResponse ¶
type UserResponse struct { Uuid uuid.UUID `json:"uuid"` Name string `json:"name"` Email string `json:"email"` IsActive bool `json:"isActive"` ImageID string `json:"imageId"` ImageUrl string `json:"imageUrl"` Role role.Role `json:"role"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` }
func ToUserResponse ¶
func ToUserResponse(user db.User) UserResponse
func ToUserResponseList ¶
func ToUserResponseList(users []db.User) []UserResponse
type UserService ¶
type UserService interface { Create(ctx context.Context, req CreateUserRequest) (db.User, error) GetAll(ctx context.Context) ([]db.User, error) GetByEmail(ctx context.Context, email string) (db.User, error) GetByID(ctx context.Context, id int64) (db.User, error) CheckPassword(password string, hashedPassword string) error }
func NewUserService ¶
func NewUserService(datastore db.DataStore) UserService
type UserServiceImpl ¶
type UserServiceImpl struct {
// contains filtered or unexported fields
}
func (*UserServiceImpl) CheckPassword ¶
func (service *UserServiceImpl) CheckPassword(password string, hashedPassword string) error
func (*UserServiceImpl) Create ¶
func (service *UserServiceImpl) Create(ctx context.Context, req CreateUserRequest) (db.User, error)
func (*UserServiceImpl) GetByEmail ¶
Click to show internal directories.
Click to hide internal directories.