ingress

command module
v0.0.0-...-62f0cde Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

README

ingress
-------

|Go Report Card| |PkgGoDev|

network-related controller for database comms. Built with `gorilla/mux`_ and `jmoiron/sqlx`_

package-structure
~~~~~~~~~~~~~~~~~

::
 
    .
    ├── api             
    │   ├── handlers            # specific routes for each handler
    │   ├── httputil            # general http error
    │   └── middleware          # contains rate-limiter and authentication middleware (todo)
    ├── docs                     
    │   ├── rest                # contains swagger handler
    │   └── ui                  # go binary of ui
    ├── bin                     # contains binary file
    ├── configs                 # trade secrets lies here
    └── internal
        ├── models              # database models
        │   └── mocks
        ├── repository          # CRUD (Postgres)
        └── services            # handling connection between repository and api/handlers

description
~~~~~~~~~~~

- The package implements `Uncle Bob's Clean Architecture`_. This is probably the first time I forced myself to follow the `twelve-factor app`_ methodology and came accross Uncle Bob's.
- refers to the `main README.rst`_ for docker and k8s instruction

local instruction
~~~~~~~~~~~~~~~~~
- ``go run server.go``, and you should see at ``localhost:8080`` as below

.. code-block:: json

    "ProxyAlive":true,
    "StreamAlive":true


todo
~~~~

-  ☐ added authentication
-  ☐ fixed rate-limiter
-  ☐ **finish test code**
-  ☒ improved Swagger docs with more detailed response model

.. _main README.rst: https://github.com/aarnphm/dha-ps/blob/master/README.rst

.. _twelve-factor app: https://12factor.net/

.. _Uncle Bob's Clean Architecture: https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html

.. _gorilla/mux: https://github.com/gorilla/mux

.. _jmoiron/sqlx: https://github.com/jmoiron/sqlx

.. |PkgGoDev| image:: https://pkg.go.dev/badge/mod/github.com/aarnphm/dha-ps/ingress
   :target: https://pkg.go.dev/mod/github.com/aarnphm/dha-ps/ingress
   
.. |Go Report Card| image:: https://goreportcard.com/badge/github.com/aarnphm/dha-ps
   :target: https://goreportcard.com/report/github.com/aarnphm/dha-ps

Documentation

Overview

package ingress defines network cotroller and reverse proxy connection

Directories

Path Synopsis
api
handlers
Package handlers controls network routing and rate limiter for each route
Package handlers controls network routing and rate limiter for each route
httputil
Package httputil defines possible errors in HTTP request
Package httputil defines possible errors in HTTP request
middleware
Package middleware defines possible middleware that can be used by router
Package middleware defines possible middleware that can be used by router
Package docs defines swagger docs for API specification
Package docs defines swagger docs for API specification
internal
models
Package models defines default model layer for each database structures This is also known as domain layer in Uncle Bob's Clean Architecture
Package models defines default model layer for each database structures This is also known as domain layer in Uncle Bob's Clean Architecture
repository/postgres
Package defines CRUD comms between service layer with model layer in postgres
Package defines CRUD comms between service layer with model layer in postgres
services
Package services defines connection between business layer and repository layer
Package services defines connection between business layer and repository layer

Jump to

Keyboard shortcuts

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