czdb

package
v0.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldCountry = "country"
	FieldArea    = "area"
)
View Source
const (
	DBFormat = "czdb"
	DBExt    = ".czdb"
	DBKey    = ""
)

Variables

View Source
var CommonFieldsAlias = map[string]string{
	model.Country: FieldCountry,
	model.ISP:     FieldArea,
}

CommonFieldsAlias 公共字段到数据库字段映射

View Source
var FullFields = []string{
	FieldCountry,
	FieldArea,
}

FullFields 全字段列表

Functions

This section is empty.

Types

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader is a structure that provides functionalities to read from CZDB IP database.

func NewReader

func NewReader(file string) (*Reader, error)

NewReader initializes a new instance of Reader.

func (*Reader) Close

func (r *Reader) Close() error

Close releases any resources used by the Reader and closes the MMDB database.

func (*Reader) Find

func (r *Reader) Find(ip net.IP) (*model.IPInfo, error)

func (*Reader) Meta

func (r *Reader) Meta() *model.Meta

func (*Reader) SetOption

func (r *Reader) SetOption(option interface{}) error

SetOption applies the provided option to the Reader's configuration.

type ReaderOption

type ReaderOption struct {
	Key string
}

ReaderOption contains configuration options for the Reader.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL