@@ -38,17 +38,24 @@ type key int
3838
3939const downloadImplKey key = 0
4040
41+ // downloadImpl defines the interface for downloading files.
4142type downloadImpl interface {
4243 Download (context.Context , string , []string ) error
4344}
4445
4546var log = logrus .StandardLogger ()
4647
48+ // ociGatherer and httpGatherer hold gatherer instances configured with
49+ // tracing and retry transports via WithTransport. Initialized once by
50+ // _initialize via sync.OnceFunc.
4751var (
4852 ociGatherer * goci.OCIGatherer
4953 httpGatherer * ghttp.HTTPGatherer
5054)
5155
56+ // gatherFunc dispatches sources to the appropriate gatherer. OCI and HTTP
57+ // scheme prefixes route to custom gatherers; all other sources fall through
58+ // to the go-gather registry.
5259var gatherFunc = func (ctx context.Context , source , destination string ) (metadata.Metadata , error ) {
5360 initialize ()
5461
@@ -71,6 +78,8 @@ var gatherFunc = func(ctx context.Context, source, destination string) (metadata
7178 return g .Gather (ctx , source , destination )
7279}
7380
81+ // _initialize builds the transport stack (optional tracing + retry) and
82+ // constructs the OCI and HTTP gatherer instances.
7483var _initialize = func () {
7584 var base net_http.RoundTripper = net_http .DefaultTransport
7685
0 commit comments