interfaces

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration interface {
	Load() error
	LoadWithDefaults(defaults map[string]any) error
	Validate() error
	GetConfigSummary() string

	// Core configuration methods
	GetString(key string) string
	GetInt(key string) int
	GetBool(key string) bool
	GetDuration(key string) time.Duration
	GetFloat(key string) float64
	Get(key string) any
	Set(key string, value any)
	Has(key string) bool
	All() map[string]any

	// Pipeline-specific configuration methods
	Pipeline() PipelineConfig
	Registry() RegistryConfig
	Security() SecurityConfig
	Logging() LoggingConfig
	Environment() string
}

Configuration defines the application configuration interface.

type ConfigurationError

type ConfigurationError struct {
	Key   string
	Value any
	Cause error
}

ConfigurationError represents a configuration error.

func (ConfigurationError) Error

func (e ConfigurationError) Error() string

type Container

type Container interface {
	// Core container methods
	Register(name string, factory func() (any, error))
	Get(name string) (any, error)
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
	Validate() error

	// Pipeline-specific providers
	RegistryProvider
	SecurityProvider
	LoggingProvider
}

Container defines the interface for the dependency injection container.

type ContainerError

type ContainerError struct {
	Component string
	Operation string
	Cause     error
}

ContainerError represents an error that occurred in the container.

func (ContainerError) Error

func (e ContainerError) Error() string

type GitConfig

type GitConfig struct {
	Repo      string `json:"repo"       yaml:"repo"`
	Ref       string `json:"ref"        yaml:"ref"`
	Protocol  string `json:"protocol"   yaml:"protocol"`
	UserEmail string `json:"userEmail" yaml:"userEmail"`
	UserName  string `json:"userName"  yaml:"userName"`
	SSHKey    string `json:"sshKey"    yaml:"sshKey"`
}

GitConfig defines Git configuration.

type HookFunc

type HookFunc func(ctx context.Context) error

HookFunc defines a function type for pipeline hooks.

type HookManager

type HookManager interface {
	RegisterHook(stepName string, hookType HookType, hook HookFunc) error
	GetHooks(stepName string, hookType HookType) []HookFunc
	ExecuteHooks(ctx context.Context, stepName string, hookType HookType) error
	RemoveHook(stepName string, hookType HookType, hook HookFunc) error
}

HookManager defines the interface for managing pipeline hooks.

type HookType

type HookType string

HookType defines the type of hook.

const (
	HookTypeBefore  HookType = "before"
	HookTypeAfter   HookType = "after"
	HookTypeError   HookType = "error"
	HookTypeSuccess HookType = "success"
)

type Linter

type Linter interface {
	Lint(ctx context.Context, src *dagger.Directory) error
	GetReport(ctx context.Context) (string, error)
}

Linter defines the interface for code linting.

type Logger

type Logger interface {
	Debug(msg string, fields ...any)
	Info(msg string, fields ...any)
	Warn(msg string, fields ...any)
	Error(msg string, fields ...any)
	Fatal(msg string, fields ...any)
	WithField(key string, value any) Logger
	WithFields(fields map[string]any) Logger
}

Logger defines the interface for logging.

type LoggingConfig

type LoggingConfig struct {
	Level            string        `json:"level"             yaml:"level"`
	Format           string        `json:"format"            yaml:"format"`
	SamplingEnable   bool          `json:"samplingEnable"   yaml:"samplingEnable"`
	SamplingRate     float64       `json:"samplingRate"     yaml:"samplingRate"`
	SamplingInterval time.Duration `json:"samplingInterval" yaml:"samplingInterval"`
}

LoggingConfig defines logging configuration.

type LoggingProvider

type LoggingProvider interface {
	GetLogger() (Logger, error)
}

LoggingProvider defines the interface for logging access.

type PipelineConfig

type PipelineConfig struct {
	Name        string  `json:"name"         yaml:"name"`
	Environment string  `json:"environment"  yaml:"environment"`
	Coverage    float64 `json:"coverage"     yaml:"coverage"`
	SkipPush    bool    `json:"skipPush"    yaml:"skipPush"`
	OnlyBuild   bool    `json:"onlyBuild"   yaml:"onlyBuild"`
	OnlyTest    bool    `json:"onlyTest"    yaml:"onlyTest"`
	Verbose     bool    `json:"verbose"      yaml:"verbose"`
	GoVersion   string  `json:"goVersion"   yaml:"goVersion"`
	JavaVersion string  `json:"javaVersion" yaml:"javaVersion"`
}

PipelineConfig defines pipeline configuration.

type PipelineError

type PipelineError struct {
	Pipeline string
	Step     string
	Message  string
	Cause    error
}

PipelineError represents a pipeline-specific error.

func (PipelineError) Error

func (e PipelineError) Error() string

type PipelineExecutor

type PipelineExecutor interface {
	ExecutePipeline(ctx context.Context, pipelineName string, steps []string) error
	ExecuteStep(ctx context.Context, pipelineName string, stepName string) error
	GetPipelineStatus(pipelineName string) (PipelineStatus, error)
	GetStepStatus(pipelineName string, stepName string) (StepResult, error)
	CancelPipeline(pipelineName string) error
	GetPipelineLogs(pipelineName string) ([]string, error)
}

PipelineExecutor defines the interface for executing pipelines with dynamic steps.

type PipelineStatus

