Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/hslatman/greynoise-go
- Owner: hslatman
- Created: 2021-03-26T20:45:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-03-27T00:21:42.000Z (over 3 years ago)
- Last Synced: 2024-06-20T10:17:57.666Z (5 months ago)
- Topics: golang, greynoise
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# greynoise-go
## Usage
```bash
go get github.com/hslatman/greynoise-go
``````go
package mainimport (
"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)
}
```