http_jwt_crud

module
v0.0.0-...-1422b68 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT

README

http_jwt_crud

This repo demonstrate

  • Go HTTP ( with middleware )
  • Structure Log ( slog package )
  • JWT Authentication ( Bearer )
  • Signature to validate request
  • Simple CRUD with SQLX package
  • Swagger API Documentation
  • CI with Github Action on Pull Request

Table structure

CREATE TABLE todos (
	id varchar(64),
	title varchar(256),
	detail text,
	created_date timestamp,
	updated_date timestamp,
	st_completed char(1),
	completed_date timestamp,
	primary key(id)
) engine=Innodb;

Swagger ( API Documentation )

Install swagger with Golang

$ go get -u github.com/swaggo/swag

To generate docs, run this command

$ swag init -g api/handlers/handlers.go

To view swagger documentation, open in the browser

http://[ip:port]/swagger/index.html

Directories

Path Synopsis
api
cmd
http_jwt_crud command
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
internal
pkg

Jump to

Keyboard shortcuts

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