func (w *BatchedFileWriter) Name() string {
	return w.fileName
}
Name is part of the BatchedWriter interface and wraps the file.Name() implementation
package awss3
import (
	"fmt"
	"strings"
	"gollum/core/components"
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/s3"
	"github.com/sirupsen/logrus"
)
const minUploadPartSize = 5 * 1024 * 1024
type BatchedFileWriterInterface interface {
	components.BatchedWriter
	GetUploadCount() int
}
type BatchedFileWriter struct {
	s3Client    *s3.S3
	s3Bucket    string
	s3SubFolder string
	fileName    string
	logger      logrus.FieldLogger
	currentMultiPart int64                
	s3UploadID       *string              
	totalSize        int                  
	completedParts   []*s3.CompletedPart  
	activeBuffer *s3ByteBuffer
}
func NewBatchedFileWriter(s3Client *s3.S3, bucket string, fileName string, logger logrus.FieldLogger) BatchedFileWriter {
	var s3Bucket, s3SubFolder string
	if strings.Contains(bucket, "/") {
		split := strings.SplitN(bucket, "/", 2)
		s3Bucket, s3SubFolder = split[0], split[1]
	} else {
		s3Bucket = bucket
		s3SubFolder = ""
	}
	batchedFileWriter := BatchedFileWriter{
		s3Client:    s3Client,
		s3Bucket:    s3Bucket,
		s3SubFolder: s3SubFolder,
		fileName:    fileName,
		logger:      logger,
	}
	batchedFileWriter.init()
	return batchedFileWriter
}
func (w *BatchedFileWriter) init() {
	w.totalSize = 0
	w.currentMultiPart = 0
	w.completedParts = []*s3.CompletedPart{}
	w.activeBuffer = newS3ByteBuffer()
	w.createMultipartUpload()
}
func (w *BatchedFileWriter) Write(p []byte) (n int, err error) {
	w.activeBuffer.Write(p)
	if size, _ := w.activeBuffer.Size(); size >= minUploadPartSize {
		w.logger.WithField("size", size).Debug("Buffer size ready for request")
		w.uploadPartInput()
	} else {
		w.logger.WithField("size", size).Debug("Buffer size not big enough vor request")
	}
	length := len(p)
	w.totalSize += length
	return length, nil
}