summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2023-09-04 19:05:57 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2023-09-04 19:05:57 +0530
commit1b9421884f3d403e3406e61cee742bd03d3a0fa5 (patch)
tree2d956abc98a3ff3dc84195c3bad5a0aa2268e95b
parent117d461c4944f189576f0c4967851de458ba6f32 (diff)
Refactoring code
-rw-r--r--README.md10
-rw-r--r--go.mod2
-rw-r--r--idgen/id_generator.go5
-rw-r--r--server.go (renamed from main.go)2
4 files changed, 7 insertions, 12 deletions
diff --git a/README.md b/README.md
index 546c993..4d335e5 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
-# Golang Backend API using Echo for FSI(File System Integrity) Application
-Developing a simple Golang backend API using the [Echo framework](https://github.com/labstack/echo). This API stores IDs and their corresponding hashes in a SQL server and provides functionality to verify if a given hash matches the stored hash for a specific ID. All the communication between the Application and API will secured using TLS encryption(HTTPS).
+# Golang Backend API for FIC (File Integrity Checker) Application
+Developing a simple Golang backend API with the [Echo framework](https://github.com/labstack/echo) for FIC(File Integrity Checker) application. This API stores IDs and their corresponding hashes in a SQL server and provides functionality to verify if a given hash matches the stored hash for a specific ID. All the communication between the Application and API is secured using TLS encryption(HTTPS).
Thereby providing both confidentiality and integrity service that aligns with the CIA (Confidentiality, Integrity, Availability) triad for data security.
## Getting Started
@@ -16,8 +16,8 @@ To get started with this project, follow these steps:
1. Clone this repository to your local machine:
```bash
- git clone https://github.com/justsaumit/go-fsi-api.git
- cd go-fsi-api
+ git clone https://github.com/justsaumit/go-fic-api.git
+ cd go-fic-api
```
2. Initialize and install project dependencies using Go modules:
@@ -31,7 +31,7 @@ To get started with this project, follow these steps:
4. Run the server:
```bash
- go run main.go
+ go run server.go
```
### Usage
diff --git a/go.mod b/go.mod
index 7d3f82d..a0fd901 100644
--- a/go.mod
+++ b/go.mod
@@ -1,4 +1,4 @@
-module github.com/justsaumit/fis-golang
+module github.com/justsaumit/go-fic-api
go 1.21.0
diff --git a/idgen/id_generator.go b/idgen/id_generator.go
index 8c34f41..3659d0e 100644
--- a/idgen/id_generator.go
+++ b/idgen/id_generator.go
@@ -1,4 +1,3 @@
-// id_generator.go
package idgen
import (
@@ -7,19 +6,15 @@ import (
)
const (
- // Define the character set for the generated IDs.
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
- // Define the desired length of the generated IDs.
idLength = 8
)
-// Initialize the random number generator.
func init() {
rand.Seed(time.Now().UnixNano())
}
-// GenerateID generates a short and readable ID.
func GenerateID() string {
id := make([]byte, idLength)
for i := 0; i < idLength; i++ {
diff --git a/main.go b/server.go
index fb9628e..d610b92 100644
--- a/main.go
+++ b/server.go
@@ -6,7 +6,7 @@ import (
"github.com/labstack/echo/v4"
"fmt"
- "github.com/justsaumit/fis-golang/idgen"
+ "github.com/justsaumit/go-fic-api/idgen"
)
type HelloWorld struct {