gonextcloud/README.md

48 lines
1.5 KiB
Markdown
Raw Normal View History

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
[![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-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
```
## Usage
```go
package main
import (
"fmt"
2018-10-08 16:50:11 +00:00
"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 .
```