Documentation ¶
Index ¶
- Constants
- type Detail
- type IP
- type Location
- type LocationRaw
- type Locator
- type Parser
- func (p *Parser) Close() error
- func (p *Parser) Count() uint32
- func (p *Parser) IndexRange(iterator indexIterator)
- func (p *Parser) ReadByte(pos int64) byte
- func (p *Parser) ReadBytes(pos, n int64) (b []byte)
- func (p *Parser) ReadLocationRaw(offset int64) (raw LocationRaw)
- func (p *Parser) ReadPosition(offset int64) int64
- func (p *Parser) ReadRegion(offset int64) (s []byte)
- func (p *Parser) ReadRegionString(offset int64) string
- func (p *Parser) ReadString(offset int64) (string, int)
- func (p *Parser) ReadText(offset int64) ([]byte, int)
- func (p *Parser) Reader() io.Reader
- func (p *Parser) Size() uint32
Constants ¶
View Source
const (
IPLen = 4
)
View Source
const Version = "1.0"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Detail ¶
type IP ¶
func ParseBytesIP ¶
func ParseUintIP ¶
func (IP) Compare ¶
Compare like bytes.Compare The result will be 0 if == a, -1 if < a, and +1 if > a.
func (IP) ReverseBytes ¶
type Location ¶
type LocationRaw ¶
type Locator ¶
type Locator struct {
// contains filtered or unexported fields
}
func LoadWithoutIndexes ¶
func OpenWithoutIndexes ¶
OpenWithoutIndexes 无索引,不预载文件,打开速度快,但查询速度慢
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func NewParserRes ¶
func (*Parser) IndexRange ¶
func (p *Parser) IndexRange(iterator indexIterator)
(*Parser) IndexRange calls the iterator for every index within the range (i, start, end, Pos) until iterator returns false.
func (*Parser) ReadLocationRaw ¶
func (p *Parser) ReadLocationRaw(offset int64) (raw LocationRaw)
ReadLocationRaw 用于导出或索引
func (*Parser) ReadPosition ¶
(*Parser) ReadPosition 读取3字节的偏移位置
func (*Parser) ReadRegion ¶
(*Parser) ReadRegion 读取地区数据,处理可能的重定向
func (*Parser) ReadRegionString ¶
Click to show internal directories.
Click to hide internal directories.