Discover Packages
github.com/saferwall/saferwall-api
module
Version:
v0.2.0
Opens a new window with list of versions in this module.
Published: Aug 31, 2021
License: Apache-2.0
Opens a new window with license information.
README
README
¶
saferwall web apis
Preface
This repository powers the web service api used in https://saferwall.com .
Vendoring
These packages are used in the project:
Available Endpoints
The following endpoints are available:
Activities
Authentication
Users resource
User resource
User actions
Files resource
File resource
File actions
Rules for mapping HTTP methods to CRUD:
POST - Create (add record into database)
GET - Read (get record from the database)
PATCH - Update (edit record in the database)
PUT - Replace (replace record in the database)
DELETE - Delete (remove record from the database)
Rules for HTTP status codes:
* Create something - 201 (Created)
* Read something - 200 (OK)
* Update something - 200 (OK)
* Delete something - 200 (OK)
* Missing request information - 400 (Bad Request)
* Unauthorized operation - 401 (Unauthorized)
* Any other error - 500 (Internal Server Error)
Folder Structure
This project follows the Standard Go Project Layout
build - contains packaging and Continuous Integration files.
cmd - contains the main function.
configs - contains configuration file templates or default configs.
docs - contains design and user documents.
internal - contains project specific packages with dependencies.
pkg - contains generic packages without project specific dependencies - these can be safely moved to other projects without internal dependencies.
Improvements compared to the previous implementation
clean architecture with solid principles.
Full test coverage
swagger doc
Error handling with proper error response generation
details:
File{} not depending on peparser.
References
Expand ▾
Collapse ▴
Directories
¶
internal
config
Package consumer implements the NSQ worker logic.
Package consumer implements the NSQ worker logic.
pkg
log
Package log provides context-aware and structured logging capabilities.
Package log provides context-aware and structured logging capabilities.
pagination
Package pagination provides support for pagination requests and responses.
Package pagination provides support for pagination requests and responses.
Click to show internal directories.
Click to hide internal directories.