-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Daksh Chauhan <dak-x@outlook.com>
- Loading branch information
Showing
5 changed files
with
53 additions
and
18 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
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 |
---|---|---|
|
@@ -5,4 +5,3 @@ go 1.16 | |
require github.com/gin-gonic/gin v1.7.2 | ||
|
||
require github.com/elastic/go-elasticsearch/v7 v7.13.1 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package models | ||
|
||
type HtmlDocument struct { | ||
Url string `json:"url"` | ||
Dom string `json:"dom"` | ||
} | ||
|
||
// For elastic-search indexing | ||
const HtmlDocumentMapping string = `"mappings": { | ||
"properties": { | ||
"url" : {"type" : ""}, | ||
"htmltext" : {"type" : "text"}, | ||
"time_of_registry" : {"type" : "date"}, | ||
} | ||
}` |
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 @@ | ||
package utils | ||
|
||
import "log" | ||
|
||
func HandleFatalError(logMessage string, err error) { | ||
if err != nil { | ||
log.Fatalf("%s %s", logMessage, err) | ||
} | ||
} |