Display the information of yum updateinfo on TUI (for RHEL, Amazon, Oracle)

This commit is contained in:
kota kanbe
2017-07-26 01:03:27 +09:00
parent 1aae425945
commit ed162d7d6e
4 changed files with 35 additions and 14 deletions

View File

@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package models
import (
"bytes"
"fmt"
"sort"
"strings"
@@ -196,6 +197,20 @@ type DistroAdvisory struct {
Description string
}
// Format the distro advisory information
func (p DistroAdvisory) Format() string {
if p.AdvisoryID == "" {
return ""
}
var delim bytes.Buffer
for i := 0; i < len(p.AdvisoryID); i++ {
delim.WriteString("-")
}
buf := []string{p.AdvisoryID, delim.String(), p.Description}
return strings.Join(buf, "\n")
}
// Confidence is a ranking how confident the CVE-ID was deteted correctly
// Score: 0 - 100
type Confidence struct {