location2ip

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 4 Imported by: 0

README

命令行

go get github.com/techxmind/location2ip/cmd/loc2ip

loc2ip -h
loc2ip -n 5 北京

示例

import (
	"fmt"

	"github.com/techxmind/location2ip"
)


var locs = []string{
    "成都",
    "四川",
    "156007000004", // 位置编码:www.ipcaa.org
}

for loc := range locs {
    if ip, err = location2ip.Generate(loc); err == nil {
        fmt.Println("ip: %s", ip)
    }
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidGeo = errors.New("Invalid geo")

Functions

func Generate

func Generate(geo string) (ip string, err error)

Types

This section is empty.

Directories

Path Synopsis
cmd
loc2ip command

Jump to

Keyboard shortcuts

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