玩弄golang
parquet 包并遇到s3.NewS3FileWriter
接受以下论点的函数[]func(*s3manager.Uploader)
func NewS3FileWriter(
ctx context.Context,
bucket string,
key string,
uploaderOptions []func(*s3manager.Uploader),
cfgs ...*aws.Config,
) (source.ParquetFile, error) {
if activeS3Session == nil {
sessLock.Lock()
if activeS3Session == nil {
activeS3Session = session.Must(session.NewSession())
}
sessLock.Unlock()
}
file := &S3File{
ctx: ctx,
client: s3.New(activeS3Session, cfgs...),
writeDone: make(chan error),
uploaderOptions: uploaderOptions,
BucketName: bucket,
Key: key,
}
return file.Create(key)
}
是什么[]func(*s3manager.Uploader)
意思?以及如何通过修改版本的s3Manager.Uploader
? 例如,如果我想更改默认值。