github.com/quay/claircore@v1.5.28/aws/normalizeseverity.go (about)

     1  package aws
     2  
     3  import "github.com/quay/claircore"
     4  
     5  const (
     6  	Low       = "low"
     7  	Medium    = "medium"
     8  	Important = "important"
     9  	Critical  = "critical"
    10  )
    11  
    12  // NormalizeSeverity takes a aws.Severity and normalizes it to
    13  // a claircore.Severity.
    14  func NormalizeSeverity(severity string) claircore.Severity {
    15  	switch severity {
    16  	case Low:
    17  		return claircore.Low
    18  	case Medium:
    19  		return claircore.Medium
    20  	case Important:
    21  		return claircore.High
    22  	case Critical:
    23  		return claircore.Critical
    24  	default:
    25  		return claircore.Unknown
    26  	}
    27  }