MCPcopy Create free account
hub / github.com/VirusTotal/vt-cli / Do

Method Do

cmd/scan.go:213–234  ·  view source on GitHub ↗
(url interface{}, ds *utils.DoerState)

Source from the content-addressed store, hash-verified

211}
212
213func (s *urlScanner) Do(url interface{}, ds *utils.DoerState) string {
214 analysis, err := s.scanner.Scan(url.(string))
215 if err != nil {
216 return err.Error()
217 }
218
219 if s.showInVT {
220 return fmt.Sprintf(
221 "%s https://www.virustotal.com/gui/url-analysis/%s", url, analysis.ID())
222 }
223
224 if s.waitForCompletion {
225 analysisResult, err := waitForAnalysisResults(s.cli, analysis.ID(), ds)
226 if err != nil {
227 return err.Error()
228 }
229 s.printer.PrintObject(analysisResult)
230 return ""
231 }
232
233 return fmt.Sprintf("%s %s", url, analysis.ID())
234}
235
236var scanURLCmdHelp = `Scan one or more URLs.
237

Callers

nothing calls this directly

Calls 2

waitForAnalysisResultsFunction · 0.85
PrintObjectMethod · 0.80

Tested by

no test coverage detected