summaryrefslogtreecommitdiffstats
path: root/internal/client/geo.go
diff options
context:
space:
mode:
authors <[email protected]>2025-11-10 15:22:32 -0500
committers <[email protected]>2025-11-10 15:22:32 -0500
commit8383a241fc3cf5b022c9c53f8f19690edf04177b (patch)
tree887a489f7931d07373530c7e053f0343dca65e1d /internal/client/geo.go
parent9a9e79f232b83d3bd2a816287272515863df1299 (diff)
downloaddborg-8383a241fc3cf5b022c9c53f8f19690edf04177b.tar.gz
dborg-8383a241fc3cf5b022c9c53f8f19690edf04177b.zip
refactor: restructure client modules and add config file supportv0.8.1
- Split large osint.go client into focused modules (bssid.go, breachforum.go, buckets.go, etc.) - Add config file support with init command for API key management - Remove api-key flag in favor of config file + env var fallback - Update API paths to remove /osint prefix - Add crawl endpoint streaming support - Improve error handling with 402 payment required status
Diffstat (limited to 'internal/client/geo.go')
-rw-r--r--internal/client/geo.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/internal/client/geo.go b/internal/client/geo.go
new file mode 100644
index 0000000..3fc5146
--- /dev/null
+++ b/internal/client/geo.go
@@ -0,0 +1,30 @@
+package client
+
+import (
+ "encoding/json"
+ "fmt"
+ "git.db.org.ai/dborg/internal/models"
+ "net/url"
+)
+
+func (c *Client) SearchGeo(params *models.GeoSearchParams) (*models.GeoSearchResponse, error) {
+ path := "/geo"
+
+ queryParams := url.Values{}
+ queryParams.Add("street", params.Street)
+ queryParams.Add("city", params.City)
+ queryParams.Add("state", params.State)
+ queryParams.Add("zip", params.Zip)
+
+ data, err := c.Get(path, queryParams)
+ if err != nil {
+ return nil, err
+ }
+
+ var response models.GeoSearchResponse
+ if err := json.Unmarshal(data, &response); err != nil {
+ return nil, fmt.Errorf("failed to parse geo search response: %w", err)
+ }
+
+ return &response, nil
+}