provider

package
v0.21.1-0...-a3b014d Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	Root      string
	Providers []Provider
}

type Config

type Config struct {
	Identifier `yaml:",inline" mapstructure:",squash"`
	Config     interface{} `yaml:"config,omitempty" json:"config" mapstructure:"config"`
}

func (Config) Redact

func (c Config) Redact()

type File

type File struct {
	Path      string `json:"path"`
	Digest    string `json:"digest"`
	Algorithm string `json:"algorithm"`
}

func NewFile

func NewFile(path string) (*File, error)

type Files

type Files []File

func NewFiles

func NewFiles(paths ...string) (Files, error)

func NewFilesFromDir

func NewFilesFromDir(dir string) (Files, error)

func (Files) Paths

func (i Files) Paths() []string

type Identifier

type Identifier struct {
	Name string `yaml:"name" json:"name" mapstructure:"name"`
	Kind Kind   `yaml:"kind,omitempty" json:"kind" mapstructure:"kind"`
}

type Kind

type Kind string
const (
	InternalKind Kind = "internal" // reserved, not implemented (golang vulnerability data providers in-repo)
	ExternalKind Kind = "external"
	VunnelKind   Kind = "vunnel" // special case of external
)

type Provider

type Provider interface {
	ID() Identifier
	Update(context.Context) error
	State() (*State, error)
}

type Providers

type Providers []Provider

func (Providers) Filter

func (ps Providers) Filter(names ...string) Providers

type Schema

type Schema struct {
	Version string `json:"version"`
	URL     string `json:"url"`
}

type State

type State struct {
	Provider  string    `json:"provider"`
	Schema    Schema    `json:"schema"`
	URLs      []string  `json:"urls"`
	Timestamp time.Time `json:"timestamp"`
	Listing   *File     `json:"listing"`
	Store     string    `json:"store"`
	Stale     bool      `json:"stale"`
	// contains filtered or unexported fields
}

func ReadState

func ReadState(location string) (*State, error)

func (State) ResultPath

func (sd State) ResultPath(filename string) string

func (State) ResultPaths

func (sd State) ResultPaths() []string

func (State) Verify

func (sd State) Verify(workspaceRoots ...string) error

type States

type States []State

func (States) Names

func (s States) Names() []string

type Workspace

type Workspace struct {
	Root string
	Name string
}

func NewWorkspace

func NewWorkspace(root, name string) Workspace

func NewWorkspaceFromExisting

func NewWorkspaceFromExisting(workspacePath string) Workspace

func (Workspace) InputPath

func (w Workspace) InputPath() string

func (Workspace) Path

func (w Workspace) Path() string

func (Workspace) ReadState

func (w Workspace) ReadState() (*State, error)

func (Workspace) ResultsPath

func (w Workspace) ResultsPath() string

func (Workspace) StatePath

func (w Workspace) StatePath() string

Directories

Path Synopsis
nvd

Jump to

Keyboard shortcuts

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