summaryrefslogtreecommitdiff
path: root/internal/blocklist/blocklist.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/blocklist/blocklist.go')
-rw-r--r--internal/blocklist/blocklist.go16
1 files changed, 7 insertions, 9 deletions
diff --git a/internal/blocklist/blocklist.go b/internal/blocklist/blocklist.go
index f6e0592..8925299 100644
--- a/internal/blocklist/blocklist.go
+++ b/internal/blocklist/blocklist.go
@@ -2,9 +2,9 @@ package blocklist
import (
"bufio"
+ "fmt"
"net/http"
"os"
- "fmt"
"strings"
"sync"
"sync/atomic"
@@ -18,19 +18,19 @@ const (
)
type Blocklist struct {
- mu sync.RWMutex
- blocked *trie
+ mu sync.RWMutex
+ blocked *trie
exceptions *trie
- response ResponseAction
+ response ResponseAction
TotalRules int32
- Hits int64
+ Hits int64
}
func New(action ResponseAction) *Blocklist {
return &Blocklist{
- blocked: newTrie(),
+ blocked: newTrie(),
exceptions: newTrie(),
- response: action,
+ response: action,
}
}
@@ -128,8 +128,6 @@ func (b *Blocklist) LoadURL(url string) error {
return b.load(bufio.NewScanner(resp.Body))
}
-
-
func splitDomain(domain string) []string {
domain = strings.TrimSuffix(domain, ".")
return strings.Split(domain, ".")