mirror of
https://gitlab.bertha.cloud/partitio/Nextcloud-Partitio/gonextcloud
synced 2024-11-22 07:06:25 +00:00
Fix indent in README.md
This commit is contained in:
parent
8268907940
commit
16ca38c4e4
46
README.md
46
README.md
@ -21,32 +21,32 @@ You use the library by creating a client object and calling methods on it.
|
|||||||
|
|
||||||
For example, to list all the Nextcloud's instance users:
|
For example, to list all the Nextcloud's instance users:
|
||||||
```go
|
```go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"gitlab.adphi.fr/partitio/Nextcloud-Partitio/gonextcloud/client"
|
"gitlab.adphi.fr/partitio/Nextcloud-Partitio/gonextcloud/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
url := "https://www.mynextcloud.com"
|
url := "https://www.mynextcloud.com"
|
||||||
username := "admin"
|
username := "admin"
|
||||||
password := "password"
|
password := "password"
|
||||||
c, err := client.NewClient(url)
|
c, err := client.NewClient(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
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)
|
|
||||||
}
|
}
|
||||||
|
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)
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Run tests
|
## Run tests
|
||||||
|
Loading…
Reference in New Issue
Block a user