ipinfo

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultProvider

type DefaultProvider struct{}

DefaultProvider implements Provider using the util package

func (*DefaultProvider) GetIPInfo

func (p *DefaultProvider) GetIPInfo(ip string) (*Info, error)

type Info

type Info struct {
	Country    string
	City       string
	RegionName string
	ISP        string
	Org        string
}

Info represents IP location information

type Provider

type Provider interface {
	GetIPInfo(ip string) (*Info, error)
}

Provider defines the interface for getting IP information

func NewProvider

func NewProvider() Provider

NewProvider creates a new default IP info provider

Jump to

Keyboard shortcuts

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