Transfer code from API repo to own repo

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

18
pixelapi/filesystem.go Normal file
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)
}