package
0.0.0-20220308170854-f83cb7a5233c
Repository: https://github.com/m-lab/annotation-service.git
Documentation: pkg.go.dev
# Functions
Annotate is a URL handler that looks up IP address and puts metadata out to the response encoded in json format.
AnnotateLegacy uses a single `date` to select an annotator, and uses that annotator to annotate all `ips`.
AnnotateV2 finds an appropriate Annotator based on the requested Date, and creates a response with annotations for all parseable IPs.
BatchAnnotate is a URL handler that expects the body of the request to contain a JSON encoded slice of api.RequestDatas.
BatchValidateAndParse will take a reader (likely the body of a request) containing the JSON encoded array of api.RequestDatas.
GetMetadataForSingleIP takes a pointer to a api.RequestData struct and will use it to fetch the appropriate associated metadata, returning a GeoData.
InitHandler sets up the annotator directory and registers annotation service HTTP handlers.
Ip6to4 converts "2002:" ipv6 address back to ipv4.
NewBatchResponse returns a new response struct.
ValidateAndParse takes a request and validates the URL parameters, verifying that it has a valid ip address and time.
# Structs
BatchResponse is the response type for batch requests.