mirror of
https://github.com/zu1k/nali.git
synced 2025-01-22 21:29:02 +08:00
37 lines
654 B
Go
37 lines
654 B
Go
package dbif
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"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"
|
|
)
|
|
|
|
type QueryType uint
|
|
|
|
const (
|
|
TypeIPv4 = iota
|
|
TypeIPv6
|
|
TypeDomain
|
|
)
|
|
|
|
type DB interface {
|
|
Find(query string, params ...string) (result fmt.Stringer, err error)
|
|
Name() string
|
|
}
|
|
|
|
var (
|
|
_ DB = &qqwry.QQwry{}
|
|
_ DB = &zxipv6wry.ZXwry{}
|
|
_ DB = &ipip.IPIPFree{}
|
|
_ DB = &geoip.GeoIP{}
|
|
_ DB = &ip2region.Ip2Region{}
|
|
_ DB = &ip2location.IP2Location{}
|
|
_ DB = &cdn.CDN{}
|
|
)
|