Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.20
require (
github.com/fatih/color v1.13.0
github.com/hashicorp/go-multierror v1.1.1
github.com/ipinfo/go/v2 v2.9.4
github.com/ipinfo/go/v2 v2.10.0
github.com/ipinfo/mmdbctl v0.0.0-20230726080357-558a20ba8524
github.com/jszwec/csvutil v1.4.0
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ github.com/ipinfo/go/v2 v2.9.2 h1:wih7S6ifXAdGE7OH5fgTfC/yA/lFYRKaG5z4FNiE+MY=
github.com/ipinfo/go/v2 v2.9.2/go.mod h1:tRDkYfM20b1XzNqorn1Q1O6Xtg7uzw3Wn3I2R0SyJh4=
github.com/ipinfo/go/v2 v2.9.4 h1:6LcbIQ6o/bfNgqGMoJCfkUxVtJsbLWdB9sDq4Vv3fF0=
github.com/ipinfo/go/v2 v2.9.4/go.mod h1:tRDkYfM20b1XzNqorn1Q1O6Xtg7uzw3Wn3I2R0SyJh4=
github.com/ipinfo/go/v2 v2.10.0 h1:v9sFjaxnVVD+JVgpWpjgwols18Tuu4SgBDaHHaw0IXo=
github.com/ipinfo/go/v2 v2.10.0/go.mod h1:tRDkYfM20b1XzNqorn1Q1O6Xtg7uzw3Wn3I2R0SyJh4=
github.com/ipinfo/mmdbctl v0.0.0-20230726080357-558a20ba8524 h1:om+KMCwwLE1scrxr5YirYikcgl27Z2KbKQSpobt/2b0=
github.com/ipinfo/mmdbctl v0.0.0-20230726080357-558a20ba8524/go.mod h1:RVULurqCcBRklgMU3st4j+sIEuVNY+mB1IMhhi/wjLA=
github.com/jszwec/csvutil v1.4.0 h1:ro7gZN8PRsyNUEX8qE/eYPE5/kffEXMs+4eRcOd1oUk=
Expand Down
15 changes: 14 additions & 1 deletion ipinfo/cmd_myip.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ var completionsMyIP = &complete.Command{
"--json": predict.Nothing,
"-c": predict.Nothing,
"--csv": predict.Nothing,
"-6": predict.Nothing,
"--ipv6": predict.Nothing,
},
}

Expand All @@ -37,6 +39,8 @@ Options:
General:
--token <tok>, -t <tok>
use <tok> as API token.
--ipv6, -6
get IPv6 address.
--nocache
do not use the cache.
--help, -h
Expand Down Expand Up @@ -69,6 +73,7 @@ func cmdMyIP() error {
var fJSON bool
var fCSV bool
var fYAML bool
var fV6 bool

pflag.StringVarP(&fTok, "token", "t", "", "the token to use.")
pflag.BoolVar(&fNoCache, "nocache", true, "disable the cache.")
Expand All @@ -79,6 +84,7 @@ func cmdMyIP() error {
pflag.BoolVarP(&fCSV, "csv", "c", false, "output CSV format.")
pflag.BoolVarP(&fYAML, "yaml", "y", false, "output YAML format.")
pflag.BoolVar(&fNoColor, "nocolor", false, "disable color output.")
pflag.BoolVarP(&fV6, "ipv6", "6", false, "use IPv6 address.")
pflag.Parse()

if fNoColor {
Expand All @@ -91,7 +97,14 @@ func cmdMyIP() error {
}

ii = prepareIpinfoClient(fTok)
data, err := ii.GetIPInfo(nil)

var data *ipinfo.Core
var err error
if fV6 {
data, err = ii.GetIPInfoV6(nil)
} else {
data, err = ii.GetIPInfo(nil)
}
if err != nil {
return err
}
Expand Down
37 changes: 32 additions & 5 deletions vendor/github.com/ipinfo/go/v2/ipinfo/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 22 additions & 1 deletion vendor/github.com/ipinfo/go/v2/ipinfo/core.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ github.com/hashicorp/errwrap
# github.com/hashicorp/go-multierror v1.1.1
## explicit; go 1.13
github.com/hashicorp/go-multierror
# github.com/ipinfo/go/v2 v2.9.4
# github.com/ipinfo/go/v2 v2.10.0
## explicit; go 1.15
github.com/ipinfo/go/v2/ipinfo
github.com/ipinfo/go/v2/ipinfo/cache
Expand Down