geoannotator

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GeoAnnotator added in v0.3.0

type GeoAnnotator interface {
	annotator.Annotator
	Reload(context.Context)
	AnnotateIP(ip net.IP, geo **annotator.Geolocation) error
}

GeoAnnotator is just a regular annotator with a Reload method and an AnnotateIP method.

func New

func New(ctx context.Context, geo content.Provider, localIPs []net.IP) GeoAnnotator

New makes a new Annotator that uses IP addresses to generate geolocation and ASNumber metadata for that IP based on the current copy of MaxMind data stored in GCS.

func NewFake added in v0.4.3

func NewFake() GeoAnnotator

NewFake creates a fake GeoAnnotator that contains no data. This is to aid others in creating their own annotation services for testing.

TODO(http://github.com/m-lab/uuid-annotator/issues/38): Consider moving this fake to its own subpackage.

Jump to

Keyboard shortcuts

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