Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hslatman/greynoise-go

A GreyNoise API client for Go
https://github.com/hslatman/greynoise-go

golang greynoise

Last synced: about 1 month ago
JSON representation

A GreyNoise API client for Go

Awesome Lists containing this project

README

        

# greynoise-go

## Usage

```bash
go get github.com/hslatman/greynoise-go
```

```go
package main

import (
"log"
"net"
"github.com/hslatman/greynoise-go/client"
)

func main() {
key := ""
c, err := client.New(key)
if err != nil {
log.Fatal(err)
}

if _, err := c.Ping(); err != nil {
log.Fatal(err)
}

r, err := c.Community(net.ParseIP("127.0.0.1"))
if err != nil {
// NOTE: a 404 is also an error, but can actually be OK.
log.Fatal(err)
}

fmt.Printf("IP: %s; Classification: %s\n", r.IP, r.Classification)
}
```