Thomas Hipp 64c04995b3
initial commit
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
2018-02-06 15:24:32 +01:00

25 lines
491 B
Go

package sources
// A Downloader represents a source downloader.
type Downloader interface {
Run(string, string, string, string, string) error
}
// Get returns a Downloader.
func Get(name string) Downloader {
switch name {
case "ubuntu-http":
return NewUbuntuHTTP()
case "debootstrap":
return NewDebootstrap()
case "archlinux-http":
return NewArchLinuxHTTP()
case "centos-http":
return NewCentOSHTTP()
case "alpinelinux-http":
return NewAlpineLinuxHTTP()
}
return nil
}