mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 17:03:17 +01:00
31 lines
546 B
Go
31 lines
546 B
Go
package source
|
|
|
|
import "strings"
|
|
|
|
type Scope string
|
|
|
|
const (
|
|
UnknownScope Scope = "UnknownScope"
|
|
SquashedScope Scope = "Squashed"
|
|
AllLayersScope Scope = "AllLayers"
|
|
)
|
|
|
|
var AllScopes = []Scope{
|
|
SquashedScope,
|
|
AllLayersScope,
|
|
}
|
|
|
|
func ParseScope(userStr string) Scope {
|
|
switch strings.ToLower(userStr) {
|
|
case strings.ToLower(SquashedScope.String()):
|
|
return SquashedScope
|
|
case "all-layers", strings.ToLower(AllLayersScope.String()):
|
|
return AllLayersScope
|
|
}
|
|
return UnknownScope
|
|
}
|
|
|
|
func (o Scope) String() string {
|
|
return string(o)
|
|
}
|