@@ -16,10 +16,22 @@ The Greip Go library allows you to easily interact with the Greip API to access
16
16
17
17
## Installation
18
18
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:
20
32
21
33
``` bash
22
- go get github.com/Greipio /go
34
+ go mod download github.com/greipio /go
23
35
```
24
36
25
37
## Usage
@@ -31,15 +43,15 @@ package main
31
43
32
44
import (
33
45
" fmt"
34
- " github.com/Greipio /go"
46
+ " github.com/greipio /go"
35
47
)
36
48
37
49
func main () {
38
50
// Initialize the Greip instance with your API token
39
51
greipInstance := greip.NewGreip (" YOUR_API_TOKEN" )
40
52
41
53
// 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 " } )
43
55
if err != nil {
44
56
fmt.Println (" Error:" , err)
45
57
return
@@ -91,7 +103,7 @@ greipInstance := greip.NewGreip("YOUR_API_TOKEN", true)
91
103
The library returns error for invalid parameters and request-related issues. Here’s an example of handling errors:
92
104
93
105
``` go
94
- response , err := greipInstance.Lookup (" INVALID_IP" )
106
+ response , err := greipInstance.Lookup (" INVALID_IP" , nil )
95
107
if err != nil {
96
108
fmt.Println (" Error:" , err)
97
109
return
0 commit comments