// ExampleNewUploader_overrideTransport gives an example
// on how to override the default HTTP transport. This can
// be used to tune timeouts such as response headers, or
// write / read buffer usage when writing or reading respectively
// from the net/http transport.
ExampleNewUploader_overrideTransport gives an example
on how to override the default HTTP transport. This can
be used to tune timeouts such as response headers, or
write / read buffer usage when writing or reading respectively
from the net/http transport.
// ExampleNewUploader_overrideTransport gives an example // on how to override the default HTTP transport . This can // be used to tune timeouts such as response headers or // write / read buffer usage when writing or reading respectively // from the net / http transport .
func ExampleNewUploader_overrideTransport() {
	cfg, err := config.LoadDefaultConfig()
	if err != nil {
		panic(err)
	}
	client := s3.NewFromConfig(cfg, func(o *s3.Options) {
		o.HTTPClient = aws.NewBuildableHTTPClient().WithTransportOptions(func(tr *http.Transport) {
			tr.ResponseHeaderTimeout = 1 * time.Second
			tr.WriteBufferSize = 1024 * 1024
			tr.ReadBufferSize = 1024 * 1024
		})
	})
	uploader := manager.NewUploader(client)
	_, err = uploader.Upload(context.Background(), &s3.PutObjectInput{
		Bucket: aws.String("examplebucket"),
		Key:    aws.String("largeobject"),
		Body:   bytes.NewReader([]byte("large_multi_part_upload")),
	})
	if err != nil {
		panic(err)
	}
}
func ExampleNewUploader_overrideTransport ( ) { cfg , err := config . LoadDefaultConfig ( ) if err != nil { panic ( err ) } client := s3 . NewFromConfig ( cfg , func ( o * s3 . Options ) { o . HTTPClient = aws . NewBuildableHTTPClient ( ) . WithTransportOptions ( func ( tr * http . Transport ) { tr . ResponseHeaderTimeout = 1 * time . Second tr . WriteBufferSize = 1024 * 1024 tr . ReadBufferSize = 1024 * 1024 } ) } ) uploader := manager . NewUploader ( client ) _ , err = uploader . Upload ( context . Background ( ) , & s3 . PutObjectInput { Bucket : aws . String ( " " ) , Key : aws . String ( " " ) , Body : bytes . NewReader ( [ ] byte ( " " ) ) , } ) if err != nil { panic ( err ) } }
ExampleNewUploader_overrideTransport gives an example
on how to override the default HTTP transport.
ExampleNewUploader_overrideTransport gives an example on how to override the default HTTP transport .
// Override Default Transport Values