Documentation
¶
Index ¶
- Variables
- type CSVDumper
- type CSVEntity
- type CustomDatabase
- func (db *CustomDatabase) CheckUpdates(ctx context.Context) (source.Update[source.ModTimeVersion], error)
- func (db *CustomDatabase) Lookup(ctx context.Context, ip net.IP, result interface{}) error
- func (db *CustomDatabase) MetaData(ctx context.Context) (*maxminddb.Metadata, error)
- func (db *CustomDatabase) Networks(ctx context.Context, options ...maxminddb.NetworksOption) (*maxminddb.Networks, error)
- func (db *CustomDatabase) RawData(ctx context.Context) (io.Reader, error)
- func (db *CustomDatabase) Update(ctx context.Context, force bool) error
- type Database
- type DatabasePatch
- func (db *DatabasePatch) Available() bool
- func (db *DatabasePatch) Lookup(ctx context.Context, ip net.IP, result interface{}) error
- func (db *DatabasePatch) MetaData(ctx context.Context) (*maxminddb.Metadata, error)
- func (db *DatabasePatch) Networks(ctx context.Context, options ...maxminddb.NetworksOption) (*maxminddb.Networks, error)
- func (db *DatabasePatch) RawData(ctx context.Context) (io.Reader, error)
- func (db *DatabasePatch) WithMetadata(meta maxminddb.Metadata) *DatabasePatch
- type JSONRecordReader
- type MMDBRecord
- type MMDBRecordReader
- type MaxmindCSVDumper
- type MaxmindDatabase
- func (db *MaxmindDatabase) CheckUpdates(ctx context.Context) (entity.Update[entity.MMDBVersion], error)
- func (db *MaxmindDatabase) Lookup(ctx context.Context, ip net.IP, result interface{}) error
- func (db *MaxmindDatabase) MetaData(ctx context.Context) (*maxminddb.Metadata, error)
- func (db *MaxmindDatabase) Networks(ctx context.Context, options ...maxminddb.NetworksOption) (*maxminddb.Networks, error)
- func (db *MaxmindDatabase) RawData(ctx context.Context) (io.Reader, error)
- func (db *MaxmindDatabase) Update(ctx context.Context, force bool) error
- type MultiMaxMindDB
- func (db *MultiMaxMindDB) Add(dbs ...Database) *MultiMaxMindDB
- func (db *MultiMaxMindDB) Lookup(ctx context.Context, ip net.IP, result interface{}) error
- func (db *MultiMaxMindDB) MetaData(ctx context.Context) (*maxminddb.Metadata, error)
- func (db *MultiMaxMindDB) Networks(ctx context.Context, options ...maxminddb.NetworksOption) (*maxminddb.Networks, error)
- func (db *MultiMaxMindDB) RawData(ctx context.Context) (io.Reader, error)
- func (db *MultiMaxMindDB) Reader(ctx context.Context) (*maxminddb.Reader, error)
- type PatchedDatabase
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoDatabases = errors.New("no databases")
Functions ¶
This section is empty.
Types ¶
type CustomDatabase ¶
type CustomDatabase struct {
// contains filtered or unexported fields
}
func NewCustomDatabase ¶
func NewCustomDatabase(ctx context.Context, source *source.TSUpdatableFile) *CustomDatabase
func (*CustomDatabase) CheckUpdates ¶
func (db *CustomDatabase) CheckUpdates(ctx context.Context) (source.Update[source.ModTimeVersion], error)
func (*CustomDatabase) Networks ¶
func (db *CustomDatabase) Networks(ctx context.Context, options ...maxminddb.NetworksOption) (*maxminddb.Networks, error)
type Database ¶
type Database interface {
Lookup(ctx context.Context, 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(ctx context.Context, options ...maxminddb.NetworksOption) (*maxminddb.Networks, error)
RawData(ctx context.Context) (io.Reader, error) // mmdb
MetaData(ctx context.Context) (*maxminddb.Metadata, error)
}
func NewDatabasePatchesFromTarGz ¶
func NewDatabasePatchesFromTarGz(source *source.TSUpdatableFile) ([]Database, error)
type DatabasePatch ¶
type DatabasePatch struct {
// contains filtered or unexported fields
}
func NewDatabasePatch ¶
func NewDatabasePatch(reader MMDBRecordReader) (*DatabasePatch, error)
func NewDatabasePatchFromJSON ¶
func NewDatabasePatchFromJSON(source *source.TSUpdatableFile) (*DatabasePatch, error)
func (*DatabasePatch) Available ¶
func (db *DatabasePatch) Available() bool
func (*DatabasePatch) Networks ¶
func (db *DatabasePatch) Networks(ctx context.Context, options ...maxminddb.NetworksOption) (*maxminddb.Networks, error)
func (*DatabasePatch) WithMetadata ¶
func (db *DatabasePatch) WithMetadata(meta maxminddb.Metadata) *DatabasePatch
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(ctx context.Context, source *source.MMDBSource) (*MaxmindDatabase, error)
func (*MaxmindDatabase) CheckUpdates ¶
func (db *MaxmindDatabase) CheckUpdates(ctx context.Context) (entity.Update[entity.MMDBVersion], error)
func (*MaxmindDatabase) Networks ¶
func (db *MaxmindDatabase) Networks(ctx context.Context, 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) Networks ¶
func (db *MultiMaxMindDB) Networks(ctx context.Context, options ...maxminddb.NetworksOption) (*maxminddb.Networks, error)
type PatchedDatabase ¶
type PatchedDatabase struct {
*MultiMaxMindDB
// contains filtered or unexported fields
}
func NewPatchedDatabase ¶
func NewPatchedDatabase(db *MaxmindDatabase) *PatchedDatabase
func (*PatchedDatabase) CheckUpdates ¶
func (db *PatchedDatabase) CheckUpdates(ctx context.Context) (entity.Update[entity.PatchedMMDBVersion], error)
func (*PatchedDatabase) SetCustom ¶
func (db *PatchedDatabase) SetCustom(custom *CustomDatabase) *PatchedDatabase
Source Files
¶
Click to show internal directories.
Click to hide internal directories.