feat: add chunked desktop client release uploads
This commit is contained in:
@@ -2,6 +2,7 @@ package objectstorage
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"sync"
|
||||
)
|
||||
|
||||
@@ -31,6 +32,19 @@ func (c *ReloadableClient) PutBytes(ctx context.Context, objectKey string, conte
|
||||
return c.snapshot().PutBytes(ctx, objectKey, content, contentType)
|
||||
}
|
||||
|
||||
func (c *ReloadableClient) PutReader(ctx context.Context, objectKey string, reader io.Reader, size int64, contentType string) error {
|
||||
client := c.snapshot()
|
||||
readerClient, ok := client.(ReaderClient)
|
||||
if !ok {
|
||||
content, err := io.ReadAll(reader)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return client.PutBytes(ctx, objectKey, content, contentType)
|
||||
}
|
||||
return readerClient.PutReader(ctx, objectKey, reader, size, contentType)
|
||||
}
|
||||
|
||||
func (c *ReloadableClient) GetBytes(ctx context.Context, objectKey string) ([]byte, error) {
|
||||
return c.snapshot().GetBytes(ctx, objectKey)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user