Documentation ¶
Index ¶
- Constants
- func CheckIP(ip string) (uint32, error)
- func LoadContent(handle *os.File) ([]byte, error)
- func LoadContentFromFile(dbFile string) ([]byte, error)
- func LoadVectorIndex(handle *os.File) ([]byte, error)
- func LoadVectorIndexFromFile(dbFile string) ([]byte, error)
- func Long2IP(ip uint32) string
- func MidIP(sip uint32, eip uint32) uint32
- func OnlineDownload()
- type Client
- type Header
- type IndexPolicy
- type QueryResult
- type Searcher
Constants ¶
View Source
const ( HeaderInfoLength = 256 VectorIndexRows = 256 VectorIndexCols = 256 VectorIndexSize = 8 SegmentIndexBlockSize = 14 )
Variables ¶
This section is empty.
Functions ¶
func LoadContent ¶
LoadContent load the whole xdb content from the specified file handle
func LoadContentFromFile ¶
LoadContentFromFile load the whole xdb content from the specified db file path
func LoadVectorIndex ¶
LoadVectorIndex util function to load the vector index from the specified file handle
func LoadVectorIndexFromFile ¶
LoadVectorIndexFromFile load vector index from a specified file path
func OnlineDownload ¶
func OnlineDownload()
Types ¶
type Header ¶
type Header struct { // data []byte Version uint16 IndexPolicy IndexPolicy CreatedAt uint32 StartIndexPtr uint32 EndIndexPtr uint32 }
func LoadHeader ¶
LoadHeader load the header info from the specified handle
func LoadHeaderFromBuff ¶
LoadHeaderFromBuff wrap the header info from the content buffer
func LoadHeaderFromFile ¶
LoadHeaderFromFile load header info from the specified db file path
type IndexPolicy ¶
type IndexPolicy int
const ( VectorIndexPolicy IndexPolicy = 1 BTreeIndexPolicy IndexPolicy = 2 )
func (IndexPolicy) String ¶
func (i IndexPolicy) String() string
type QueryResult ¶
type QueryResult struct { Ip string `json:"ip,omitempty"` // ip Country string `json:"country,omitempty"` // 国家 Province string `json:"province,omitempty"` // 省份 City string `json:"city,omitempty"` // 城市 Operator string `json:"operator,omitempty"` // 运营商 }
QueryResult 返回
type Searcher ¶
type Searcher struct {
// contains filtered or unexported fields
}
func NewWithBuffer ¶
func NewWithFileOnly ¶
func (*Searcher) GetIOCount ¶
GetIOCount return the global io count for the last search
Click to show internal directories.
Click to hide internal directories.