Skip to content

Commit

Permalink
Merge pull request sundowndev#319 from sundowndev/gomod
Browse files Browse the repository at this point in the history
Use a v2 go module path
  • Loading branch information
sundowndev authored Apr 26, 2020
2 parents 5e65d5e + 74df28c commit e024a55
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 22 deletions.
4 changes: 2 additions & 2 deletions api/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion api/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion api/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/recon.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions cmd/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
19 changes: 16 additions & 3 deletions docs/go-module-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,36 @@

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

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("<number>")

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
}
}

```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/sundowndev/phoneinfoga
module gopkg.in/sundowndev/phoneinfoga.v2

go 1.13

Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/sundowndev/phoneinfoga/cmd"
"gopkg.in/sundowndev/phoneinfoga.v2/cmd"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/scanners/google_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/scanners/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/scanners/local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/scanners/ovh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/scanners/scanners.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e024a55

Please sign in to comment.