2018-07-25 17:54:40 +00:00
|
|
|
![Nextcloud](https://upload.wikimedia.org/wikipedia/commons/thumb/6/60/Nextcloud_Logo.svg/640px-Nextcloud_Logo.svg.png)
|
2018-07-30 08:48:17 +00:00
|
|
|
|
2018-10-16 16:24:09 +00:00
|
|
|
[![pipeline status](http://gitlab.adphi.fr/partitio/Nextcloud-Partitio/gonextcloud/badges/master/pipeline.svg)](http://gitlab.adphi.fr/partitio/Nextcloud-Partitio/gonextcloud/commits/master)
|
|
|
|
[![coverage report](http://gitlab.adphi.fr/partitio/Nextcloud-Partitio/gonextcloud/badges/master/coverage.svg)](http://gitlab.adphi.fr/partitio/Nextcloud-Partitio/gonextcloud/commits/master)
|
2018-10-08 16:50:11 +00:00
|
|
|
[![Go Report Card](https://goreportcard.com/badge/gitlab.adphi.fr/partitio/Nextcloud-Partitio/gonextcloud)](https://goreportcard.com/report/gitlab.adphi.fr/partitio/Nextcloud-Partitio/gonextcloud)
|
2018-10-16 17:09:04 +00:00
|
|
|
[![GoDoc](https://godoc.org/gitlab.com/gitlab.adphi.fr/partitio/Nextcloud-Partitio/gonextcloud?status.svg)](https://godoc.org/gitlab.adphi.fr/partitio/Nextcloud-Partitio/gonextcloud)
|
2018-07-25 14:55:45 +00:00
|
|
|
# GoNextcloud
|
|
|
|
|
|
|
|
A simple Client for Nextcloud's Provisioning API in Go.
|
2018-07-05 10:50:56 +00:00
|
|
|
|
2018-07-25 14:41:16 +00:00
|
|
|
|
2018-07-09 11:37:44 +00:00
|
|
|
```go
|
2018-10-16 17:09:04 +00:00
|
|
|
import "gitlab.adphi.fr/partitio/Nextcloud-Partitio/gonextcloud"
|
2018-07-09 11:37:44 +00:00
|
|
|
```
|
2018-07-09 11:36:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Usage
|
2018-07-25 14:41:16 +00:00
|
|
|
|
2018-07-05 10:50:56 +00:00
|
|
|
```go
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2018-10-08 16:50:11 +00:00
|
|
|
"gitlab.adphi.fr/partitio/Nextcloud-Partitio/gonextcloud"
|
2018-07-05 10:50:56 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
url := "https://www.mynextcloud.com"
|
|
|
|
username := "admin"
|
|
|
|
password := "password"
|
2018-07-25 14:41:16 +00:00
|
|
|
c, err := gonextcloud.NewClient(url)
|
2018-07-05 10:50:56 +00:00
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
if err := c.Login(username, password); err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
defer c.Logout()
|
|
|
|
}
|
2018-07-09 11:36:07 +00:00
|
|
|
```
|
2018-07-30 08:47:32 +00:00
|
|
|
## 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 .
|
|
|
|
```
|