1
0
mirror of https://github.com/zu1k/nali.git synced 2025-02-02 10:22:41 +08:00

docs: Update readme zh

Signed-off-by: zu1k <i@zu1k.com>
This commit is contained in:
zu1k 2022-05-17 13:35:48 +08:00
parent 222bd54dd0
commit 44606cde27
6 changed files with 14 additions and 11 deletions

View File

@ -36,6 +36,7 @@
- IPIP 数据库 (可选) - IPIP 数据库 (可选)
- ip2region 数据库 (可选) - ip2region 数据库 (可选)
- DB-IP 数据库 (可选) - DB-IP 数据库 (可选)
- IP2Location DB3 LITE 数据库 (可选)
- CDN 服务提供商查询 - CDN 服务提供商查询
- 支持管道处理 - 支持管道处理
- 支持交互式查询 - 支持交互式查询
@ -246,6 +247,7 @@ $ nali update --db qqwry,cdn
- IPIP `['ipip']` - IPIP `['ipip']`
- Ip2Resion `['ip2region', 'i2r']` - Ip2Resion `['ip2region', 'i2r']`
- DBIP `['dbip', 'db-ip']` - DBIP `['dbip', 'db-ip']`
- IP2Location `['ip2location']`
#### Windows平台 #### Windows平台
@ -320,6 +322,7 @@ export NALI_HOME=/var/nali
- [IPIP数据库](https://www.ipip.net/product/ip.html) - [IPIP数据库](https://www.ipip.net/product/ip.html)
- [IPIP数据库解析](https://github.com/ipipdotnet/ipdb-go) - [IPIP数据库解析](https://github.com/ipipdotnet/ipdb-go)
- [ip2region数据库](https://github.com/lionsoul2014/ip2region) - [ip2region数据库](https://github.com/lionsoul2014/ip2region)
- [IP2Location DB3 LITE](https://lite.ip2location.com/database/db3-ip-country-region-city)
- [Cobra CLI库](https://github.com/spf13/cobra) - [Cobra CLI库](https://github.com/spf13/cobra)
- [Nali-cli](https://github.com/SukkaW/nali-cli) - [Nali-cli](https://github.com/SukkaW/nali-cli)

View File

@ -238,7 +238,7 @@ supported database:
- Chunzhen `['chunzhen', 'qqwry']` - Chunzhen `['chunzhen', 'qqwry']`
- IPIP `['ipip']` - IPIP `['ipip']`
- Ip2Resion `['ip2region', 'i2r']` - Ip2Resion `['ip2region', 'i2r']`
- - DBIP `['dbip', 'db-ip']` - DBIP `['dbip', 'db-ip']`
- IP2Location `['ip2location']` - IP2Location `['ip2location']`
#### Windows #### Windows

View File

@ -63,7 +63,7 @@ func GetDefaultDBList() List {
Types: TypesIPv4, Types: TypesIPv4,
}, },
&DB{ &DB{
Name: "ip2location", Name: "ip2location",
Format: FormatIP2Location, Format: FormatIP2Location,
File: "IP2LOCATION-LITE-DB3.IPV6.BIN", File: "IP2LOCATION-LITE-DB3.IPV6.BIN",
Languages: LanguagesAll, Languages: LanguagesAll,

View File

@ -6,11 +6,11 @@ import (
"github.com/zu1k/nali/pkg/cdn" "github.com/zu1k/nali/pkg/cdn"
"github.com/zu1k/nali/pkg/dbif" "github.com/zu1k/nali/pkg/dbif"
"github.com/zu1k/nali/pkg/geoip" "github.com/zu1k/nali/pkg/geoip"
"github.com/zu1k/nali/pkg/ip2location"
"github.com/zu1k/nali/pkg/ip2region" "github.com/zu1k/nali/pkg/ip2region"
"github.com/zu1k/nali/pkg/ipip" "github.com/zu1k/nali/pkg/ipip"
"github.com/zu1k/nali/pkg/qqwry" "github.com/zu1k/nali/pkg/qqwry"
"github.com/zu1k/nali/pkg/zxipv6wry" "github.com/zu1k/nali/pkg/zxipv6wry"
"github.com/zu1k/nali/pkg/ip2location"
) )
type DB struct { type DB struct {
@ -61,11 +61,11 @@ func (d *DB) get() (db dbif.DB) {
type Format string type Format string
const ( const (
FormatMMDB Format = "mmdb" FormatMMDB Format = "mmdb"
FormatQQWry = "qqwry" FormatQQWry = "qqwry"
FormatZXIPv6Wry = "zxipv6wry" FormatZXIPv6Wry = "zxipv6wry"
FormatIPIP = "ipip" FormatIPIP = "ipip"
FormatIP2Region = "ip2region" FormatIP2Region = "ip2region"
FormatIP2Location = "ip2location" FormatIP2Location = "ip2location"
FormatCDNSkkYml = "cdn-skk-yml" FormatCDNSkkYml = "cdn-skk-yml"

View File

@ -5,11 +5,11 @@ import (
"github.com/zu1k/nali/pkg/cdn" "github.com/zu1k/nali/pkg/cdn"
"github.com/zu1k/nali/pkg/geoip" "github.com/zu1k/nali/pkg/geoip"
"github.com/zu1k/nali/pkg/ip2location"
"github.com/zu1k/nali/pkg/ip2region" "github.com/zu1k/nali/pkg/ip2region"
"github.com/zu1k/nali/pkg/ipip" "github.com/zu1k/nali/pkg/ipip"
"github.com/zu1k/nali/pkg/qqwry" "github.com/zu1k/nali/pkg/qqwry"
"github.com/zu1k/nali/pkg/zxipv6wry" "github.com/zu1k/nali/pkg/zxipv6wry"
"github.com/zu1k/nali/pkg/ip2location"
) )
type QueryType uint type QueryType uint

View File

@ -23,7 +23,7 @@ func NewIP2LocationDB(filePath string) (*IP2LocationDB, error) {
return nil, err return nil, err
} else { } else {
db, err := ip2location.OpenDB(filePath) db, err := ip2location.OpenDB(filePath)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
@ -37,7 +37,7 @@ func (x IP2LocationDB) Find(query string, params ...string) (result fmt.Stringer
return nil, errors.New("Query should be valid IP") return nil, errors.New("Query should be valid IP")
} }
record, err := x.db.Get_all(ip.String()) record, err := x.db.Get_all(ip.String())
if err != nil { if err != nil {
return return
} }