Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/DNS-OARC/ripeatlas

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/DNS-OARC/ripeatlas

  • v0.1.1
  • Source
  • Go
  • Socket score

Version published
Created
Source

Go bindings for RIPE Atlas API

GoDoc

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 and examples/reader/main.go.
  • To use REST API see Http and examples/reader/main.go.
  • To use Streaming API see 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

CallStatusFunc
/api/v2/measurements/HTTP onlyAtlaser.Measurements()
/api/v2/measurements/{pk}HTTP onlyAtlaser.Measurements()
/api/v2/measurements/{pk}/latest/DoneAtlaser.MeasurementLatest()
/api/v2/measurements/{pk}/results/DoneAtlaser.MeasurementResults()

participation-requests

probes

CallStatusFunc
/api/v2/probes/HTTP onlyAtlaser.Probes()
/api/v2/probes/{pk}HTTP onlyAtlaser.Probes()

Objects

Implementation status of objects (by type) decribed by https://atlas.ripe.net/docs/data_struct/ .

TypeFirewareStatus
dns4610 to 4760Done
ping4610 to 4760Done
traceroute4610 to 4760Done
http4610 to 4760Done
ntp4610 to 4760Done
sslcert4610 to 4760Done
wifi4610 to 4760Done (undocumented by RIPE)

Usage

See or test more complete examples in the examples directory.

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 jerry@dns-oarc.net

License

MIT License

Copyright (c) 2022 OARC, Inc.

FAQs

Package last updated on 16 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc