mirror of
https://gitlab.bertha.cloud/partitio/Nextcloud-Partitio/gonextcloud
synced 2025-07-14 21:48:27 +00:00
48 lines
1.5 KiB
Markdown
48 lines
1.5 KiB
Markdown

|
|
|
|
[](http://gitlab.adphi.fr/partitio/Nextcloud-Partitio/gonextcloud/commits/master)
|
|
[](http://gitlab.adphi.fr/partitio/Nextcloud-Partitio/gonextcloud/commits/master)
|
|
[](https://goreportcard.com/report/gitlab.adphi.fr/partitio/Nextcloud-Partitio/gonextcloud)
|
|
[](https://godoc.org/gitlab.adphi.fr/partitio/Nextcloud-Partitio/gonextcloud)
|
|
# GoNextcloud
|
|
|
|
A simple Client for Nextcloud's Provisioning API in Go.
|
|
|
|
|
|
```go
|
|
import "gitlab.adphi.fr/partitio/Nextcloud-Partitio/gonextcloud"
|
|
```
|
|
|
|
|
|
## Usage
|
|
|
|
```go
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"gitlab.adphi.fr/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()
|
|
}
|
|
```
|
|
## Run tests
|
|
Configure the tests for your instance by editing [example.config.yml](example.config.yml) and renaming it config.yml
|
|
|
|
then run the tests :
|
|
```bash
|
|
$ go test -v .
|
|
```
|