control

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginRequest

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

type LoginResponse

type LoginResponse struct {
	Token string `json:"token"`
	User  User   `json:"user"`
}

type User

type User struct {
	ID    uint   `json:"id"`
	Email string `json:"email"`
	Name  string `json:"name"`
}

type UserController

type UserController struct {
	forge.Controller
}

func (*UserController) HandleGetUser

func (c *UserController) HandleGetUser(ctx *forge.Context) error

HandleGetUser handles getting a user by ID @route GET /users/:id @desc Get a user by ID @param id path int true "User ID" @response 200 User

func (*UserController) HandlePostLogin

func (c *UserController) HandlePostLogin(ctx *forge.Context) error

HandlePostLogin handles user login @route POST /login @desc Authenticate a user @body LoginRequest @response 200 LoginResponse

Jump to

Keyboard shortcuts

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