mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-23 07:29:00 -08:00
26 lines
803 B
Go
26 lines
803 B
Go
package resolvers
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/aquasecurity/trivy/pkg/log"
|
|
)
|
|
|
|
type Options struct {
|
|
Source, OriginalSource, Version, OriginalVersion, WorkingDir, Name, ModulePath string
|
|
Logger *log.Logger
|
|
AllowDownloads bool
|
|
SkipCache bool
|
|
RelativePath string
|
|
CacheDir string
|
|
}
|
|
|
|
func (o *Options) hasPrefix(prefixes ...string) bool {
|
|
for _, prefix := range prefixes {
|
|
if strings.HasPrefix(o.Source, prefix) {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|