Documentation ¶
Index ¶
- Constants
- func CheckIP(ip string) (uint32, error)
- func CheckSegments(segList []*Segment) error
- func IterateSegments(handle *os.File, before func(l string), cb func(seg *Segment) error) error
- func Long2IP(ip uint32) string
- func MidIP(sip uint32, eip uint32) uint32
- type Header
- type IndexPolicy
- type Maker
- type Searcher
- type Segment
- type XDBMaker
- type XDBSearcher
Constants ¶
View Source
const HeaderInfoLength = 256
View Source
const (
SegmentIndexBlockSize = 14
)
View Source
const SegmentIndexSize = 14
View Source
const VectorIndexCols = 256
View Source
const VectorIndexLength = VectorIndexRows * VectorIndexCols * VectorIndexSize
View Source
const VectorIndexRows = 256
View Source
const VectorIndexSize = 8
View Source
const VersionNo = 2
Variables ¶
This section is empty.
Functions ¶
func CheckSegments ¶
func IterateSegments ¶
Types ¶
type Header ¶
type Header struct { // data []byte Version uint16 IndexPolicy IndexPolicy CreatedAt uint32 StartIndexPtr uint32 EndIndexPtr uint32 }
type IndexPolicy ¶
type IndexPolicy int
const ( VectorIndexPolicy IndexPolicy = 1 BTreeIndexPolicy IndexPolicy = 2 )
func (IndexPolicy) String ¶
func (i IndexPolicy) String() string
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
type Segment ¶
func SegmentFrom ¶
func (*Segment) AfterCheck ¶
AfterCheck check the current segment is the one just after the specified one
type XDBMaker ¶
type XDBMaker struct {
*Maker
}
func NewXDBMakerByBtree ¶
func NewXDBMakerByVector ¶
func (*XDBMaker) GenXDBFile ¶
type XDBSearcher ¶
type XDBSearcher struct {
*Searcher
}
func NewXDBSearcher ¶
func NewXDBSearcher(filePath string) (ret *XDBSearcher, err error)
func (*XDBSearcher) Search ¶
func (self *XDBSearcher) Search(ipaddr string) string
Click to show internal directories.
Click to hide internal directories.