Documentation
¶
Index ¶
- Variables
- func RandomMirror(url ...string) func() string
- func RoundRobinMirror(url ...string) func() string
- type CliProgressBar
- type CsvDecoder
- type CsvEncoder
- type DebScraper
- func (s *DebScraper) FetchPackage(ctx context.Context, attempts int, pkg datastore.Package) (items []datastore.KnownFile, err error)
- func (s *DebScraper) ListPackages(ctx context.Context) ([]datastore.Package, error)
- func (s *DebScraper) Scrape(ctx context.Context, concurrency int, hashItemCh chan datastore.KnownFile, ...) (err error)
- type HashItem
- type NoopProgressBar
- type Option
- func WithArch(arch string) Option
- func WithComponent(component string) Option
- func WithDistro(distro string) Option
- func WithLogger(logger *logrus.Logger) Option
- func WithMirrorUrl(mirrorUrl string) Option
- func WithOsType(osType datastore.OsType) Option
- func WithRandomMirrors(url ...string) Option
- func WithRoundRobinMirrors(url ...string) Option
- type ProgressDelegate
Constants ¶
This section is empty.
Variables ¶
View Source
var Mirrors = []string{
"http://ftp.at.debian.org/debian",
"http://ftp.de.debian.org/debian",
"http://ftp.si.debian.org/debian",
"http://ftp.hr.debian.org/debian",
"http://ftp.ch.debian.org/debian",
"http://ftp.cz.debian.org/debian",
"http://ftp.hu.debian.org/debian",
"http://ftp.it.debian.org/debian",
"http://ftp.nl.debian.org/debian",
"http://ftp.pl.debian.org/debian",
"http://ftp.ro.debian.org/debian",
"http://ftp.sk.debian.org/debian",
"http://ftp.es.debian.org/debian",
"http://ftp.pt.debian.org/debian",
"http://ftp.fr.debian.org/debian",
"http://ftp.uk.debian.org/debian",
"http://ftp.us.debian.org/debian",
}
Functions ¶
func RandomMirror ¶
func RoundRobinMirror ¶
Types ¶
type CliProgressBar ¶
type CliProgressBar struct {
// contains filtered or unexported fields
}
func (*CliProgressBar) Done ¶
func (c *CliProgressBar) Done(i int)
func (*CliProgressBar) Start ¶
func (c *CliProgressBar) Start(total int64)
type CsvDecoder ¶
func NewCsvDecoder ¶
func NewCsvDecoder(r io.Reader) (*CsvDecoder, error)
func (*CsvDecoder) Decode ¶
func (c *CsvDecoder) Decode(v *HashItem) error
type CsvEncoder ¶
func NewCsvEncoder ¶
func NewCsvEncoder(w io.Writer) *CsvEncoder
func (*CsvEncoder) Encode ¶
func (c *CsvEncoder) Encode(v HashItem) error
type DebScraper ¶
type DebScraper struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...Option) *DebScraper
func (*DebScraper) FetchPackage ¶
func (*DebScraper) ListPackages ¶
func (*DebScraper) Scrape ¶
func (s *DebScraper) Scrape(ctx context.Context, concurrency int, hashItemCh chan datastore.KnownFile, progress ProgressDelegate) (err error)
type HashItem ¶
type HashItem struct { Package string `csv:"package"` Version string `csv:"version"` Architecture string `csv:"architecture"` Filename string `csv:"filename"` Size int64 `csv:"size"` Mode os.FileMode `csv:"mode"` Owner string `csv:"owner"` Group string `csv:"group"` MD5 string `csv:"md5"` SHA1 string `csv:"sha1"` SHA256 string `csv:"sha256"` }
type NoopProgressBar ¶
type NoopProgressBar struct{}
func (*NoopProgressBar) Done ¶
func (d *NoopProgressBar) Done(i int)
func (*NoopProgressBar) Start ¶
func (d *NoopProgressBar) Start(total int64)
type Option ¶
type Option func(*DebScraper)
func WithComponent ¶
func WithDistro ¶
func WithLogger ¶
func WithMirrorUrl ¶
func WithOsType ¶
func WithRandomMirrors ¶
func WithRoundRobinMirrors ¶
type ProgressDelegate ¶
Click to show internal directories.
Click to hide internal directories.