Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DFRoundTripper ¶
type DFRoundTripper struct { Round *http.Transport Round2 http.RoundTripper ShouldUseDfget func(req *http.Request) bool Downloader downloader.Interface }
DFRoundTripper implements RoundTripper for dfget. It uses http.fileTransport to serve requests that need to use dfget, and uses http.Transport to serve the other requests.
type Option ¶ added in v0.4.0
type Option func(rt *DFRoundTripper) error
Option is functional config for DFRoundTripper
func WithCondition ¶ added in v0.4.0
WithCondition configures how to decide whether to use dfget or not
func WithDownloader ¶ added in v0.4.0
func WithDownloader(d downloader.Interface) Option
WithDownloader sets the downloader for the roundTripper
Click to show internal directories.
Click to hide internal directories.