From 1abea84433c7785f06403a6fc3f0b3e2124e7672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl?= <16480203+sundowndev@users.noreply.github.com> Date: Sun, 26 Apr 2020 16:17:55 +0100 Subject: [PATCH 1/3] fix(mod): use a v2 go module path --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 9f709ecd0..b43b5f073 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/sundowndev/phoneinfoga +module gopkg.in/sundowndev/phoneinfoga.v2 go 1.13 From 4609b37fbd5bed3c3380a02b4a265e21bd10de69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl?= <16480203+sundowndev@users.noreply.github.com> Date: Sun, 26 Apr 2020 16:20:29 +0100 Subject: [PATCH 2/3] docs: go module usage --- docs/go-module-usage.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/go-module-usage.md b/docs/go-module-usage.md index 422c67360..33539ce79 100644 --- a/docs/go-module-usage.md +++ b/docs/go-module-usage.md @@ -2,6 +2,14 @@ You can easily use scanners in your own Golang script. You can find [Go documentation here](https://godoc.org/github.com/sundowndev/PhoneInfoga). +### Install the module + +``` +go get -v gopkg.in/sundowndev/phoneinfoga.v2 +``` + +### Usage example + ```go package main @@ -9,16 +17,21 @@ import ( "fmt" "log" - phoneinfoga "github.com/sundowndev/phoneinfoga/pkg/scanners" + phoneinfoga "gopkg.in/sundowndev/phoneinfoga.v2/pkg/scanners" ) func main() { - number, err := phoneinfoga.LocalScan(number) + number, err := phoneinfoga.LocalScan("") if err != nil { log.Fatal(err) } - fmt.Println(number.E164) + links := phoneinfoga.GoogleSearchScan(number) + + for _, link := range links.Individuals { + fmt.Println(link.URL) // Google search link to scan + } } + ``` From 74df28c90b27f6cf9cb718dc26d8d37cf74fa1a8 Mon Sep 17 00:00:00 2001 From: sundowndev Date: Sun, 26 Apr 2020 16:26:35 +0100 Subject: [PATCH 3/3] refactor: use new module path --- api/controllers.go | 4 ++-- api/server_test.go | 2 +- api/validators.go | 2 +- cmd/recon.go | 2 +- cmd/scan.go | 4 ++-- cmd/serve.go | 2 +- cmd/version.go | 4 ++-- go.sum | 2 -- main.go | 2 +- pkg/scanners/google_test.go | 2 +- pkg/scanners/local.go | 2 +- pkg/scanners/local_test.go | 2 +- pkg/scanners/ovh_test.go | 2 +- pkg/scanners/scanners.go | 2 +- 14 files changed, 16 insertions(+), 18 deletions(-) diff --git a/api/controllers.go b/api/controllers.go index 42b73ee43..d8160af15 100644 --- a/api/controllers.go +++ b/api/controllers.go @@ -2,8 +2,8 @@ package api import ( "github.com/gin-gonic/gin" - "github.com/sundowndev/phoneinfoga/pkg/config" - "github.com/sundowndev/phoneinfoga/pkg/scanners" + "gopkg.in/sundowndev/phoneinfoga.v2/pkg/config" + "gopkg.in/sundowndev/phoneinfoga.v2/pkg/scanners" ) type scanResultResponse struct { diff --git a/api/server_test.go b/api/server_test.go index 1e58526af..445370cfc 100644 --- a/api/server_test.go +++ b/api/server_test.go @@ -8,8 +8,8 @@ import ( "github.com/gin-gonic/gin" "github.com/stretchr/testify/assert" - "github.com/sundowndev/phoneinfoga/pkg/scanners" gock "gopkg.in/h2non/gock.v1" + "gopkg.in/sundowndev/phoneinfoga.v2/pkg/scanners" ) func performRequest(r http.Handler, method, path string) (*httptest.ResponseRecorder, error) { diff --git a/api/validators.go b/api/validators.go index 91463fba5..b7a7828cb 100644 --- a/api/validators.go +++ b/api/validators.go @@ -4,7 +4,7 @@ import ( "net/http" "github.com/gin-gonic/gin" - "github.com/sundowndev/phoneinfoga/pkg/scanners" + "gopkg.in/sundowndev/phoneinfoga.v2/pkg/scanners" ) // JSONResponse is the default API response type diff --git a/cmd/recon.go b/cmd/recon.go index e1ddda122..34575fc62 100644 --- a/cmd/recon.go +++ b/cmd/recon.go @@ -2,7 +2,7 @@ package cmd import ( "github.com/spf13/cobra" - "github.com/sundowndev/phoneinfoga/pkg/utils" + "gopkg.in/sundowndev/phoneinfoga.v2/pkg/utils" ) func init() { diff --git a/cmd/scan.go b/cmd/scan.go index fbdb45ed5..af44eaf6b 100644 --- a/cmd/scan.go +++ b/cmd/scan.go @@ -4,8 +4,8 @@ import ( "os" "github.com/spf13/cobra" - "github.com/sundowndev/phoneinfoga/pkg/scanners" - "github.com/sundowndev/phoneinfoga/pkg/utils" + "gopkg.in/sundowndev/phoneinfoga.v2/pkg/scanners" + "gopkg.in/sundowndev/phoneinfoga.v2/pkg/utils" ) func init() { diff --git a/cmd/serve.go b/cmd/serve.go index 946c775d3..cbaf80cb1 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -7,7 +7,7 @@ import ( "github.com/gin-gonic/gin" "github.com/spf13/cobra" - api "github.com/sundowndev/phoneinfoga/api" + api "gopkg.in/sundowndev/phoneinfoga.v2/api" ) var httpPort int diff --git a/cmd/version.go b/cmd/version.go index 6489dadb5..6cfa45d1f 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -2,8 +2,8 @@ package cmd import ( "github.com/spf13/cobra" - "github.com/sundowndev/phoneinfoga/pkg/config" - "github.com/sundowndev/phoneinfoga/pkg/utils" + "gopkg.in/sundowndev/phoneinfoga.v2/pkg/config" + "gopkg.in/sundowndev/phoneinfoga.v2/pkg/utils" ) func init() { diff --git a/go.sum b/go.sum index 03d6121b6..f708e6a08 100644 --- a/go.sum +++ b/go.sum @@ -159,8 +159,6 @@ github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJy github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/sundowndev/dorkgen v1.0.2 h1:+hBim2i4OBNiBmghchNKREpbHfIYA2pIu3YPW8TDvjY= -github.com/sundowndev/dorkgen v1.0.2/go.mod h1:FGl7utGG1BrWc+QNZ6RVdVJD4p4+v9md3XctPRXTDGQ= github.com/sundowndev/dorkgen v1.0.3 h1:bUh7wseCJtUMEerguHbPsukpiI2ut5FoLrStUismmL4= github.com/sundowndev/dorkgen v1.0.3/go.mod h1:FGl7utGG1BrWc+QNZ6RVdVJD4p4+v9md3XctPRXTDGQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= diff --git a/main.go b/main.go index 1b3921f0e..ae86dbb84 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/sundowndev/phoneinfoga/cmd" + "gopkg.in/sundowndev/phoneinfoga.v2/cmd" ) func main() { diff --git a/pkg/scanners/google_test.go b/pkg/scanners/google_test.go index 6d7007dff..0b5ef524a 100644 --- a/pkg/scanners/google_test.go +++ b/pkg/scanners/google_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/sundowndev/phoneinfoga/pkg/utils" + "gopkg.in/sundowndev/phoneinfoga.v2/pkg/utils" ) func TestGoogleSearchScan(t *testing.T) { diff --git a/pkg/scanners/local.go b/pkg/scanners/local.go index ed06e42c6..b4de6b179 100644 --- a/pkg/scanners/local.go +++ b/pkg/scanners/local.go @@ -2,7 +2,7 @@ package scanners import ( "github.com/nyaruka/phonenumbers" - "github.com/sundowndev/phoneinfoga/pkg/utils" + "gopkg.in/sundowndev/phoneinfoga.v2/pkg/utils" ) // LocalScan performs a local scan of a phone diff --git a/pkg/scanners/local_test.go b/pkg/scanners/local_test.go index cd6878527..6931c7b54 100644 --- a/pkg/scanners/local_test.go +++ b/pkg/scanners/local_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/sundowndev/phoneinfoga/pkg/utils" + "gopkg.in/sundowndev/phoneinfoga.v2/pkg/utils" ) func TestLocalScan(t *testing.T) { diff --git a/pkg/scanners/ovh_test.go b/pkg/scanners/ovh_test.go index d2148b60d..3d1e9a57f 100644 --- a/pkg/scanners/ovh_test.go +++ b/pkg/scanners/ovh_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/sundowndev/phoneinfoga/pkg/utils" gock "gopkg.in/h2non/gock.v1" + "gopkg.in/sundowndev/phoneinfoga.v2/pkg/utils" ) func TestOVHScanner(t *testing.T) { diff --git a/pkg/scanners/scanners.go b/pkg/scanners/scanners.go index f633a8f50..bf0f8c46f 100644 --- a/pkg/scanners/scanners.go +++ b/pkg/scanners/scanners.go @@ -3,7 +3,7 @@ package scanners import ( "os" - "github.com/sundowndev/phoneinfoga/pkg/utils" + "gopkg.in/sundowndev/phoneinfoga.v2/pkg/utils" ) // Number is a phone number