| giolekva | 7be17df | 2020-03-21 13:57:02 +0400 | [diff] [blame] | 1 | package client |
| 2 | |||||
| 3 | import "os" | ||||
| 4 | |||||
| 5 | import "pcloud/api" | ||||
| 6 | |||||
| 7 | type FileUploader struct { | ||||
| 8 | client api.MetadataStorageServerClient | ||||
| 9 | } | ||||
| 10 | |||||
| 11 | func NewFileUploader(client api.MetadataStorageServerClient) *FileUploader { | ||||
| 12 | return FileUploader{client} | ||||
| 13 | } | ||||
| 14 | |||||
| 15 | func (fu *FileUploader) Upload(f *os.File) (n int64, err error) { | ||||
| 16 | |||||
| 17 | buf := make([]byte, 1000) | ||||
| 18 | for { | ||||
| 19 | n, err := f.Read(buf) | ||||
| 20 | } | ||||
| 21 | } | ||||