summaryrefslogtreecommitdiffstats
path: root/model/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/client.go')
-rw-r--r--model/client.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/model/client.go b/model/client.go
index a5016fa2c..6fcfa5043 100644
--- a/model/client.go
+++ b/model/client.go
@@ -390,6 +390,15 @@ func (c *Client) GetChannels(etag string) (*Result, *AppError) {
}
}
+func (c *Client) GetChannel(id, etag string) (*Result, *AppError) {
+ if r, err := c.DoGet("/channels/"+id+"/", "", etag); err != nil {
+ return nil, err
+ } else {
+ return &Result{r.Header.Get(HEADER_REQUEST_ID),
+ r.Header.Get(HEADER_ETAG_SERVER), ChannelDataFromJson(r.Body)}, nil
+ }
+}
+
func (c *Client) GetMoreChannels(etag string) (*Result, *AppError) {
if r, err := c.DoGet("/channels/more", "", etag); err != nil {
return nil, err
@@ -399,6 +408,15 @@ func (c *Client) GetMoreChannels(etag string) (*Result, *AppError) {
}
}
+func (c *Client) GetChannelCounts(etag string) (*Result, *AppError) {
+ if r, err := c.DoGet("/channels/counts", "", etag); err != nil {
+ return nil, err
+ } else {
+ return &Result{r.Header.Get(HEADER_REQUEST_ID),
+ r.Header.Get(HEADER_ETAG_SERVER), ChannelCountsFromJson(r.Body)}, nil
+ }
+}
+
func (c *Client) JoinChannel(id string) (*Result, *AppError) {
if r, err := c.DoPost("/channels/"+id+"/join", ""); err != nil {
return nil, err