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-
21# Gopkg.toml example
32#
43# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
1716# source = "github.com/myfork/project2"
1817#
1918# [[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
2226
2327
28+ [[constraint ]]
29+ name = " github.com/go-resty/resty"
30+ version = " 1.5.0"
31+
2432[[constraint ]]
2533 name = " github.com/labstack/gommon"
26- version = " 0.2.3 "
34+ version = " 0.2.5 "
2735
2836[[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 (
2222)
2323
2424func main () {
25- client := labstack.NewClient (" <ACCOUNT_ID> " , " < API_KEY>" )
25+ client := labstack.NewClient (" <API_KEY>" )
2626 res , err := client.GeocodeAddress (&labstack.GeocodeAddressRequest {
2727 Location: " eiffel tower" ,
2828 })
Original file line number Diff line number Diff line change @@ -2,19 +2,16 @@ package labstack
22
33import (
44 "fmt"
5- "os"
65
76 "github.com/go-resty/resty"
87 "github.com/labstack/gommon/log"
9- "github.com/shirou/gopsutil/process"
108)
119
1210type (
1311 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
1815 }
1916
2017 Download struct {
@@ -34,27 +31,18 @@ const (
3431)
3532
3633// NewClient creates a new client for the LabStack API.
37- func NewClient (accountID , apiKey string ) * Client {
34+ func NewClient (apiKey string ) * Client {
3835 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" ),
4339 }
4440}
4541
4642func (c * Client ) error (r * resty.Response ) bool {
4743 return r .StatusCode () < 200 || r .StatusCode () >= 300
4844}
4945
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-
5846func (c * Client ) Download (id string , path string ) (err * APIError ) {
5947 _ , e := c .resty .R ().
6048 SetOutput (path ).
You can’t perform that action at this time.
0 commit comments