scv-go-tools

module
v3.8.8 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT

README

scv-go-tools v3

CI Coverage Go Reference

Tools for building REST APIs in Go.

Included packages

  • api/middlewares: provides Middlewares for panic recovering and JWT authentication & role-based authorization.
  • api/utils: provides JSON success & error responses with http status codes management and a function for unmarshalling JSON files into structs.
  • infrastructure: provides MongoDB and PostgreSQL connection functions, a migration runner for PostgresDB and a generic implemention of the Repository interface for MongoDB.
  • mocks: provides mock creation functions for MongoDB and PostgreSQL.
  • repository: provides an interface of the repository pattern with CRUD operations.
  • wrappers: provides convenient wraps for having custom types.
  • testutils: provides convenient testing helper functions.

Usage steps

  1. Create an empty repository and clone it.
  2. Execute:
go mod init github.com/{username}/{repository_name}
go get github.com/sergicanet9/scv-go-tools/v3

Run all unit tests with code coverage

make test-unit

View coverage report

make cover

Usage examples

go-hexagonal-restapi

Author

Sergi Canet Vela

License

This project is licensed under the terms of the MIT license.

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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