Add comments to Downloader and UpdatingDownloader interfaces
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
d914391c40
commit
09d9053104
|
@ -67,8 +67,16 @@ type Manifest struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Downloader interface {
|
type Downloader interface {
|
||||||
|
// Name returns the name of the downloader
|
||||||
Name() string
|
Name() string
|
||||||
|
// MatchURL checks if the given URL matches
|
||||||
|
// the downloader.
|
||||||
MatchURL(string) bool
|
MatchURL(string) bool
|
||||||
|
// Download downloads the object at the URL
|
||||||
|
// provided in the options, to the destination
|
||||||
|
// given in the options. It returns a type,
|
||||||
|
// a name for the downloaded object (this may be empty),
|
||||||
|
// and an error.
|
||||||
Download(Options) (Type, string, error)
|
Download(Options) (Type, string, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,6 +85,11 @@ type Downloader interface {
|
||||||
// allow for incremental updates without changing the URL.
|
// allow for incremental updates without changing the URL.
|
||||||
type UpdatingDownloader interface {
|
type UpdatingDownloader interface {
|
||||||
Downloader
|
Downloader
|
||||||
|
// Update checks for and performs any
|
||||||
|
// available updates for the object
|
||||||
|
// described in the options. It returns
|
||||||
|
// true if an update was performed, or
|
||||||
|
// false if no update was required.
|
||||||
Update(Options) (bool, error)
|
Update(Options) (bool, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue