detect-ip

module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2023 License: Apache-2.0

README

detect-ip

detect-ip is a tool to detect your public ip(v4/v6).

Install

  • For Cli
go install github.com/chyroc/detect-ip/cli/detect-ip@latest
  • For Go Package
go get github.com/chyroc/detect-ip/detect_ip

Usage

  • For Cli
detect-ip

detect-ip -timeout 3000 # 3000 = 3s
  • For Go Package
package main

import (
    "fmt"

    "github.com/chyroc/detect-ip/detect_ip"
)

func main() {
    ip := detect_ip.PublicIPV4() // PublicIPV6
	// ip := detect_ip.PublicIPV4(detect_ip.WithTimeout(time.Second*3))
    fmt.Println(ip)
}

Directories

Path Synopsis
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL