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.