Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DCSG2900-ThreatTotal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johannes Barstad
DCSG2900-ThreatTotal
Commits
d14202b2
Commit
d14202b2
authored
3 years ago
by
Jonas Kjærandsen
Browse files
Options
Downloads
Patches
Plain Diff
Removed unused code
parent
64f1bb97
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
storage/redis.go
+0
-81
0 additions, 81 deletions
storage/redis.go
with
0 additions
and
81 deletions
storage/redis.go
+
0
−
81
View file @
d14202b2
...
@@ -44,84 +44,3 @@ func AddToPool(key string, timeout int, data string) {
...
@@ -44,84 +44,3 @@ func AddToPool(key string, timeout int, data string) {
// Print the response to adding the data (should be "OK"
// Print the response to adding the data (should be "OK"
fmt
.
Println
(
response
)
fmt
.
Println
(
response
)
}
}
// Filter creation, creates filters for id, hash and urls
/*
func CreateFilters() {
type Test5 struct {
Values []string `json:"values"`
}
var test Test5
var hashFilter [2]string
var idFilter [2]string
idFilter[0] = "id1"
idFilter[1] = "id2"
hashFilter[0] = "hash1"
hashFilter[1] = "hash2"
test.Values = make([]string, 3)
test.Values[0] = "ntnu.edu"
test.Values[1] = "ntnu.no"
test.Values[2] = "testsafebrowsing.com/s/malware.html"
testdata, _ := json.Marshal(test)
fmt.Println(test)
_, err := utils.Conn.Do("SET", "urlFilter", testdata)
if err != nil {
fmt.Println("Error adding data to redis:" + err.Error())
logging.Logerror(err, "ERROR adding data to Redis, url filter list creation")
}
_, err = utils.Conn.Do("SETEX", "hashFilter", utils.CacheDurationFile, hashFilter)
if err != nil {
fmt.Println("Error adding data to redis:" + err.Error())
logging.Logerror(err, "ERROR adding data to Redis, url filter list creation")
}
_, err = utils.Conn.Do("SETEX", "idFilter", utils.CacheDurationFile, idFilter)
if err != nil {
fmt.Println("Error adding data to redis:" + err.Error())
logging.Logerror(err, "ERROR adding data to Redis, url filter list creation")
}
}
*/
// Check filter takes a filter and an item and checks if the item is whitelisted
/*
func CheckFilter(filter string, item string) bool {
type test5 struct {
Values []string `json:"values"`
}
value, err := utils.Conn.Do("GET", filter)
if value == nil {
fmt.Println("No length")
return false
}
if err != nil {
return false
}
valueB, _ := json.Marshal(value)
fmt.Println(value)
var responseData test5
json.Unmarshal(valueB, &responseData)
fmt.Println(responseData)
test32, err := json.Marshal(responseData)
fmt.Printf("This is it, %q", value)
fmt.Println("this is test32", string(test32))
fmt.Println("this is test32", test32)
fmt.Println("Length: ", len(responseData.Values))
/*
test2, err := json.Marshal(value)
var test []string
json.Unmarshal(test2, &test)
fmt.Println(test2)
fmt.Sprintf("%q", value)
*/
// return true
//}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment