asnannotator

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASNAnnotator added in v0.3.0

type ASNAnnotator interface {
	annotator.Annotator
	Reload(context.Context)
	AnnotateIP(src string) *annotator.Network
}

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

func New

func New(ctx context.Context, as4 content.Provider, as6 content.Provider, asnamedata content.Provider, localIPs []net.IP) ASNAnnotator

New makes a new Annotator that uses IP addresses to lookup ASN metadata for that IP based on the current copy of RouteViews data stored in the given providers.

func NewFake added in v0.4.3

func NewFake() ASNAnnotator

NewFake returns an annotator that know about just one v4 IP (1.2.3.4) and one v6 IP (1111:2222:3333:4444:5555:6666:7777:8888). This is useful for testing other components when you don't want to carry around canonical datafiles, or for building up a local IP annotation service with known outputs for testing.

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

func NewIPv4 added in v0.5.6

func NewIPv4(ctx context.Context, as4 content.Provider) ASNAnnotator

NewIPv4 makes a new IPv4-only Annotator that uses IP addresses to lookup ASN metadata for that IP based on the current copy of RouteViews data stored in the given providers.

Jump to

Keyboard shortcuts

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