vendor: add github.com/koofr/go-koofrclient

* added koofr client SDK dep for koofr backend
This commit is contained in:
jaKa
2019-03-06 13:41:43 +00:00
committed by Nick Craig-Wood
parent 27714e29c3
commit 1d14e30383
22 changed files with 1461 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
package koofrclient
import (
"github.com/koofr/go-httpclient"
"net/http"
)
func (c *KoofrClient) Mounts() (mounts []Mount, err error) {
d := &struct {
Mounts *[]Mount
}{&mounts}
request := httpclient.RequestData{
Method: "GET",
Path: "/api/v2/mounts",
ExpectedStatus: []int{http.StatusOK},
RespEncoding: httpclient.EncodingJSON,
RespValue: &d,
}
_, err = c.Request(&request)
return
}
func (c *KoofrClient) MountsDetails(mountId string) (mount Mount, err error) {
request := httpclient.RequestData{
Method: "GET",
Path: "/api/v2/mounts/" + mountId,
ExpectedStatus: []int{http.StatusOK},
RespEncoding: httpclient.EncodingJSON,
RespValue: &mount,
}
_, err = c.Request(&request)
return
}