mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 18:15:42 +01:00
Add remote validator support to downloader.
This commit is contained in:
parent
1d0499ddea
commit
bcc31c0cd6
3 changed files with 65 additions and 13 deletions
|
|
@ -19,11 +19,15 @@ import (
|
|||
)
|
||||
|
||||
type options struct {
|
||||
Directory *string `short:"d" long:"directory" description:"Directory to store the downloaded files in"`
|
||||
Directory *string `short:"d" long:"directory" description:"DIRectory to store the downloaded files in" value-name:"DIR"`
|
||||
Insecure bool `long:"insecure" description:"Do not check TLS certificates from provider"`
|
||||
Version bool `long:"version" description:"Display version of the binary"`
|
||||
Verbose bool `long:"verbose" short:"v" description:"Verbose output"`
|
||||
Rate *float64 `long:"rate" short:"r" description:"The average upper limit of https operations per second"`
|
||||
|
||||
RemoteValidator string `long:"validator" description:"URL to validate documents remotely" value-name:"URL"`
|
||||
RemoteValidatorCache string `long:"validatorcache" description:"FILE to cache remote validations" value-name:"FILE"`
|
||||
RemoteValidatorPresets []string `long:"validatorpreset" description:"One or more presets to validate remotely"`
|
||||
}
|
||||
|
||||
func errCheck(err error) {
|
||||
|
|
@ -35,6 +39,15 @@ func errCheck(err error) {
|
|||
}
|
||||
}
|
||||
|
||||
func run(opts *options, domains []string) error {
|
||||
d, err := newDownloader(opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer d.close()
|
||||
return d.run(domains)
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
opts := new(options)
|
||||
|
|
@ -54,7 +67,5 @@ func main() {
|
|||
return
|
||||
}
|
||||
|
||||
d := newDownloader(opts)
|
||||
|
||||
errCheck(d.run(domains))
|
||||
errCheck(run(opts, domains))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue