diff options
Diffstat (limited to 'model/client4.go')
-rw-r--r-- | model/client4.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go index 1e4ba86ac..6b9a389c9 100644 --- a/model/client4.go +++ b/model/client4.go @@ -783,6 +783,16 @@ func (c *Client4) GetFile(fileId string) ([]byte, *Response) { } } +// GetFileInfosForPost gets all the file info objects attached to a post. +func (c *Client4) GetFileInfosForPost(postId string, etag string) ([]*FileInfo, *Response) { + if r, err := c.DoApiGet(c.GetPostRoute(postId)+"/files/info", etag); err != nil { + return nil, &Response{StatusCode: r.StatusCode, Error: err} + } else { + defer closeBody(r) + return FileInfosFromJson(r.Body), BuildResponse(r) + } +} + // General Section // GetPing will ping the server and to see if it is up and running. |