generated from just-the-docs/just-the-docs-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ahujatejas06/cmd_pages
Made some cmd pages
- Loading branch information
Showing
13 changed files
with
272 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
title: RAS-Backend Documentation | ||
description: A guide to understanding the backend server of RAS. | ||
theme: just-the-docs | ||
logo: "/assets/images/spoLogo.webp" | ||
|
||
callouts: | ||
info: | ||
title: Information | ||
color: green | ||
search: | ||
button: true | ||
note: | ||
title: Note | ||
color: blue | ||
color: blue |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
title : admin | ||
layout : default | ||
nav_order: 1 | ||
parent : cmd | ||
--- | ||
|
||
# admin.go | ||
|
||
|
||
|
||
The Go viper package is used to read the [config.yaml configuration constants file]() and get the port of the various administrator services. A new Go engine is initialized and the required middlewares are attached to it. | ||
|
||
|
||
## function adminRCServer | ||
It returns an http server instance for listening to requests of the mail service. | ||
|
||
{: .info} | ||
The adminRC service is hosted on port 3490. | ||
|
||
### Middlewares Attached to the process | ||
- [CORS]() : Custom middleware to allow cross-origin requests. | ||
- [Authenticator]() : Custom middleware to get the role ID of the user using the service. | ||
- [EnsurePsuedoAdmin]() : Custom middleware to ensure that the role ID is that of a pseudo admin. (OPC, GOD, APC and Chairman) | ||
- Recovery | ||
- Logger | ||
|
||
Initialized service is passed to [adminRC router](). | ||
|
||
## function adminApplicationServer | ||
Same as [adminRCServer]() except the fact the service is passed to [Application admin router](). | ||
|
||
{: .info} | ||
The adminApplication service is hosted on port 3492. | ||
|
||
## function adminCompanyServer | ||
Same as [adminRCServer]() except the fact the service is passed to [Company admin router](). | ||
|
||
{: .info} | ||
The adminCompany service is hosted on port 3495. | ||
|
||
## function adminStudentServer | ||
Same as [adminRCServer]() except the fact the service is passed to [Student admin router](). | ||
|
||
{: .info} | ||
The adminStudent service is hosted on port 3500. | ||
|
||
--- | ||
#### References | ||
- [Go Engines]() | ||
- [Go Logger middleware]() | ||
- [Go recovery middleware]() | ||
- [Go Viper module]() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
title : auth | ||
layout : default | ||
nav_order: 2 | ||
parent : cmd | ||
--- | ||
|
||
# auth.go | ||
|
||
This file configures the mail service handler for the authentication service. | ||
|
||
## function authServer | ||
It returns an http server instance of the started server for broadcasting content on the mail channel. | ||
|
||
The Go viper package is used to read the [config.yaml configuration constants file]() and get the port of the authentication service. A new Go engine is initialized and the required middlewares are attached to it. | ||
|
||
{: .info} | ||
The authentication service is hosted on port 3475. | ||
|
||
### Middlewares Attached to the process | ||
- CORS - Cross-Origin Resource Sharing : Custom middleware to allow cross-origin requests. | ||
- Recovery (Standard Go middleware) : to recover from any panic | ||
- Logger (Standard Go Middleware) : To log the status | ||
- Gin middleware | ||
|
||
Initialized service is passed to [auth router]. | ||
|
||
--- | ||
#### References | ||
- [Go Engines]() | ||
- [Go Logger middleware]() | ||
- [Go recovery middleware]() | ||
- [Go Viper module]() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
title : cmd | ||
layout : default | ||
nav_order: 7 | ||
has_children: true | ||
--- | ||
|
||
# main.go | ||
|
||
A mail service is initialized in a goroutine and passed on to the following handlers. The errors are returned to the main function and logged by the logger. | ||
|
||
{: .info} | ||
Mail read and write API call timeouts are defined to 5 seconds and 10 seconds respectively. The mailer works instantly. | ||
|
||
The service is passed on to the following handlers. The handlers are defined in the [overview]({{ site.baseurl }}{% link docs/overview.md %}) for reference. | ||
|
||
- Auth | ||
- RAS | ||
- Student | ||
- Company | ||
- Admin RC | ||
- Admin Application | ||
- Admin Student | ||
- Admin Company | ||
|
||
--- | ||
#### References | ||
- [chan - Go Command](https://www.sohamkamani.com/golang/channels/) | ||
- [errgroup](https://pkg.go.dev/golang.org/x/sync/errgroup) | ||
- [Go Routines](https://go.dev/tour/concurrency/1) | ||
- [Gin multiple port http services](https://github.com/gin-gonic/gin/issues/346) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title : company | ||
layout : default | ||
nav_order: 3 | ||
parent : cmd | ||
--- | ||
|
||
# company.go | ||
Similar to other handler files, this file configures the mail service handler to be passed to the company router. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title : ras | ||
layout : default | ||
nav_order: 4 | ||
parent : cmd | ||
--- | ||
|
||
# ras.go | ||
Similar to other handler files, this file configures the mail service handler to be passed to the ras router. | ||
|
||
{: .info} | ||
The RAS service doesn't require authentication as is is just used to test the mail service and send a testing mail. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
title : student | ||
layout : default | ||
nav_order: 5 | ||
parent : cmd | ||
--- | ||
|
||
# student.go | ||
|
||
Similar to other handler files, this file configures the mail service handler to be passed to the student router. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title : Logged Errors | ||
layout : default | ||
nav_order: 17 | ||
has_children : true | ||
--- | ||
|
||
# Common logged errors | ||
This file lists down the various common errors encountered while developing, building and deploying the application. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters