Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StripFirstDir ¶
StripFirstDir removes the first dir but keep all its children.
Types ¶
type DefaultTransport ¶
type DefaultTransport struct {
UA string
}
DefaultTransport is the default http transport for fetchup, it auto handles the gzip and user-agent.
type Fetchup ¶
type Fetchup struct { Ctx context.Context // To is the path to save the file. To string // URLs is the list of candidates, the fastest one will be used to download the file. URLs []string Logger Logger // SpeedPacketSize is the size of the packet used to calculate the download speed. // The size should be much smaller than the whole file size to download. SpeedPacketSize int MinReportSpan time.Duration HttpClient *http.Client }
func (*Fetchup) FastestURL ¶
type Log ¶
type Log func(msg ...interface{})
Log type for Println
func MultiLogger ¶
MultiLogger is similar to https://golang.org/pkg/io/#MultiWriter
Click to show internal directories.
Click to hide internal directories.