Skip to content

Commit 5a84c25

Browse files
committed
Update README.md
1 parent 2419c84 commit 5a84c25

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

README.md

+17-5
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,22 @@ The Greip Go library allows you to easily interact with the Greip API to access
1616

1717
## Installation
1818

19-
You can install the Greip library by running:
19+
Add the library to your `go.mod`:
20+
21+
```
22+
module main
23+
24+
go 1.22.1
25+
26+
require (
27+
github.com/greipio/go v0.1.5
28+
)
29+
```
30+
31+
Then, download the Greip library by running:
2032

2133
```bash
22-
go get github.com/Greipio/go
34+
go mod download github.com/greipio/go
2335
```
2436

2537
## Usage
@@ -31,15 +43,15 @@ package main
3143

3244
import (
3345
"fmt"
34-
"github.com/Greipio/go"
46+
"github.com/greipio/go"
3547
)
3648

3749
func main() {
3850
// Initialize the Greip instance with your API token
3951
greipInstance := greip.NewGreip("YOUR_API_TOKEN")
4052

4153
// Example: Lookup IP information
42-
response, err := greipInstance.Lookup("1.1.1.1")
54+
response, err := greipInstance.Lookup("1.1.1.1", []string{"device", "security"})
4355
if err != nil {
4456
fmt.Println("Error:", err)
4557
return
@@ -91,7 +103,7 @@ greipInstance := greip.NewGreip("YOUR_API_TOKEN", true)
91103
The library returns error for invalid parameters and request-related issues. Here’s an example of handling errors:
92104

93105
```go
94-
response, err := greipInstance.Lookup("INVALID_IP")
106+
response, err := greipInstance.Lookup("INVALID_IP", nil)
95107
if err != nil {
96108
fmt.Println("Error:", err)
97109
return

0 commit comments

Comments
 (0)