move source metadata upstream and fix tests

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman
2020-11-17 12:37:12 -05:00
parent aa0d444fd4
commit 6f7a4fd3e4
36 changed files with 305 additions and 294 deletions
+7 -17
View File
@@ -2,21 +2,15 @@ package source
import "strings"
type Scope string
const (
UnknownScope Scope = iota
SquashedScope
AllLayersScope
UnknownScope Scope = "UnknownScope"
SquashedScope Scope = "Squashed"
AllLayersScope Scope = "AllLayers"
)
type Scope int
var optionStr = []string{
"UnknownScope",
"Squashed",
"AllLayers",
}
var Options = []Scope{
var AllScopes = []Scope{
SquashedScope,
AllLayersScope,
}
@@ -32,9 +26,5 @@ func ParseScope(userStr string) Scope {
}
func (o Scope) String() string {
if int(o) >= len(optionStr) || o < 0 {
return optionStr[0]
}
return optionStr[o]
return string(o)
}