Skip to content

Commit

Permalink
better name
Browse files Browse the repository at this point in the history
  • Loading branch information
jreisinger committed May 16, 2023
1 parent 294a345 commit 30a9d98
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion check/blocklist.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func BlockList(ipaddr net.IP) (checkip.Result, error) {
// getBlockListFile downloads (if outdated) and returns open file containing
// blocklist.de database.
var getBlockListFile = func() (*os.File, error) {
file, err := getDbFilesPath("blocklist.de_all.list")
file, err := getCachePath("blocklist.de_all.list")
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion check/cinsscore.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func CinsScore(ipaddr net.IP) (checkip.Result, error) {
}

// file := "/var/tmp/cins.txt"
file, err := getDbFilesPath("cins.txt")
file, err := getCachePath("cins.txt")
if err != nil {
return result, err
}
Expand Down
2 changes: 1 addition & 1 deletion check/dbip.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func DBip(ip net.IP) (checkip.Result, error) {
}

// file := "/var/tmp/dbip-city-lite.mmdb"
file, err := getDbFilesPath("dbip-city-lite.mmdb")
file, err := getCachePath("dbip-city-lite.mmdb")
if err != nil {
return result, err
}
Expand Down
6 changes: 3 additions & 3 deletions check/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"time"
)

// getDbFilesPath returns OS specific absolute path to filename. On Unix it will
// be $HOME/.checkip/<filename>
func getDbFilesPath(filename string) (string, error) {
// getCachePath returns OS specific absolute path to filename that is used to
// caching data from the Internet. On Unix it will be $HOME/.checkip/<filename>
func getCachePath(filename string) (string, error) {
usr, err := user.Current()
if err != nil {
return "", err
Expand Down
2 changes: 1 addition & 1 deletion check/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestGetDbFilesPath(t *testing.T) {
{"GeoLite2-City.mmdb", "GeoLite2-City.mmdb"},
}
for _, tc := range testcases {
got, err := getDbFilesPath(tc.filename)
got, err := getCachePath(tc.filename)
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion check/firehol.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func Firehol(ipaddr net.IP) (checkip.Result, error) {
Type: checkip.TypeSec,
}

file, err := getDbFilesPath("firehol_level1.netset")
file, err := getCachePath("firehol_level1.netset")
if err != nil {
return result, err
}
Expand Down
2 changes: 1 addition & 1 deletion check/ipsum.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func IPSum(ipaddr net.IP) (checkip.Result, error) {
}

// file := "/var/tmp/ipsum.txt"
file, err := getDbFilesPath("ipsum.txt")
file, err := getCachePath("ipsum.txt")
if err != nil {
return result, err
}
Expand Down
2 changes: 1 addition & 1 deletion check/iptoasn.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func IPtoASN(ipaddr net.IP) (checkip.Result, error) {
}

// file := "/var/tmp/ip2asn-combined.tsv"
file, err := getDbFilesPath("ip2asn-combined.tsv")
file, err := getCachePath("ip2asn-combined.tsv")
if err != nil {
return result, err
}
Expand Down
2 changes: 1 addition & 1 deletion check/isonaws.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func IsOnAWS(ipaddr net.IP) (checkip.Result, error) {
} `json:"prefixes"`
}{}

filename, err := getDbFilesPath("aws-ip-ranges.json")
filename, err := getCachePath("aws-ip-ranges.json")
if err != nil {
return result, err
}
Expand Down
2 changes: 1 addition & 1 deletion check/maxmind.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func MaxMind(ip net.IP) (checkip.Result, error) {
}

// file := "/var/tmp/GeoLite2-City.mmdb"
file, err := getDbFilesPath("GeoLite2-City.mmdb")
file, err := getCachePath("GeoLite2-City.mmdb")
if err != nil {
return result, err
}
Expand Down
2 changes: 1 addition & 1 deletion check/phishstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func PhishStats(ipaddr net.IP) (checkip.Result, error) {
Type: checkip.TypeInfoSec,
}

file, err := getDbFilesPath("phish_score.csv")
file, err := getCachePath("phish_score.csv")
if err != nil {
return result, err
}
Expand Down

0 comments on commit 30a9d98

Please sign in to comment.