mirror of
https://gitlab.bertha.cloud/partitio/Nextcloud-Partitio/gonextcloud
synced 2024-11-22 00:06:25 +00:00
client | ||
docs | ||
vendor | ||
.gitignore | ||
gonextcloud.iml | ||
README.md |
[WIP] Nextcloud Go API Client
A simple Client for Nextcloud's API in Go.
TODO
- Auth
loginlogout
- Users
searchlistget infoscreateupdatedeleteenabledisableget groupsadd to groupremove from groupget subadmin grouppromote subadmindemote subadminsend welcome mail
- Groups
createdeleteget membersget subadmins
- Apps
- list
- get infos
- enable
- disable
client
--
import "github.com/partitio/gonextcloud/client"
Usage
package main
import (
"fmt"
"github.com/partitio/gonextcloud/client"
)
func main() {
url := "https://www.mynextcloud.com"
username := "admin"
password := "password"
c, err := client.NewClient(url)
if err != nil {
panic(err)
}
if err := c.Login(username, password); err != nil {
panic(err)
}
defer c.Logout()
}
func NewClient
func NewClient(hostname string) (*Client, error)
Authentication
func (*Client) Login
func (c *Client) Login(username string, password string) error
func (*Client) Logout
func (c *Client) Logout() error
Users
func (*Client) User
func (c *Client) User(name string) (*types.User, error)
func (*Client) UserCreate
func (c *Client) UserCreate(username string, password string) error
func (*Client) UserDelete
func (c *Client) UserDelete(name string) error
func (*Client) UserDisable
func (c *Client) UserDisable(name string) error
func (*Client) UserEnable
func (c *Client) UserEnable(name string) error
func (*Client) UserGroupAdd
func (c *Client) UserGroupAdd(name string, group string) error
func (*Client) UserGroupDemote
func (c *Client) UserGroupDemote(name string, group string) error
func (*Client) UserGroupList
func (c *Client) UserGroupList(name string) ([]string, error)
func (*Client) UserGroupPromote
func (c *Client) UserGroupPromote(name string, group string) error
func (*Client) UserGroupRemove
func (c *Client) UserGroupRemove(name string, group string) error
func (*Client) UserGroupSubAdminList
func (c *Client) UserGroupSubAdminList(name string) ([]string, error)
func (*Client) UserList
func (c *Client) UserList() ([]string, error)
func (*Client) UserSearch
func (c *Client) UserSearch(search string) ([]string, error)
func (*Client) UserSendWelcomeEmail
func (c *Client) UserSendWelcomeEmail(name string) error
func (*Client) UserUpdateAddress
func (c *Client) UserUpdateAddress(name string, address string) error
func (*Client) UserUpdateDisplayName
func (c *Client) UserUpdateDisplayName(name string, displayName string) error
func (*Client) UserUpdateEmail
func (c *Client) UserUpdateEmail(name string, email string) error
func (*Client) UserUpdatePassword
func (c *Client) UserUpdatePassword(name string, password string) error
func (*Client) UserUpdatePhone
func (c *Client) UserUpdatePhone(name string, phone string) error
func (*Client) UserUpdateQuota
func (c *Client) UserUpdateQuota(name string, quota string) error
func (*Client) UserUpdateTwitter
func (c *Client) UserUpdateTwitter(name string, twitter string) error
func (*Client) UserUpdateWebSite
Groups
func (c *Client) UserUpdateWebSite(name string, website string) error
func (*Client) GroupCreate
func (c *Client) GroupCreate(name string) error
func (*Client) GroupDelete
func (c *Client) GroupDelete(name string) error
func (*Client) GroupList
func (c *Client) GroupList() ([]string, error)
func (*Client) GroupSearch
func (c *Client) GroupSearch(search string) ([]string, error)
func (*Client) GroupSubAdminList
func (c *Client) GroupSubAdminList(name string) ([]string, error)
func (*Client) GroupUsers
func (c *Client) GroupUsers(name string) ([]string, error)