v1

package
v0.0.0-...-7de9431 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleHealthcheck

func HandleHealthcheck(ctx *gin.Context)

Types

type AuthHandler

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

func NewAuthHandler

func NewAuthHandler(conf *config.APIConfig, svc AuthService) *AuthHandler

func (*AuthHandler) HandleLogin

func (h *AuthHandler) HandleLogin(ctx *gin.Context)

HandleLogin godoc @Summary Login a user @Tags auth @Produce json @Param request body request.LoginRequest true "request body" @Success 200 {object} domain.User @Failure 401 {object} response.Err @Failure 500 {object} response.Err @Router /auth/login [post]

func (*AuthHandler) HandleSignup

func (h *AuthHandler) HandleSignup(ctx *gin.Context)

HandleSignup godoc @Summary Signup a new user @Tags auth @Produce json @Param request body request.SignupRequest true "request body" @Success 201 {object} domain.User @Failure 400 {object} response.Err @Failure 500 {object} response.Err @Router /auth/signup [post]

type AuthService

type AuthService interface {
	Signup(ctx context.Context, user domain.User) (domain.User, error)
	Login(ctx context.Context, email, password string) (domain.User, error)
}

type UserHandler

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

func NewUserHandler

func NewUserHandler(svc UserService) *UserHandler

func (*UserHandler) HandleGetUser

func (h *UserHandler) HandleGetUser(ctx *gin.Context)

HandleGetUser godoc @Summary Get a user @Tags users @Produce json @Param userID path int true "user ID" @Success 200 {object} domain.User @Failure 401 {object} response.Err @Failure 500 {object} response.Err @Router /users/{userID} [get]

type UserService

type UserService interface {
	GetUser(ctx context.Context, id uint) (domain.User, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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