File tree Expand file tree Collapse file tree 5 files changed +97
-249
lines changed Expand file tree Collapse file tree 5 files changed +97
-249
lines changed Original file line number Diff line number Diff line change 1
-
2
1
# Gopkg.toml example
3
2
#
4
3
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
17
16
# source = "github.com/myfork/project2"
18
17
#
19
18
# [[override]]
20
- # name = "github.com/x/y"
21
- # version = "2.4.0"
19
+ # name = "github.com/x/y"
20
+ # version = "2.4.0"
21
+ #
22
+ # [prune]
23
+ # non-go = false
24
+ # go-tests = true
25
+ # unused-packages = true
22
26
23
27
28
+ [[constraint ]]
29
+ name = " github.com/go-resty/resty"
30
+ version = " 1.5.0"
31
+
24
32
[[constraint ]]
25
33
name = " github.com/labstack/gommon"
26
- version = " 0.2.3 "
34
+ version = " 0.2.5 "
27
35
28
36
[[constraint ]]
29
- name = " github.com/go-resty/resty"
30
- version = " 1.0.0"
37
+ name = " github.com/shirou/gopsutil"
38
+ version = " 2.18.4"
39
+
40
+ [prune ]
41
+ go-tests = true
42
+ unused-packages = true
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ import (
22
22
)
23
23
24
24
func main () {
25
- client := labstack.NewClient (" <ACCOUNT_ID> " , " < API_KEY>" )
25
+ client := labstack.NewClient (" <API_KEY>" )
26
26
res , err := client.GeocodeAddress (&labstack.GeocodeAddressRequest {
27
27
Location: " eiffel tower" ,
28
28
})
Original file line number Diff line number Diff line change @@ -2,19 +2,16 @@ package labstack
2
2
3
3
import (
4
4
"fmt"
5
- "os"
6
5
7
6
"github.com/go-resty/resty"
8
7
"github.com/labstack/gommon/log"
9
- "github.com/shirou/gopsutil/process"
10
8
)
11
9
12
10
type (
13
11
Client struct {
14
- accountID string
15
- apiKey string
16
- resty * resty.Client
17
- logger * log.Logger
12
+ apiKey string
13
+ resty * resty.Client
14
+ logger * log.Logger
18
15
}
19
16
20
17
Download struct {
@@ -34,27 +31,18 @@ const (
34
31
)
35
32
36
33
// NewClient creates a new client for the LabStack API.
37
- func NewClient (accountID , apiKey string ) * Client {
34
+ func NewClient (apiKey string ) * Client {
38
35
return & Client {
39
- accountID : accountID ,
40
- apiKey : apiKey ,
41
- resty : resty .New ().SetHostURL (apiURL ).SetAuthToken (apiKey ),
42
- logger : log .New ("labstack" ),
36
+ apiKey : apiKey ,
37
+ resty : resty .New ().SetHostURL (apiURL ).SetAuthToken (apiKey ),
38
+ logger : log .New ("labstack" ),
43
39
}
44
40
}
45
41
46
42
func (c * Client ) error (r * resty.Response ) bool {
47
43
return r .StatusCode () < 200 || r .StatusCode () >= 300
48
44
}
49
45
50
- func (c * Client ) Cube () * Cube {
51
- p , _ := process .NewProcess (int32 (os .Getpid ()))
52
- return & Cube {
53
- process : p ,
54
- client : c ,
55
- }
56
- }
57
-
58
46
func (c * Client ) Download (id string , path string ) (err * APIError ) {
59
47
_ , e := c .resty .R ().
60
48
SetOutput (path ).
You can’t perform that action at this time.
0 commit comments