Skip to content

frederic-arr/ripedb-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RIPE DB Go Client

This is a Go client for the RIPE Database RESTful Web Service API. It is a simple wrapper around the API, providing a more convenient way to interact with the RIPE Database.

Features

  • Generic resource queries
  • Create/Update/Delete operations on single resources
  • Authentification schemes
    • Anonymous
    • Password
    • (Soon) X.509

Library

Installation

go get github.com/frederic-arr/ripedb-go/cmd/ripedb@latest

Usage

A basic Go program that fetches the CERN organisation from the RIPE Database and prints its name.

package main

import (
	"fmt"
	"os"

	"github.com/frederic-arr/ripedb-go/ripedb"
)

func main() {
    client = ripedb.NewRipeAnonymousClient()
    org, err := client.GetOrganisation("ORG-CEOf1-RIPE")
    if err != nil {
        log.Fatal(err)
        os.Exit(1)
    }

    fmt.Println(org.OrgName)
}

CLI

Installation

go install github.com/frederic-arr/ripedb-go/cmd/ripedb@latest

Usage

ripedb <resource> <key>

Example

$ ripedb organisation ORG-CEOf1-RIPE

Terminal screenshot of the output Terminal screenshot of the output

Text output
# This is the RIPE Database search service.
# The objects are in RPSL (RFC 2622) format.
# The RIPE Database is subject to Terms and Conditions.
organisation:  ORG-CEOf1-RIPE
org-name:      CERN - European Organization for Nuclear Research
country:       CH
org-type:      LIR
address:       CERN
address:       CH-1211
address:       Geneva 23
address:       SWITZERLAND
phone:         +41 22 76 72613
admin-c:       EM1969
admin-c:       DGR6-RIPE
tech-c:        CERN513
abuse-c:       CERN513
mnt-ref:       RIPE-NCC-HM-MNT
mnt-ref:       CERN-MNT
mnt-by:        RIPE-NCC-HM-MNT
mnt-by:        CERN-MNT
created:       2004-04-17T11:02:00Z
last-modified: 2021-06-29T07:00:23Z
source:        RIPE # Filtered

License

Copyright (c) The RIPE DB Go Client Authors. Apache 2.0 License.

About

Simple Go client for the RIPE Database.

Topics

Resources

License

Stars

Watchers

Forks

Languages