2018-10-16 07:34:56 +00:00
|
|
|
/*
|
2019-07-23 07:52:34 +00:00
|
|
|
Package gonextcloud is a simple Go Client for Nextcloud's API.
|
2018-10-16 07:34:56 +00:00
|
|
|
|
|
|
|
For more information about the Provisioning API, see the documentation:
|
|
|
|
https://docs.nextcloud.com/server/13/admin_manual/configuration_user/user_provisioning_api.html
|
|
|
|
|
|
|
|
Usage
|
|
|
|
|
|
|
|
You use the library by creating a client object and calling methods on it.
|
|
|
|
|
|
|
|
For example, to list all the Nextcloud's instance users:
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2018-10-26 15:23:16 +00:00
|
|
|
"gitlab.bertha.cloud/partitio/Nextcloud-Partitio/gonextcloud"
|
2018-10-16 07:34:56 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
url := "https://www.mynextcloud.com"
|
|
|
|
username := "admin"
|
|
|
|
password := "password"
|
2019-07-22 14:40:42 +00:00
|
|
|
c, err := gonextcloud.NewClient(url)
|
2018-10-16 07:34:56 +00:00
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
if err := c.Login(username, password); err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
defer c.Logout()
|
|
|
|
|
2019-07-30 18:52:32 +00:00
|
|
|
users, err := c.Users().List()
|
2018-10-16 07:34:56 +00:00
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
2019-07-22 14:17:11 +00:00
|
|
|
fmt.Println("users :", users)
|
2018-10-16 07:34:56 +00:00
|
|
|
}
|
|
|
|
*/
|
|
|
|
package gonextcloud
|