Skip to content

arthben/http_jwt_crud

Repository files navigation

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

About

Go HTTP with JWT and SQLX

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages