Working on portmaster restructure
This commit is contained in:
@@ -25,7 +25,7 @@ type Intel struct {
|
||||
}
|
||||
|
||||
func makeIntelKey(domain string) string {
|
||||
return fmt.Sprintf("intel:Intel/%s", domain)
|
||||
return fmt.Sprintf("cache:intel/domain/%s", domain)
|
||||
}
|
||||
|
||||
// GetIntelFromDB gets an Intel record from the database.
|
||||
|
||||
@@ -26,7 +26,7 @@ type IPInfo struct {
|
||||
}
|
||||
|
||||
func makeIPInfoKey(ip string) string {
|
||||
return fmt.Sprintf("intel:IPInfo/%s", ip)
|
||||
return fmt.Sprintf("cache:intel/ipInfo/%s", ip)
|
||||
}
|
||||
|
||||
// GetIPInfo gets an IPInfo record from the database.
|
||||
|
||||
@@ -3,26 +3,18 @@ package intel
|
||||
import (
|
||||
"github.com/miekg/dns"
|
||||
|
||||
"github.com/Safing/portbase/database"
|
||||
"github.com/Safing/portbase/log"
|
||||
"github.com/Safing/portbase/modules"
|
||||
|
||||
// module dependencies
|
||||
_ "github.com/Safing/portmaster/global"
|
||||
)
|
||||
|
||||
func init() {
|
||||
modules.Register("intel", prep, start, nil, "database")
|
||||
modules.Register("intel", prep, start, nil, "global")
|
||||
}
|
||||
|
||||
func start() error {
|
||||
_, err := database.Register(&database.Database{
|
||||
Name: "intel",
|
||||
Description: "Intelligence and DNS Data",
|
||||
StorageType: "badger",
|
||||
PrimaryAPI: "",
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// load resolvers from config and environment
|
||||
loadResolvers(false)
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ type NameRecord struct {
|
||||
}
|
||||
|
||||
func makeNameRecordKey(domain string, question string) string {
|
||||
return fmt.Sprintf("intel:NameRecords/%s%s", domain, question)
|
||||
return fmt.Sprintf("cache:intel/nameRecord/%s%s", domain, question)
|
||||
}
|
||||
|
||||
// GetNameRecord gets a NameRecord from the database.
|
||||
|
||||
Reference in New Issue
Block a user