-
Notifications
You must be signed in to change notification settings - Fork 0
/
gcp.storage.go
executable file
·38 lines (31 loc) · 1.07 KB
/
gcp.storage.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package storage
import (
"context"
"encoding/json"
eruaes "github.com/eru-tech/eru/eru-crypto/aes"
logs "github.com/eru-tech/eru/eru-logs/eru-logs"
"mime/multipart"
)
type GcpStorage struct {
Storage
}
func (gcpStorage *GcpStorage) UploadFile(ctx context.Context, file multipart.File, header *multipart.FileHeader, docType string, folderPath string, keyName eruaes.AesKey) (docId string, err error) {
return docId, err
}
func (gcpStorage *GcpStorage) UploadFileB64(ctx context.Context, file []byte, fileName string, docType string, folderPath string, keyName eruaes.AesKey) (docId string, err error) {
return docId, err
}
func (gcpStorage *GcpStorage) DownloadFile(ctx context.Context, folderPath string, fileName string, keyName eruaes.AesKey) (file []byte, err error) {
return
}
func (gcpStorage *GcpStorage) Init(ctx context.Context) error {
return nil
}
func (gcpStorage *GcpStorage) MakeFromJson(ctx context.Context, rj *json.RawMessage) error {
err := json.Unmarshal(*rj, &gcpStorage)
if err != nil {
logs.WithContext(ctx).Error(err.Error())
return err
}
return nil
}