Skip to content

Commit

Permalink
docs: Update readme zh
Browse files Browse the repository at this point in the history
Signed-off-by: zu1k <[email protected]>
  • Loading branch information
zu1k committed May 17, 2022
1 parent bf365a6 commit 4a386fb
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- IPIP 数据库 (可选)
- ip2region 数据库 (可选)
- DB-IP 数据库 (可选)
- IP2Location DB3 LITE 数据库 (可选)
- CDN 服务提供商查询
- 支持管道处理
- 支持交互式查询
Expand Down Expand Up @@ -246,6 +247,7 @@ $ nali update --db qqwry,cdn
- IPIP `['ipip']`
- Ip2Resion `['ip2region', 'i2r']`
- DBIP `['dbip', 'db-ip']`
- IP2Location `['ip2location']`
#### Windows平台
Expand Down Expand Up @@ -320,6 +322,7 @@ export NALI_HOME=/var/nali
- [IPIP数据库](https://www.ipip.net/product/ip.html)
- [IPIP数据库解析](https://github.com/ipipdotnet/ipdb-go)
- [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)
- [Nali-cli](https://github.com/SukkaW/nali-cli)
Expand Down
2 changes: 1 addition & 1 deletion README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ supported database:
- Chunzhen `['chunzhen', 'qqwry']`
- IPIP `['ipip']`
- Ip2Resion `['ip2region', 'i2r']`
- - DBIP `['dbip', 'db-ip']`
- DBIP `['dbip', 'db-ip']`
- IP2Location `['ip2location']`

#### Windows
Expand Down
2 changes: 1 addition & 1 deletion internal/db/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func GetDefaultDBList() List {
Types: TypesIPv4,
},
&DB{
Name: "ip2location",
Name: "ip2location",
Format: FormatIP2Location,
File: "IP2LOCATION-LITE-DB3.IPV6.BIN",
Languages: LanguagesAll,
Expand Down
12 changes: 6 additions & 6 deletions internal/db/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"github.com/zu1k/nali/pkg/cdn"
"github.com/zu1k/nali/pkg/dbif"
"github.com/zu1k/nali/pkg/geoip"
"github.com/zu1k/nali/pkg/ip2location"
"github.com/zu1k/nali/pkg/ip2region"
"github.com/zu1k/nali/pkg/ipip"
"github.com/zu1k/nali/pkg/qqwry"
"github.com/zu1k/nali/pkg/zxipv6wry"
"github.com/zu1k/nali/pkg/ip2location"
)

type DB struct {
Expand Down Expand Up @@ -61,11 +61,11 @@ func (d *DB) get() (db dbif.DB) {
type Format string

const (
FormatMMDB Format = "mmdb"
FormatQQWry = "qqwry"
FormatZXIPv6Wry = "zxipv6wry"
FormatIPIP = "ipip"
FormatIP2Region = "ip2region"
FormatMMDB Format = "mmdb"
FormatQQWry = "qqwry"
FormatZXIPv6Wry = "zxipv6wry"
FormatIPIP = "ipip"
FormatIP2Region = "ip2region"
FormatIP2Location = "ip2location"

FormatCDNSkkYml = "cdn-skk-yml"
Expand Down
2 changes: 1 addition & 1 deletion pkg/dbif/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (

"github.com/zu1k/nali/pkg/cdn"
"github.com/zu1k/nali/pkg/geoip"
"github.com/zu1k/nali/pkg/ip2location"
"github.com/zu1k/nali/pkg/ip2region"
"github.com/zu1k/nali/pkg/ipip"
"github.com/zu1k/nali/pkg/qqwry"
"github.com/zu1k/nali/pkg/zxipv6wry"
"github.com/zu1k/nali/pkg/ip2location"
)

type QueryType uint
Expand Down
4 changes: 2 additions & 2 deletions pkg/ip2location/ip2locationdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func NewIP2LocationDB(filePath string) (*IP2LocationDB, error) {
return nil, err
} else {
db, err := ip2location.OpenDB(filePath)

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

if err != nil {
return
}
Expand Down

0 comments on commit 4a386fb

Please sign in to comment.