go-ripestat

module
v0.0.0-...-7e7373f Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: MIT

README

go-ripestat

A client for the RIPEstat DATA API written in Go.

API Documentation

Client Documentation

Installation

# Go Modules
require github.com/jtarasovic/go-ripestat/client

alternatively,

go get -u github.com/jtarasovic/go-ripestat/client

Usage

import "github.com/jtarasovic/go-ripestat/client"

There are examples documented for each call. You can either view it online or in the client/ source directory.

Basic Example
package main

import (
    "fmt"
    "github.com/jtarasovic/go-ripestat/client"
)

func main() {
    c := NewClient()
    r, err := c.ExampleResources()
    if err != nil {
    // handle error sanely
        panic(err)
    }
    // result is map[string]interface{} currently
    // see API documentation for returned data
    fmt.Println(r["data"])
}
Using Client Options
package main

import (
    "fmt"
    "github.com/jtarasovic/go-ripestat/client"
)

func main() {
    c := NewClient()
        // helps RIPE identify callers. please include something unique for you application
        .WithSourceApp("my-app")


    resource := "193/23"                    // prefix or IP range
    starttime := "2019-01-01T00:00:00"      // ISO8601 or Unix timestamp
    endtime := "2019-07-01T00:00:00"        // ISO8601 or Unix timestamp

    r, err := c.Blacklist(resource, starttime, endtime)
    if err != nil {
        // handle error sanely
        panic(err)
    }
    // result is map[string]interface{} currently
    // see API documentation for returned data
    fmt.Println(r["data"])
}

Directories

Path Synopsis
Package client represents the full RIPEstat DATA API.
Package client represents the full RIPEstat DATA API.

Jump to

Keyboard shortcuts

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