2018-07-25 13:06:31 +00:00
|
|
|
package gonextcloud
|
2018-07-05 10:50:56 +00:00
|
|
|
|
|
|
|
import "net/url"
|
|
|
|
|
2018-07-30 08:08:35 +00:00
|
|
|
// Routes references the available routes
|
2018-07-05 10:50:56 +00:00
|
|
|
type Routes struct {
|
|
|
|
capabilities *url.URL
|
|
|
|
users *url.URL
|
|
|
|
groups *url.URL
|
2018-07-24 18:26:12 +00:00
|
|
|
apps *url.URL
|
2018-07-31 11:24:20 +00:00
|
|
|
monitor *url.URL
|
2018-08-08 14:04:06 +00:00
|
|
|
shares *url.URL
|
2018-09-03 10:17:02 +00:00
|
|
|
groupfolders *url.URL
|
2018-07-05 10:50:56 +00:00
|
|
|
}
|
|
|
|
|
2018-07-24 18:26:12 +00:00
|
|
|
const badRequest = 998
|
|
|
|
|
2018-07-05 10:50:56 +00:00
|
|
|
var (
|
2018-08-08 14:04:06 +00:00
|
|
|
apiPath = &url.URL{Path: "/ocs/v2.php"}
|
2018-07-05 10:50:56 +00:00
|
|
|
routes = Routes{
|
2018-07-31 11:24:20 +00:00
|
|
|
capabilities: &url.URL{Path: apiPath.Path + "/cloud/capabilities"},
|
|
|
|
users: &url.URL{Path: apiPath.Path + "/cloud/users"},
|
|
|
|
groups: &url.URL{Path: apiPath.Path + "/cloud/groups"},
|
|
|
|
apps: &url.URL{Path: apiPath.Path + "/cloud/apps"},
|
|
|
|
monitor: &url.URL{Path: apiPath.Path + "/apps/serverinfo/api/v1/info"},
|
2018-08-08 14:04:06 +00:00
|
|
|
shares: &url.URL{Path: apiPath.Path + "/apps/files_sharing/api/v1/shares"},
|
2018-09-03 10:17:02 +00:00
|
|
|
groupfolders: &url.URL{Path: "apps/groupfolders/folders"},
|
2018-07-05 10:50:56 +00:00
|
|
|
}
|
|
|
|
)
|