Skip to content

Latest commit

 

History

History
 
 

hertz_jwt

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

hertz_jwt

Introduce

A demo with Hertz and JWT

  • Use hz to generate code
  • Use JWT to complete login and authentication
  • Use Gorm and MySQL

JWT

Use Hertz's JWT extension, refer to jwt

Code generation tool

This demo use hz to generate code. The use of hz refers to hz

The hz commands used can be found in Makefile

Binding and Validate

The use of binding and Validate refers to Binding and Validate

Gorm

This demo use Gorm to operate MySQL and refers to Gorm

How to run

Run mysql docker

cd bizdemo/hertz_jwt && docker-compose up

Run demo

cd bizdemo/hertz_jwt && go run main.go