lookup

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	Metadata *xsync.MapOf[string, *maxminddb.Metadata]
	// contains filtered or unexported fields
}

func NewService

func NewService(ctx context.Context, logger log.Interface, config models.ConfigDB, rslv *dns.Resolver) *Service

func (*Service) Lookup

func (s *Service) Lookup(ctx context.Context, addr string, r *models.LookupOptions) (result *models.Response, err error)

Lookup does a geoip lookup of an address.

func (*Service) MatchLanguage

func (s *Service) MatchLanguage(dbType string, languages []string) (match string)

type Updater

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

Updater is a service for monitoring database updates.

func NewUpdater

func NewUpdater(config models.ConfigDB, logger log.Interface, lookupSvc *Service, dbType string) *Updater

NewUpdater returns a new service for monitoring database updates. If an update is needed, it will be downloaded, decompressed, verified, and installed.

func (*Updater) Start

func (u *Updater) Start(ctx context.Context) (err error)

Start initiates checks for updates, and if an update is needed, it starts the update process.

Jump to

Keyboard shortcuts

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