Compare commits
6 Commits
4a673d1894
...
0.1.1
Author | SHA1 | Date | |
---|---|---|---|
64efaf5514 | |||
8d320f96cd | |||
75c5e7ea4c | |||
e6e668451a | |||
9528fca452 | |||
cf95ee2acb |
@@ -7,17 +7,19 @@ on:
|
|||||||
|
|
||||||
name: SonarQube Scan
|
name: SonarQube Scan
|
||||||
jobs:
|
jobs:
|
||||||
sonarqube:
|
build:
|
||||||
name: SonarQube Trigger
|
name: Build and analyze
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checking out
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
with:
|
||||||
with:
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||||
# Disabling shallow clone is recommended for improving relevancy of reporting
|
- uses: SonarSource/sonarqube-scan-action@v4
|
||||||
fetch-depth: 0
|
env:
|
||||||
- name: SonarQube Scan
|
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
||||||
uses: kitabisa/sonarqube-action@v1.2.0
|
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
|
||||||
with:
|
- uses: SonarSource/sonarqube-quality-gate-action@v1
|
||||||
host: ${{ secrets.SONARQUBE_HOST }}
|
timeout-minutes: 5
|
||||||
login: ${{ secrets.SONARQUBE_TOKEN }}
|
env:
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
@@ -1,5 +1,7 @@
|
|||||||
# gosearch
|
# gosearch
|
||||||
|
|
||||||
|
[](https://sonar.dev-null.rocks/dashboard?id=gosearch)
|
||||||
|
|
||||||
### Diagram of the Architecture
|
### Diagram of the Architecture
|
||||||
|
|
||||||
```mermaid
|
```mermaid
|
||||||
|
@@ -2,6 +2,7 @@ package http
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"github.com/gofiber/fiber/v2/log"
|
||||||
"github.com/gofiber/fiber/v2/middleware/logger"
|
"github.com/gofiber/fiber/v2/middleware/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -12,6 +13,7 @@ func StartService() {
|
|||||||
app.Use(logger.New(logger.Config{
|
app.Use(logger.New(logger.Config{
|
||||||
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
|
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
|
||||||
}))
|
}))
|
||||||
|
log.SetLevel(log.LevelInfo)
|
||||||
|
|
||||||
// Configure Routes
|
// Configure Routes
|
||||||
app = configureRoutes(app)
|
app = configureRoutes(app)
|
||||||
|
@@ -87,7 +87,7 @@ func AddDocToIndex(url string, content string) {
|
|||||||
scanner.Split(bufio.ScanWords)
|
scanner.Split(bufio.ScanWords)
|
||||||
|
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
word := strings.ToLower(strings.Trim(scanner.Text(), ",.!?"))
|
word := strings.ToLower(strings.Trim(scanner.Text(), ",.!?&<>;:=§$%{}[]()|"))
|
||||||
|
|
||||||
if Index[word] == nil {
|
if Index[word] == nil {
|
||||||
Index[word] = make(map[string]int)
|
Index[word] = make(map[string]int)
|
||||||
@@ -100,7 +100,7 @@ func AddDocToIndex(url string, content string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateIndex("default")
|
go updateIndex("default")
|
||||||
}
|
}
|
||||||
|
|
||||||
func writeStructToFile(filename string, data interface{}) error {
|
func writeStructToFile(filename string, data interface{}) error {
|
||||||
|
1
sonar-project.properties
Normal file
1
sonar-project.properties
Normal file
@@ -0,0 +1 @@
|
|||||||
|
sonar.projectKey=gosearch
|
Reference in New Issue
Block a user