Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var IPCacheMap = make(map[string]IPCache)
TODO - Put lock and map in single struct for organization - then refactor CheckIP and AddIP to just take the original cachemap struct
var IPCacheMapLock = sync.RWMutex{}
Functions ¶
Types ¶
type City ¶
type City struct { City struct { Names map[string]string `maxminddb:"names"` } `maxminddb:"city"` Country struct { Names map[string]string `maxminddb:"names"` } `maxminddb:"country"` RegisteredCountry struct { Names map[string]string `maxminddb:"names"` } `maxminddb:"registered_country"` Traits struct { IsAnonymousProxy bool `maxminddb:"is_anonymous_proxy"` } `maxminddb:"traits"` }
https://github.com/oschwald/geoip2-golang/blob/main/reader.go TODO - Review potential MaxMind fields to determine usefulness of any others - really depends on the 'type' of DB we have access to Refactor to provide fields properly from IP/ASN lat/lon are kind of meh but I guess could be useful for some applications - but really it depends on accuracy radius which could maybe be useful here.
type DBRefs ¶
type DBRefs struct { Country *maxminddb.Reader City *maxminddb.Reader Domain *maxminddb.Reader ASN *maxminddb.Reader }
type RunningJobs ¶
Used to help keep track of jobs in a WaitGroup
func (*RunningJobs) AddJob ¶
func (job *RunningJobs) AddJob()
func (*RunningJobs) GetJobs ¶
func (job *RunningJobs) GetJobs() int
func (*RunningJobs) SubJob ¶
func (job *RunningJobs) SubJob()
type SizeTracker ¶
type SizeTracker struct { InputSizeMBytes int OutputSizeMBytes int Mw sync.RWMutex ActualFilesProcessed int }
Used to track overall data size processed by the script - accessed by multiple goroutines concurrently so we make it threadsafe
func (*SizeTracker) AddBytes ¶
func (s *SizeTracker) AddBytes(in int, out int)
type WaitGroupCount ¶
Should probably get rid of all of the below since it really isn't necessary now that we are using the jobs tracker instead of this to limit concurrency maxes ////
func (*WaitGroupCount) Add ¶
func (wg *WaitGroupCount) Add(delta int)
func (*WaitGroupCount) Done ¶
func (wg *WaitGroupCount) Done()
func (*WaitGroupCount) GetCount ¶
func (wg *WaitGroupCount) GetCount() int