minimum

command module
v0.0.0-...-1561567 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 2 Imported by: 0

README

Go API Boilerplates - gin/minimum

MIT license Tests Go Report Card


This is a minimum example of Go API with gin-gonic/gin.

A full list of libraries used can be found in Dependencies section.

Table of Contents

Development

This project can be booted up either

  • natively with Go installed locally (assuming dependencies like PostgresSQL, Redis, etc. also exist)
  • or by Docker Compose (PostgreSQL, Redis, etc. are included out of the box)

Please refer to Makefile or docker-compose.yml for details.

By default, the server will run at http://localhost:3333, but everything is configurable via .env file.

Tools

Some common development tools are introduced for better local development experience.

go install github.com/cosmtrek/air@latest
go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
go install github.com/swaggo/swag/cmd/swag@latest

Alternatively, use make install to install the required Go tooling locally.

Documentation

This service has integrated swaggo/swag to create OpenAPI documentation automatically.

Use command make generate/api or swag init to run the generation.

Then navigate to http://localhost:3333/swagger/index.html to view the API documentation.

Dependencies

API

Testing

  • stretchr/testify - A toolkit with common assertions and mocks that plays nicely with the standard library

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
app
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
internal
api

Jump to

Keyboard shortcuts

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