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

Method PrintObjects

utils/printer.go:130–147  ·  view source on GitHub ↗

PrintObjects prints all the specified objects to stdout.

(objs []*vt.Object)

Source from the content-addressed store, hash-verified

128
129// PrintObjects prints all the specified objects to stdout.
130func (p *Printer) PrintObjects(objs []*vt.Object) error {
131 list := make([]map[string]interface{}, 0)
132 for _, obj := range objs {
133 m := ObjectToMap(obj)
134 if viper.IsSet("include") || viper.IsSet("exclude") {
135 m = FilterMap(m,
136 viper.GetStringSlice("include"),
137 viper.GetStringSlice("exclude"))
138 }
139 if len(m) > 0 {
140 list = append(list, m)
141 }
142 }
143 if len(list) > 0 {
144 return p.Print(list)
145 }
146 return nil
147}
148
149// PrintObject prints the specified object to stdout.
150func (p *Printer) PrintObject(obj *vt.Object) error {

Callers 3

PrintObjectMethod · 0.95
PrintIteratorMethod · 0.95

Calls 3

PrintMethod · 0.95
ObjectToMapFunction · 0.85
FilterMapFunction · 0.85

Tested by

no test coverage detected