type PipelineStatus struct {
	PipelineName string                `json:"pipelineName"`
	Status       string                `json:"status"` // running, completed, failed, cancelled
	StartTime    time.Time             `json:"startTime"`
	EndTime      *time.Time            `json:"endTime,omitempty"`
	Duration     time.Duration         `json:"duration"`
	Steps        map[string]StepResult `json:"steps"`
	Metadata     map[string]any        `json:"metadata,omitempty"`
}

PipelineStatus represents the current status of a pipeline.

type RegistryConfig

type RegistryConfig struct {
	BaseURL string `json:"baseUrl" yaml:"baseUrl"`
	User    string `json:"user"     yaml:"user"`
	Pass    string `json:"pass"     yaml:"pass"`
	Image   string `json:"image"    yaml:"image"`
	Tag     string `json:"tag"      yaml:"tag"`
}

RegistryConfig defines container registry configuration.

type RegistryProvider

type RegistryProvider interface {
	GetRegistryConfig() (RegistryConfig, error)
	GetRegistryAuth() (string, string, error)
}

RegistryProvider defines the interface for registry access.

type ReleaseConfig

type ReleaseConfig struct {
	Enabled        bool     `json:"enabled"         yaml:"enabled"`
	UseGoreleaser  bool     `json:"useGoreleaser"  yaml:"useGoreleaser"`
	BuildTargets   []string `json:"buildTargets"   yaml:"buildTargets"`
	ArchiveFormats []string `json:"archiveFormats" yaml:"archiveFormats"`
	Checksum       bool     `json:"checksum"        yaml:"checksum"`
	Sign           bool     `json:"sign"            yaml:"sign"`
}

ReleaseConfig defines release configuration.

type SecurityConfig

type SecurityConfig struct {
	EnableVulnCheck bool     `json:"enableVulnCheck" yaml:"enableVulnCheck"`
	EnableLinting   bool     `json:"enableLinting"    yaml:"enableLinting"`
	LintTimeout     string   `json:"lintTimeout"      yaml:"lintTimeout"`
	ExcludePatterns []string `json:"excludePatterns"  yaml:"excludePatterns"`
}

SecurityConfig defines security configuration.

type SecurityProvider

type SecurityProvider interface {
	GetVulnChecker() (VulnChecker, error)
	GetLinter() (Linter, error)
}

SecurityProvider defines the interface for security tools access.

type StepArtifact

type StepArtifact struct {
	Name        string `json:"name"`
	Path        string `json:"path"`
	Type        string `json:"type"`
	Size        int64  `json:"size"`
	Checksum    string `json:"checksum,omitempty"`
	Description string `json:"description,omitempty"`
}

StepArtifact represents a file or artifact produced by a legacy pipeline step (internal/app's dynamic-step execution model). Renamed from "Artifact" (WU10, tasks.md 10.2) to avoid a name collision with the new Layer 1 Artifactor capability vocabulary (pkg/shipwright, internal/capabilities, internal/workflow/providers) — this type is unrelated to that capability contract, it is the legacy step-execution model's artifact record.

type StepConfig

type StepConfig struct {
	Name        string            `json:"name"        yaml:"name"`
	Description string            `json:"description" yaml:"description"`
	Required    bool              `json:"required"    yaml:"required"`
	Parallel    bool              `json:"parallel"    yaml:"parallel"`
	Timeout     time.Duration     `json:"timeout"     yaml:"timeout"`
	Retries     int               `json:"retries"     yaml:"retries"`
	DependsOn   []string          `json:"dependsOn"  yaml:"dependsOn"`
	Conditions  map[string]string `json:"conditions"  yaml:"conditions"`
	Metadata    map[string]any    `json:"metadata"    yaml:"metadata"`
}

StepConfig defines configuration for a pipeline step.

type StepExecutor

type StepExecutor interface {
	Execute(ctx context.Context, stepName string, config StepConfig) error
	GetStepResult(stepName string) (StepResult, error)
	GetStepLogs(stepName string) ([]string, error)
}

StepExecutor defines the interface for executing pipeline steps.

type StepHandler

type StepHandler interface {
	CanHandle(stepName string) bool
	Execute(ctx context.Context, stepName string, config StepConfig) error
	GetStepInfo(stepName string) StepConfig
	Validate(stepName string, config StepConfig) error
}

StepHandler defines the interface for handling pipeline steps.

type StepRegistry

type StepRegistry interface {
	RegisterStep(stepName string, handler StepHandler) error
	GetStepHandler(stepName string) (StepHandler, error)
	ListSteps() []string
	GetStepConfig(stepName string) (StepConfig, error)
	ValidateStep(stepName string) error
	ExecuteStep(ctx context.Context, stepName string) error
	GetExecutionOrder() ([]string, error)
}

StepRegistry defines the interface for registering and managing steps.

type StepResult

type StepResult struct {
	StepName  string         `json:"stepName"`
	Success   bool           `json:"success"`
	Duration  time.Duration  `json:"duration"`
	Error     error          `json:"error,omitempty"`
	Output    string         `json:"output,omitempty"`
	Metadata  map[string]any `json:"metadata,omitempty"`
	Artifacts []StepArtifact `json:"artifacts,omitempty"`
}

StepResult contains the result of a step execution.

type VulnChecker

type VulnChecker interface {
	Check(ctx context.Context, src *dagger.Directory) error
	GetReport(ctx context.Context) (string, error)
}

VulnChecker defines the interface for vulnerability checking.

Jump to

Keyboard shortcuts

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