Transfer code from API repo to own repo

This commit is contained in:
Fornax committed 2021-03-09 18:11:23 +01:00
1 parent 0e5d737209
commit 5c74f774ff
12 files changed
+473 -1

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
package pixelapi
import (
"net/url"
"fornaxian.tech/pixeldrain_server/api/restapi/apitype"
)
// GetFilesystemBuckets returns a list of buckets for the user. You need to be
// authenticated
func (p *PixelAPI) GetFilesystemBuckets() (resp []apitype.Bucket, err error) {
return resp, p.jsonRequest("GET", "filesystem", &resp)
}
// GetFilesystemPath opens a filesystem path
func (p *PixelAPI) GetFilesystemPath(path string) (resp apitype.FilesystemPath, err error) {
return resp, p.jsonRequest("GET", "filesystem/"+url.PathEscape(path)+"?stat", &resp)
}