INNER CODE UNIT · Go

newUploadStream

256dpi/lungo · bucket.go:749

func newUploadStream(ctx context.Context, bucket *Bucket, id interface{}, name string, chunkSize int, metadata interface{}) *UploadStream {
	return &UploadStream{
		context:   ctx,
		bucket:    bucket,
		id:        id,
		name:      name,
		metadata:  metadata,
		chunkSize: chunkSize,
		buffer:    make([]byte, gridfs.UploadBufferSize),
	}
}

// Resume will try to resume a previous tracked upload that has been suspended.
// It will return the amount of bytes that have already been written.
func (s *UploadStream) Resume() (int64, error) {
	// acquire mutex
	s.mutex.Lock()
	defer s.mutex.Unlock()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…