Documentation
¶
Index ¶
- func AddCatalog(name string, url string, types []string)
- func LoadSources() map[string]*Source
- func RemoveCatalog(name string)
- func UpdateAllCatalogs()
- func UpdateCatalog(name string, source *Source) error
- type Action
- type ActionAccess
- type ActionAccessEnv
- type ActionAccessExecutable
- type ActionAccessNetwork
- type ActionArtifactType
- type ActionInput
- type ActionMetadata
- type ActionOutput
- type ActionScope
- type ActionType
- type Config
- type ContainerAction
- type ContainerImage
- type ContainerMount
- type ExecutableDiscovery
- type ImageCache
- type ImageCerts
- type ImageSource
- type ProvidedBinary
- type Security
- type Source
- type Workflow
- type WorkflowAction
- type WorkflowExpressionType
- type WorkflowRule
- type WorkflowStage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCatalog ¶
func LoadSources ¶
func RemoveCatalog ¶
func RemoveCatalog(name string)
func UpdateAllCatalogs ¶
func UpdateAllCatalogs()
func UpdateCatalog ¶
Types ¶
type Action ¶
type Action struct {
Repository string `yaml:"repository,omitempty" json:"repository,omitempty"`
URI string `yaml:"uri" json:"uri"` // URI is a unique absolute identifier for the action
Type ActionType `required:"true" yaml:"type" json:"type"`
Container ContainerAction `yaml:"container,omitempty" json:"container,omitempty"` // Container contains the configuration for containerized actions
Version string `yaml:"version,omitempty" json:"version,omitempty"`
Metadata ActionMetadata `yaml:"metadata" json:"metadata"`
}
type ActionAccess ¶
type ActionAccess struct {
Environment []ActionAccessEnv `json:"env,omitempty"` // Environment variables that the action may access during execution
Executables []ActionAccessExecutable `json:"executables,omitempty"` // Executables that the action may invoke during execution
Network []ActionAccessNetwork `json:"network,omitempty"` // Network access that the action may use during execution
}
type ActionAccessEnv ¶ added in v0.5.0
type ActionAccessEnv struct {
Name string `json:"name"`
Description string `json:"description"`
Pattern bool `json:"pattern,omitempty"`
Required bool `json:"required,omitempty"`
Secret bool `json:"secret,omitempty"` // Secret indicates that the environment variable holds a secret and should be redacted
}
type ActionAccessExecutable ¶ added in v0.5.0
type ActionAccessNetwork ¶ added in v0.6.0
type ActionAccessNetwork struct {
Host string `json:"host"`
}
type ActionArtifactType ¶ added in v0.6.0
type ActionArtifactType struct {
Type string `json:"type"` // Type, e.g. "report", "binary"
Format string `json:"format,omitempty"` // Format, e.g. "sarif"
FormatVersion string `json:"format_version,omitempty"`
}
func (ActionArtifactType) Key ¶ added in v0.6.0
func (a ActionArtifactType) Key() string
type ActionInput ¶ added in v0.6.0
type ActionInput struct {
Artifacts []ActionArtifactType `json:"artifacts,omitempty"`
}
type ActionMetadata ¶ added in v0.5.0
type ActionMetadata struct {
Name string `json:"name"`
Description string `json:"description"`
Documentation string `json:"documentation,omitempty"`
Category string `json:"category"`
Scope ActionScope `json:"scope"`
Links map[string]string `json:"links,omitempty"`
Rules []WorkflowRule `json:"rules,omitempty"` // Rules define conditions that must be met for the action to be executed
RunIfChanged []string `json:"runIfChanged,omitempty"` // RunIfChanged defines files that must be changed for the action to be executed
Access ActionAccess `json:"access,omitempty"` // Access defines resources that the action may access
Input ActionInput `json:"input,omitempty"` // Input defines the inputs that the action may consume
Output ActionOutput `json:"output,omitempty"` // Output defines the outputs that the action may produce
}
type ActionOutput ¶ added in v0.6.0
type ActionOutput struct {
Artifacts []ActionArtifactType `json:"artifacts,omitempty"`
}
func (ActionOutput) ContainsArtifactWithTypeAndFormat ¶ added in v0.6.0
func (a ActionOutput) ContainsArtifactWithTypeAndFormat(artifactType string, artifactFormat string) bool
type ActionScope ¶
type ActionScope string
const ( ActionScopeProject ActionScope = "project" ActionScopeModule ActionScope = "module" )
type ActionType ¶
type ActionType string
const ( ActionTypeBuiltIn ActionType = "builtin" ActionTypeContainer ActionType = "container" ActionTypeGitHubAction ActionType = "githubaction" )
type Config ¶
type Config struct {
// Actions
Actions []Action `yaml:"actions,omitempty" json:"actions,omitempty"`
// Workflows
Workflows []Workflow `yaml:"workflows,omitempty" json:"workflows,omitempty"`
// ExecutableDiscovery
ExecutableDiscovery *ExecutableDiscovery `yaml:"executable-discovery,omitempty" json:"-"`
// Executables
Executables []executable.TypedCandidate `yaml:"executables,omitempty" json:"executables,omitempty"`
}
Config is a registry configuration with placeholders
func LoadCatalogs ¶
func LoadFromDirectory ¶
func ProcessCatalog ¶
func (*Config) FindAction ¶
FindAction finds an action by id
func (*Config) FindWorkflow ¶
FindWorkflow finds a workflow by name
type ContainerAction ¶
type ContainerAction struct {
Image string `json:"image"` // Image is the full image reference including the registry
Command string `json:"command"` // Command is the command that should be executed in the container image to start the action.
Certs []ImageCerts `json:"certs,omitempty"`
}
type ContainerImage ¶
type ContainerImage struct {
Repository string `yaml:"repository,omitempty"`
Image string `yaml:"image"`
Digest string `yaml:"digest,omitempty"`
Provides []ProvidedBinary `yaml:"provides"`
Cache []ImageCache `yaml:"cache,omitempty"`
Security Security `yaml:"security,omitempty"`
User string `yaml:"user,omitempty"`
Entrypoint *string `yaml:"entrypoint,omitempty"`
Certs []ImageCerts `yaml:"certs,omitempty"`
Mounts []ContainerMount `yaml:"mounts,omitempty"` // Mounts
Source ImageSource `yaml:"source,omitempty"` // Source
}
type ContainerMount ¶
type ExecutableDiscovery ¶ added in v0.6.0
type ExecutableDiscovery struct {
ContainerDiscovery executable.DiscoverContainerOptions `yaml:"container,omitempty"`
}
type ImageCache ¶
type ImageCerts ¶
type ImageSource ¶
type ImageSource struct {
RegistryURL string `yaml:"registry_url"`
}
type ProvidedBinary ¶
type Workflow ¶
type Workflow struct {
Repository string `yaml:"repository,omitempty"`
Name string `required:"true" yaml:"name,omitempty"`
Description string `yaml:"description,omitempty"`
Version string `yaml:"version,omitempty"`
Rules []WorkflowRule `yaml:"rules,omitempty"`
Stages []WorkflowStage `yaml:"stages,omitempty"`
}
func (*Workflow) ActionCount ¶
ActionCount returns the total count of actions across all stages
type WorkflowAction ¶
type WorkflowAction struct {
ID string `required:"true" yaml:"id"`
Rules []WorkflowRule `yaml:"rules,omitempty"`
Config interface{} `yaml:"config,omitempty"`
Module *analyzerapi.ProjectModule `yaml:"-"`
Stage string `yaml:"-"`
}
type WorkflowExpressionType ¶
type WorkflowExpressionType string
const (
WorkflowExpressionCEL WorkflowExpressionType = "cel"
)
type WorkflowRule ¶
type WorkflowRule struct {
Type WorkflowExpressionType `default:"cel" yaml:"type,omitempty"`
Expression string `yaml:"expression,omitempty"`
}
type WorkflowStage ¶
type WorkflowStage struct {
Name string `required:"true" yaml:"name,omitempty"`
Rules []WorkflowRule `yaml:"rules,omitempty"`
Actions []WorkflowAction `yaml:"actions,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.