Moving SaveDomains to parser package
This commit is contained in:
parent
7785372e3a
commit
e39cf58d39
|
@ -3,6 +3,7 @@ package parser
|
|||
import (
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"gitlab.dcso.lolcat/LABS/styx/models"
|
||||
|
@ -41,4 +42,18 @@ func ParseEvent(domains []string) {
|
|||
// go findDomainEdges()
|
||||
}
|
||||
|
||||
func SaveDomains(domains []string) {
|
||||
f, err := os.OpenFile("domains.txt", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
||||
if err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
for _, d := range domains {
|
||||
if _, err := f.WriteString(d + ","); err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Helpers
|
||||
|
|
Loading…
Reference in a new issue