From d9390244afe90ed318ac8c263c19328f16dc2562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Fri, 22 Jun 2018 11:15:19 +0200 Subject: MM-8810: Add CSV Compliance export (#8966) * MM-8810: Add CSV Compliance export * Only allowing to schedule actiances export throught the cli * De-duplicating some code * Fixes on texts * Fixes on translations --- utils/file_backend_s3.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'utils/file_backend_s3.go') diff --git a/utils/file_backend_s3.go b/utils/file_backend_s3.go index 6f1fa9ab0..a0c46e5d3 100644 --- a/utils/file_backend_s3.go +++ b/utils/file_backend_s3.go @@ -82,6 +82,18 @@ func (b *S3FileBackend) TestConnection() *model.AppError { return nil } +func (b *S3FileBackend) Reader(path string) (io.ReadCloser, *model.AppError) { + s3Clnt, err := b.s3New() + if err != nil { + return nil, model.NewAppError("Reader", "api.file.reader.s3.app_error", nil, err.Error(), http.StatusInternalServerError) + } + minioObject, err := s3Clnt.GetObject(b.bucket, path, s3.GetObjectOptions{}) + if err != nil { + return nil, model.NewAppError("Reader", "api.file.reader.s3.app_error", nil, err.Error(), http.StatusInternalServerError) + } + return minioObject, nil +} + func (b *S3FileBackend) ReadFile(path string) ([]byte, *model.AppError) { s3Clnt, err := b.s3New() if err != nil { -- cgit v1.2.3-1-g7c22