github.com/blend/go-sdk@v1.20240719.1/r2/opt_transport.go (about) 1 /* 2 3 Copyright (c) 2024 - Present. Blend Labs, Inc. All rights reserved 4 Use of this source code is governed by a MIT license that can be found in the LICENSE file. 5 6 */ 7 8 package r2 9 10 import ( 11 "net/http" 12 ) 13 14 // OptTransport sets the client transport for a request. 15 func OptTransport(transport http.RoundTripper) Option { 16 return func(r *Request) error { 17 if r.Client == nil { 18 r.Client = &http.Client{} 19 } 20 r.Client.Transport = transport 21 return nil 22 } 23 }