gonextcloud/docs/README.md

46 lines
942 B
Markdown
Raw Permalink Normal View History

# gonextcloud
--
import "."
A simple Go Client for Nextcloud's API.
2018-10-26 07:38:48 +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
2018-10-26 07:38:48 +00:00
### Usage
2018-10-26 07:38:48 +00:00
You use the library by creating a client object and calling methods on it.
2018-10-26 07:38:48 +00:00
For example, to list all the Nextcloud's instance users:
2018-10-26 13:35:50 +00:00
package main
import (
"fmt"
"gitlab.bertha.cloud/partitio/Nextcloud-Partitio/gonextcloud"
)
func main() {
url := "https://www.mynextcloud.com"
username := "admin"
password := "password"
c, err := gonextcloud.NewClient(url)
if err != nil {
panic(err)
}
if err := c.Login(username, password); err != nil {
panic(err)
}
defer c.Logout()
users, err := c.users().List()
if err != nil {
panic(err)
}
fmt.Println("users :", users)
2018-10-26 07:38:48 +00:00
}
## Usage