provider

package
v0.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAuthenticationError

func IsAuthenticationError(err error) bool

IsAuthenticationError check if the error type is an authentication error

func IsInvalidTokenError

func IsInvalidTokenError(err error) bool

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL