Documentation
¶
Index ¶
- Variables
- type CSVDumper
- type CSVEntity
- type CustomMaxMindDB
- func (db *CustomMaxMindDB) Available() bool
- func (db *CustomMaxMindDB) Lookup(ip net.IP, result interface{}) error
- func (db *CustomMaxMindDB) MetaData() (*maxminddb.Metadata, error)
- func (db *CustomMaxMindDB) Networks(options ...maxminddb.NetworksOption) (*maxminddb.Networks, error)
- func (db *CustomMaxMindDB) RawData() (io.Reader, error)
- func (db *CustomMaxMindDB) WithMetadata(meta maxminddb.Metadata) *CustomMaxMindDB
- type Database
- type JSONRecordReader
- type MMDBRecord
- type MMDBRecordReader
- type MaxmindCSVDumper
- type MaxmindDatabase
- type MultiMaxMindDB
- func (db *MultiMaxMindDB) Add(dbs ...Database) *MultiMaxMindDB
- func (db *MultiMaxMindDB) Lookup(ip net.IP, result interface{}) error
- func (db *MultiMaxMindDB) MetaData() (*maxminddb.Metadata, error)
- func (db *MultiMaxMindDB) Networks(options ...maxminddb.NetworksOption) (*maxminddb.Networks, error)
- func (db *MultiMaxMindDB) RawData() (io.Reader, error)
- func (db *MultiMaxMindDB) Reader() (*maxminddb.Reader, error)
- func (db *MultiMaxMindDB) WithLogger(logger log.ServiceLogger) *MultiMaxMindDB
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoDatabases = errors.New("no databases")
Functions ¶
This section is empty.
Types ¶
type CustomMaxMindDB ¶
type CustomMaxMindDB struct {
// contains filtered or unexported fields
}
func NewCustomMaxMindDB ¶
func NewCustomMaxMindDB(reader MMDBRecordReader) (*CustomMaxMindDB, error)
func NewCustomMaxMindDBFromFile ¶
func NewCustomMaxMindDBFromFile(path string) (*CustomMaxMindDB, error)
func (*CustomMaxMindDB) Available ¶
func (db *CustomMaxMindDB) Available() bool
func (*CustomMaxMindDB) Lookup ¶
func (db *CustomMaxMindDB) Lookup(ip net.IP, result interface{}) error
func (*CustomMaxMindDB) MetaData ¶
func (db *CustomMaxMindDB) MetaData() (*maxminddb.Metadata, error)
func (*CustomMaxMindDB) Networks ¶
func (db *CustomMaxMindDB) Networks(options ...maxminddb.NetworksOption) (*maxminddb.Networks, error)
func (*CustomMaxMindDB) WithMetadata ¶
func (db *CustomMaxMindDB) WithMetadata(meta maxminddb.Metadata) *CustomMaxMindDB
type Database ¶
type Database interface { Lookup(ip net.IP, result interface{}) error // LookupNetwork(ip net.IP, result interface{}) (network *net.IPNet, ok bool, err error) // LookupOffset(ip net.IP) (uintptr, error) Networks(options ...maxminddb.NetworksOption) (*maxminddb.Networks, error) RawData() (io.Reader, error) // mmdb MetaData() (*maxminddb.Metadata, error) }
type JSONRecordReader ¶
type JSONRecordReader struct {
// contains filtered or unexported fields
}
func NewJSONRecordReader ¶
func NewJSONRecordReader(r io.Reader) (recordReader *JSONRecordReader, err error)
func (*JSONRecordReader) ReadMMDBRecord ¶
func (r *JSONRecordReader) ReadMMDBRecord() (record MMDBRecord, err error)
type MMDBRecordReader ¶
type MMDBRecordReader interface {
ReadMMDBRecord() (MMDBRecord, error)
}
type MaxmindCSVDumper ¶
func NewCSVDumper ¶
func NewCSVDumper[T CSVEntity](db Database) *MaxmindCSVDumper[T]
func (MaxmindCSVDumper[T]) WriteCSVTo ¶
type MaxmindDatabase ¶
type MaxmindDatabase struct {
// contains filtered or unexported fields
}
func Open ¶
func Open(path string) (*MaxmindDatabase, error)
func (*MaxmindDatabase) Lookup ¶
func (db *MaxmindDatabase) Lookup(ip net.IP, result interface{}) error
func (*MaxmindDatabase) MetaData ¶
func (db *MaxmindDatabase) MetaData() (*maxminddb.Metadata, error)
func (*MaxmindDatabase) Networks ¶
func (db *MaxmindDatabase) Networks(options ...maxminddb.NetworksOption) (*maxminddb.Networks, error)
type MultiMaxMindDB ¶
type MultiMaxMindDB struct {
// contains filtered or unexported fields
}
func NewMultiMaxMindDB ¶
func NewMultiMaxMindDB(dbs ...Database) *MultiMaxMindDB
func (*MultiMaxMindDB) Add ¶
func (db *MultiMaxMindDB) Add(dbs ...Database) *MultiMaxMindDB
func (*MultiMaxMindDB) Lookup ¶
func (db *MultiMaxMindDB) Lookup(ip net.IP, result interface{}) error
func (*MultiMaxMindDB) MetaData ¶
func (db *MultiMaxMindDB) MetaData() (*maxminddb.Metadata, error)
func (*MultiMaxMindDB) Networks ¶
func (db *MultiMaxMindDB) Networks(options ...maxminddb.NetworksOption) (*maxminddb.Networks, error)
func (*MultiMaxMindDB) Reader ¶
func (db *MultiMaxMindDB) Reader() (*maxminddb.Reader, error)
func (*MultiMaxMindDB) WithLogger ¶
func (db *MultiMaxMindDB) WithLogger(logger log.ServiceLogger) *MultiMaxMindDB
Click to show internal directories.
Click to hide internal directories.