service

package
v0.0.0-...-5f57c41 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBType

type DBType = repository.MaxmindDBType

type DumpFormat

type DumpFormat = repository.DumpFormat

type GeoIpService

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

func NewGeoIpService

func NewGeoIpService(rep GeoRepository) *GeoIpService

func (*GeoIpService) City

func (s *GeoIpService) City(ctx context.Context, address string, includeISP bool) (*entity.City, error)

func (*GeoIpService) CityLite

func (s *GeoIpService) CityLite(ctx context.Context, address string, lang string) (*entity.CityLite, error)

func (*GeoIpService) Country

func (s *GeoIpService) Country(ctx context.Context, address string) (*entity.Country, error)

func (*GeoIpService) Database

func (r *GeoIpService) Database(ctx context.Context, dbType DBType, format DumpFormat) (*entity.Database, error)

func (*GeoIpService) MetaData

func (r *GeoIpService) MetaData(ctx context.Context, dbType DBType) (*entity.MetaData, error)

type GeoNameRepository

type GeoNameRepository interface {
	Continents(ctx context.Context) []*entity.GeoNameContinent
	Countries(ctx context.Context, filter entity.GeoNameFilter) ([]*entity.GeoNameCountry, error)
	Subdivisions(ctx context.Context, filter entity.GeoNameFilter) ([]*entity.GeoNameAdminSubdivision, error)
	Cities(ctx context.Context, filter entity.GeoNameFilter) ([]*entity.GeoName, error)
	Dump(ctx context.Context, format DumpFormat) ([]byte, error)
}

type GeoNameService

type GeoNameService struct {
	GeoNameRepository
}

func NewGeoNameService

func NewGeoNameService(rep GeoNameRepository) *GeoNameService

func (*GeoNameService) Cities

func (s *GeoNameService) Cities(ctx context.Context, filter entity.GeoNameFilter) ([]*entity.GeoName, error)

func (*GeoNameService) Continents

func (s *GeoNameService) Continents(ctx context.Context) []*entity.GeoNameContinent

func (*GeoNameService) Countries

func (s *GeoNameService) Countries(ctx context.Context, filter entity.GeoNameFilter) ([]*entity.GeoNameCountry, error)

func (*GeoNameService) Dump

func (s *GeoNameService) Dump(ctx context.Context, format DumpFormat) ([]byte, error)

func (*GeoNameService) Subdivisions

type GeoRepository

type GeoRepository interface {
	Country(ctx context.Context, ip net.IP) (*entity.Country, error)
	City(ctx context.Context, ip net.IP, includeISP bool) (*entity.City, error)
	CityLite(ctx context.Context, ip net.IP, lang string) (*entity.CityLite, error)
	MetaData(ctx context.Context, dbType DBType) (*entity.MetaData, error)
	Database(ctx context.Context, dbType DBType, format DumpFormat) (*entity.Database, error)
}

Jump to

Keyboard shortcuts

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