ipgeo

package
v0.0.0-...-4dce753 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedQuerier

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

func NewCachedQuerier

func NewCachedQuerier(inner Querier, getter func(ctx context.Context, ip string) (*Info, bool, error), setter func(ctx context.Context, ip string, info *Info) error) *CachedQuerier

func (*CachedQuerier) Query

func (c *CachedQuerier) Query(ctx context.Context, ip string) (*Info, error)

type Info

type Info struct {
	Ip        net.IP
	Location  string
	Latitude  float64
	Longitude float64
}

type IpapiComQuerier

type IpapiComQuerier struct{}

func (*IpapiComQuerier) Query

func (i *IpapiComQuerier) Query(ctx context.Context, ip string) (*Info, error)

type Querier

type Querier interface {
	Query(ctx context.Context, ip string) (*Info, error)
}

func NewIpapiComQuerier

func NewIpapiComQuerier() Querier

Jump to

Keyboard shortcuts

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