Documentation
¶
Index ¶
- Variables
- func CopyWithProgress(dst io.Writer, src io.ReadCloser, tpw nod.TotalProgressWriter) error
- func NewFileIndexSetter(filenames []string) *fileIndexSetter
- func NewResourceContext(u *url.URL, pathParts ...string) *resourceContext
- type Client
- type ClientOptions
- type IndexError
- type IndexResult
- type IndexSetter
Constants ¶
This section is empty.
Variables ¶
var DefaultClient = NewClient(http.DefaultClient, Defaults())
Functions ¶
func CopyWithProgress ¶ added in v0.2.0
func CopyWithProgress(dst io.Writer, src io.ReadCloser, tpw nod.TotalProgressWriter) error
func NewFileIndexSetter ¶ added in v0.2.0
func NewFileIndexSetter(filenames []string) *fileIndexSetter
func NewResourceContext ¶ added in v0.2.0
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Download ¶
Download gets remote resource, attempting to resume existing partial downloads if the previous attempt got interrupted. Download supports nod progress reporting. Download will use provided path parts (see NewResourceContext for file name, directory rules), and if no parts were specified - will download to the nextAvailable working directory and use source URL path base for a filename.
func (*Client) GetSet ¶ added in v0.2.0
func (cl *Client) GetSet( urls []*url.URL, indexSetter IndexSetter, tpw nod.TotalProgressWriter) error
GetSet downloads URLs and sets them to storage using indexes. E.g. URLs[index] is expected to be received and set by indexSetter(index). GetSet can use provided http.Client for authenticated requests. Finally, it supports reporting progress via provided nod.TotalProgressWriter object (optional).
type ClientOptions ¶
func Defaults ¶
func Defaults() *ClientOptions
type IndexError ¶ added in v0.2.2
type IndexError struct {
// contains filtered or unexported fields
}
func NewIndexError ¶ added in v0.2.2
func NewIndexError(index int, err error) *IndexError
type IndexResult ¶ added in v0.2.2
type IndexResult struct {
// contains filtered or unexported fields
}
func NewIndexResult ¶ added in v0.2.2
func NewIndexResult(index int, result bool) *IndexResult
type IndexSetter ¶ added in v0.2.0
type IndexSetter interface {
Set(int, io.ReadCloser, chan *IndexResult, chan *IndexError)
Exists(int) bool
Len() int
}