diff options
Diffstat (limited to 'model/client.go')
-rw-r--r-- | model/client.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/model/client.go b/model/client.go index d31ac1592..a6a527963 100644 --- a/model/client.go +++ b/model/client.go @@ -280,6 +280,14 @@ func (c *Client) LoginByEmail(name string, email string, password string) (*Resu return c.login(m) } +func (c *Client) LoginByUsername(name string, username string, password string) (*Result, *AppError) { + m := make(map[string]string) + m["name"] = name + m["username"] = username + m["password"] = password + return c.login(m) +} + func (c *Client) LoginByEmailWithDevice(name string, email string, password string, deviceId string) (*Result, *AppError) { m := make(map[string]string) m["name"] = name @@ -398,6 +406,15 @@ func (c *Client) GetLogs() (*Result, *AppError) { } } +func (c *Client) GetAllAudits() (*Result, *AppError) { + if r, err := c.DoApiGet("/admin/audits", "", ""); err != nil { + return nil, err + } else { + return &Result{r.Header.Get(HEADER_REQUEST_ID), + r.Header.Get(HEADER_ETAG_SERVER), AuditsFromJson(r.Body)}, nil + } +} + func (c *Client) GetClientProperties() (*Result, *AppError) { if r, err := c.DoApiGet("/admin/client_props", "", ""); err != nil { return nil, err |