Fetcher returns a fetch.Interface based on the configuration. If no configuration source is set, this method returns nil, nil.
(ctx context.Context, blobConf BlobConfig, httpClientProvider httpclient.Provider, )
| 627 | // Fetcher returns a fetch.Interface based on the configuration. |
| 628 | // If no configuration source is set, this method returns nil, nil. |
| 629 | func (c MTLSAuthConfig) Fetcher(ctx context.Context, |
| 630 | blobConf BlobConfig, |
| 631 | httpClientProvider httpclient.Provider, |
| 632 | ) (fetch.Interface, error) { |
| 633 | switch c.Source { |
| 634 | case "directory": |
| 635 | return fetch.FromFilesystem(c.Directory), nil |
| 636 | case "blob": |
| 637 | b, err := blobConf.Bucket(ctx, c.Blob.Bucket, httpClientProvider) |
| 638 | if err != nil { |
| 639 | return nil, err |
| 640 | } |
| 641 | return fetch.FromBucket(ctx, b, c.Blob.Path), nil |
| 642 | default: |
| 643 | return nil, nil |
| 644 | } |
| 645 | } |
nothing calls this directly
no test coverage detected