Documentation
¶
Index ¶
Constants ¶
View Source
const (
QUEUE_GROUP = "ipdata-queue-group" // Queue group for load balancing
)
Variables ¶
View Source
var SUBSCRIBED_SUBJECT = enums.EventAskIPData.String()
Functions ¶
This section is empty.
Types ¶
type IPDataResponseBody ¶
type IPDataResponseBody struct {
StatusCode int `json:"status_code"`
Message string `json:"message"`
Ip string `json:"ip"`
City string `json:"city"`
Region string `json:"region"`
RegionCode string `json:"region_code"`
RegionType string `json:"region_type"`
CountryName string `json:"country_name"`
CountryCode string `json:"country_code"`
ContinentName string `json:"continent_name"`
ContinentCode string `json:"continent_code"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
Asn struct {
Asn string `json:"asn"`
Name string `json:"name"`
Domain string `json:"domain"`
Route string `json:"route"`
Type string `json:"type"`
} `json:"asn"`
Carrier *struct {
Name string `json:"name"`
Mcc string `json:"mcc"`
Mnc string `json:"mnc"`
} `json:"carrier"`
TimeZone struct {
Name string `json:"name"`
Abbr string `json:"abbr"`
Offset string `json:"offset"`
IsDst bool `json:"is_dst"`
CurrentTime time.Time `json:"current_time"`
} `json:"time_zone"`
Threat struct {
IsTor bool `json:"is_tor"`
IsVpn bool `json:"is_vpn"`
IsIcloudRelay bool `json:"is_icloud_relay"`
IsProxy bool `json:"is_proxy"`
IsDatacenter bool `json:"is_datacenter"`
IsAnonymous bool `json:"is_anonymous"`
IsKnownAttacker bool `json:"is_known_attacker"`
IsKnownAbuser bool `json:"is_known_abuser"`
IsThreat bool `json:"is_threat"`
IsBogon bool `json:"is_bogon"`
Blocklists []interface{} `json:"blocklists"`
} `json:"threat"`
Count string `json:"count"`
}
type IPDataService ¶
type IPDataService struct {
// contains filtered or unexported fields
}
func NewIPDataService ¶
func NewIPDataService( config *config.IPDataConfig, natsConn *nats_internal.NATSConnections, repos *repository.Repositories, ) *IPDataService
func (*IPDataService) AskIPData ¶
func (s *IPDataService) AskIPData(ctx context.Context, ipAddress string) *pb.IPAddressVerifyResponse
func (*IPDataService) Start ¶
func (s *IPDataService) Start(ctx context.Context) error
Start begins listening for events
func (*IPDataService) Stop ¶ added in v0.0.61
func (s *IPDataService) Stop()
Stop gracefully shuts down the service
func (*IPDataService) Unsubscribe ¶ added in v0.0.61
func (s *IPDataService) Unsubscribe()
Unsubscribe cleans up the NATS subscription
Click to show internal directories.
Click to hide internal directories.