Documentation ¶
Index ¶
- func IsAuthenticationError(err error) bool
- func IsInvalidTokenError(err error) bool
- type Provider
- type SnykProviderOps
- func WithAuthConfig(authResolver func(*registry.IndexInfo) types.AuthConfig) SnykProviderOps
- func WithContext(ctx context.Context) SnykProviderOps
- func WithDependencyTree() SnykProviderOps
- func WithDockerFile(path string) SnykProviderOps
- func WithJSON() SnykProviderOps
- func WithPath(path string) SnykProviderOps
- func WithoutBaseImageVulnerabilities() SnykProviderOps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAuthenticationError ¶
IsAuthenticationError check if the error type is an authentication error
func IsInvalidTokenError ¶
IsInvalidTokenError check if the error type is an invalid token error
Types ¶
type Provider ¶
type Provider interface { Authenticate(token string) error Scan(image string) error Version() (string, error) }
Provider abstracts a scan provider
func NewSnykProvider ¶
func NewSnykProvider(ops ...SnykProviderOps) (Provider, error)
NewSnykProvider returns a Snyk implementation of scan provider
type SnykProviderOps ¶
type SnykProviderOps func(*snykProvider) error
SnykProviderOps function taking a pointer to a Snyk Provider and returning an error if needed
func WithAuthConfig ¶
func WithAuthConfig(authResolver func(*registry.IndexInfo) types.AuthConfig) SnykProviderOps
WithAuthConfig update the Snyk provider with the auth configuration from Docker CLI
func WithContext ¶
func WithContext(ctx context.Context) SnykProviderOps
WithContext update the Snyk provider with a cancelable context
func WithDependencyTree ¶
func WithDependencyTree() SnykProviderOps
WithDependencyTree shows the dependency tree before scan results
func WithDockerFile ¶
func WithDockerFile(path string) SnykProviderOps
WithDockerFile improve result by providing a Dockerfile
func WithJSON ¶
func WithJSON() SnykProviderOps
WithJSON set JSONFormat to display scan result in JSON
func WithPath ¶
func WithPath(path string) SnykProviderOps
WithPath update the Snyk provider with the path from the configuration
func WithoutBaseImageVulnerabilities ¶
func WithoutBaseImageVulnerabilities() SnykProviderOps
WithoutBaseImageVulnerabilities don't display the vulnerabilities from the base image