https://github.com/dns-oarc/ripeatlas
Go bindings for RIPE Atlas API
https://github.com/dns-oarc/ripeatlas
api bindings go golang ripe-atlas
Last synced: 7 months ago
JSON representation
Go bindings for RIPE Atlas API
- Host: GitHub
- URL: https://github.com/dns-oarc/ripeatlas
- Owner: DNS-OARC
- License: mit
- Created: 2017-04-23T08:43:41.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2022-11-16T10:22:50.000Z (over 2 years ago)
- Last Synced: 2024-06-22T16:45:48.979Z (12 months ago)
- Topics: api, bindings, go, golang, ripe-atlas
- Language: Go
- Homepage:
- Size: 101 KB
- Stars: 12
- Watchers: 8
- Forks: 12
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Go bindings for RIPE Atlas API
[](https://godoc.org/github.com/DNS-OARC/ripeatlas)
## About
Go bindings for the RIPE Atlas API to retrieve measurements and other data,
can read from JSON files or use the REST API. Will decode the data into Go
objects and have helper functions to easily access the data within.## Atlaser
`Atlaser` is the interface to access RIPE Atlas and there are a few
different ways to do so:
- To read JSON files see [File](https://godoc.org/github.com/DNS-OARC/ripeatlas#File) and `examples/reader/main.go`.
- To use REST API see [Http](https://godoc.org/github.com/DNS-OARC/ripeatlas#Http) and `examples/reader/main.go`.
- To use Streaming API see [Stream](https://godoc.org/github.com/DNS-OARC/ripeatlas#Stream) and `examples/streamer/main.go`.## REST API
Implementation status of API calls described by https://atlas.ripe.net/docs/api/v2/reference/ .
### anchor-measurements
### anchors
### credits
### keys
### measurements
Call | Status | Func
---- | ------ | -----
/api/v2/measurements/ | HTTP only | Atlaser.Measurements()
/api/v2/measurements/{pk} | HTTP only | Atlaser.Measurements()
/api/v2/measurements/{pk}/latest/ | Done | Atlaser.MeasurementLatest()
/api/v2/measurements/{pk}/results/ | Done | Atlaser.MeasurementResults()### participation-requests
### probes
Call | Status | Func
---- | ------ | -----
/api/v2/probes/ | HTTP only | Atlaser.Probes()
/api/v2/probes/{pk} | HTTP only | Atlaser.Probes()## Objects
Implementation status of objects (by type) decribed by https://atlas.ripe.net/docs/data_struct/ .
Type | Fireware | Status
---- | -------- | ------
dns | 4610 to 4760 | Done
ping | 4610 to 4760 | Done
traceroute | 4610 to 4760 | Done
http | 4610 to 4760 | Done
ntp | 4610 to 4760 | Done
sslcert | 4610 to 4760 | Done
wifi | 4610 to 4760 | Done (undocumented by RIPE)## Usage
See or test more complete examples in the [examples directory](https://github.com/DNS-OARC/ripeatlas/tree/master/examples).
```go
import (
"fmt"
"github.com/DNS-OARC/ripeatlas"
)// Read Atlas results from a file
a := ripeatlas.Atlaser(ripeatlas.NewFile())
c, err := a.MeasurementResults(ripeatlas.Params{"file": name})
if err != nil {
...
}
for r := range c {
if r.ParseError != nil {
...
}
fmt.Printf("%d %s\n", r.MsmId(), r.Type())
}// Read Atlas results using REST API
a := ripeatlas.Atlaser(ripeatlas.NewHttp())
c, err := a.MeasurementResults(ripeatlas.Params{"pk": id})
if err != nil {
...
}
for r := range c {
if r.ParseError != nil {
...
}
fmt.Printf("%d %s\n", r.MsmId(), r.Type())
}// Read DNS measurements using Streaming API
a := ripeatlas.Atlaser(ripeatlas.NewStream())
c, err := a.MeasurementResults(ripeatlas.Params{"type": "dns"})
if err != nil {
...
}
for r := range c {
if r.ParseError != nil {
...
}
fmt.Printf("%d %s\n", r.MsmId(), r.Type())
}
```## Author(s)
Jerry Lundström
## License
```
MIT LicenseCopyright (c) 2022 OARC, Inc.
```