Skip to content

Commit

Permalink
Added readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gboddin committed Jul 15, 2020
1 parent 0578f68 commit ccfc0cc
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# LeakIXClient

This is a Go library making queries to LeakIX easier.


## Usage

```golang
package main
import (
"fmt"
"gitlab.nobody.run/tbi/LeakIXClient"
)

func main(){
// Create a searcher
LeakIXSearch := LeakIXClient.SearchResultsClient{
Scope: "leak",
Query: "protocol:kafka AND \"telecom_italia_data\"",
}
// Iterate, the lib will query further pages if needed
for LeakIXSearch.Next() {
// Use the result
leak := LeakIXSearch.SearchResult()
fmt.Printf("%s:%s - Country:%s\n", leak.Ip, leak.Port, leak.GeoLocation.CountryName)
}
}

```
19 changes: 19 additions & 0 deletions example/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package main
import (
"fmt"
"gitlab.nobody.run/tbi/LeakIXClient"
)

func main(){
// Create a searcher
LeakIXSearch := LeakIXClient.SearchResultsClient{
Scope: "leak",
Query: "protocol:kafka AND \"telecom_italia_data\"",
}
// Iterate, the lib will query further pages if needed
for LeakIXSearch.Next() {
// Use the result
leak := LeakIXSearch.SearchResult()
fmt.Printf("%s:%s - Country:%s\n", leak.Ip, leak.Port, leak.GeoLocation.CountryName)
}
}

0 comments on commit ccfc0cc

Please sign in to comment.