Skip to content
Snippets Groups Projects
Commit d14202b2 authored by Jonas Kjærandsen's avatar Jonas Kjærandsen
Browse files

Removed unused code

parent 64f1bb97
No related branches found
No related tags found
No related merge requests found
...@@ -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
//}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment