mirror of
https://github.com/rclone/rclone.git
synced 2024-12-04 22:34:48 +01:00
57d5de6fba
git grep -l github.com/ncw/rclone | xargs -d'\n' perl -i~ -lpe 's|github.com/ncw/rclone|github.com/rclone/rclone|g' goimports -w `find . -name \*.go`
40 lines
788 B
Go
40 lines
788 B
Go
package koofrclient
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
httpclient "github.com/koofr/go-httpclient"
|
|
)
|
|
|
|
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
|
|
}
|