|
|
|
@ -22,9 +22,11 @@ type BlocklistManager interface {
|
|
|
|
|
func NewDomainBlacklist(blocklistURLs []string) (BlocklistManager, error) {
|
|
|
|
|
l := log.New(os.Stdout, "[Blocklist Manager] ", log.LUTC|log.Lshortfile)
|
|
|
|
|
bm := &memoryBlocklistManager{blocklistURLs: blocklistURLs, Logger: l}
|
|
|
|
|
if err := bm.Reload(context.Background()); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
go bm.Reload(context.Background())
|
|
|
|
|
|
|
|
|
|
// if err := bm.Reload(context.Background()); err != nil {
|
|
|
|
|
// return nil, err
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
return bm, nil
|
|
|
|
|
}
|
|
|
|
|