usergrp

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const BasePath = "/users"
View Source
const LoginUserPath = v1.Version + BasePath + "/login"
View Source
const RegisterUserPath = v1.Version + BasePath + "/register"

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func New

func New(user *user.Core, auth *auth.Auth) *Handler

func (*Handler) LoginUser

func (h *Handler) LoginUser(ctx context.Context, w http.ResponseWriter, r *http.Request) error

@Summary Login a user @Description Login a user with email and password @Tags users @Accept json @Produce json @Param credentials body user.UserCredentials true "User Credentials" @Success 200 {object} user.User @Failure 400 {object} v1.ErrorResponse @Failure 404 {object} v1.ErrorResponse @Router /v1/users/login [post]

func (*Handler) RegisterUser

func (h *Handler) RegisterUser(ctx context.Context, w http.ResponseWriter, r *http.Request) error

@Summary Register a new user @Description Register a new user with email and password @Tags users @Accept json @Produce json @Param newUser body user.NewUser true "New User" @Success 201 {object} user.User @Failure 400 {object} v1.ErrorResponse @Router /v1/users/register [post]

Jump to

Keyboard shortcuts

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