File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ import (
30
30
// TODO: add sessions options
31
31
32
32
// DefaultChunkSize is the default size of each file chunk.
33
- const DefaultChunkSize int32 = 255 * 1000 // 255 KB
33
+ const DefaultChunkSize int32 = 255 * 1024 // 255 KiB
34
34
35
35
// ErrFileNotFound occurs if a user asks to download a file with a file ID that isn't found in the files collection.
36
36
var ErrFileNotFound = errors .New ("file with given parameters not found" )
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import (
21
21
22
22
// UploadBufferSize is the size in bytes of one stream batch. Chunks will be written to the db after the sum of chunk
23
23
// lengths is equal to the batch size.
24
- const UploadBufferSize = 16 * 1000000 // 16 MB
24
+ const UploadBufferSize = 16 * 1024 * 1024 // 16 MiB
25
25
26
26
// ErrStreamClosed is an error returned if an operation is attempted on a closed/aborted stream.
27
27
var ErrStreamClosed = errors .New ("stream is closed or aborted" )
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ package options
9
9
import (
10
10
"time"
11
11
12
+ "github.com/mongodb/mongo-go-driver/mongo/gridfs"
12
13
"github.com/mongodb/mongo-go-driver/mongo/readconcern"
13
14
"github.com/mongodb/mongo-go-driver/mongo/readpref"
14
15
"github.com/mongodb/mongo-go-driver/mongo/writeconcern"
@@ -19,7 +20,7 @@ import (
19
20
var DefaultName = "fs"
20
21
21
22
// DefaultChunkSize is the default size of each file chunk in bytes.
22
- var DefaultChunkSize int32 = 255 * 1000
23
+ var DefaultChunkSize = gridfs . DefaultChunkSize
23
24
24
25
// DefaultRevision is the default revision number for a download by name operation.
25
26
var DefaultRevision int32 = - 1
You can’t perform that action at this time.
0 commit comments