distribution

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APTManager

type APTManager struct {
	// contains filtered or unexported fields
}

APTManager implements PackageManager for APT (Debian/Ubuntu)

func (*APTManager) CreatePackage

func (am *APTManager) CreatePackage(ctx context.Context, artifact *BuildArtifact, metadata PackageMetadata) (*Package, error)

func (*APTManager) DeletePackage

func (am *APTManager) DeletePackage(ctx context.Context, packageName, version string) error

func (*APTManager) GetPackageInfo

func (am *APTManager) GetPackageInfo(ctx context.Context, packageName string) (*PackageInfo, error)

func (*APTManager) GetSupportedPlatforms

func (am *APTManager) GetSupportedPlatforms() []Platform

func (*APTManager) GetType

func (am *APTManager) GetType() PackageManagerType

func (*APTManager) IsAvailable

func (am *APTManager) IsAvailable() bool

func (*APTManager) ListPackages

func (am *APTManager) ListPackages(ctx context.Context, filters PackageFilters) ([]PackageInfo, error)

func (*APTManager) PublishToRepository

func (am *APTManager) PublishToRepository(ctx context.Context, pkg *Package) error

func (*APTManager) UpdatePackage

func (am *APTManager) UpdatePackage(ctx context.Context, packageName string, artifact *BuildArtifact) error

func (*APTManager) Validate

func (am *APTManager) Validate() error

type AnalyticsConfig

type AnalyticsConfig struct {
	Enabled          bool   `json:"enabled"`
	Endpoint         string `json:"endpoint"`
	CollectUsage     bool   `json:"collect_usage"`
	CollectErrors    bool   `json:"collect_errors"`
	CollectTelemetry bool   `json:"collect_telemetry"`
	RetentionDays    int    `json:"retention_days"`
	AnonymizeIPs     bool   `json:"anonymize_ips"`
}

AnalyticsConfig defines installation analytics configuration

type AnalyticsEvent

type AnalyticsEvent struct {
	ID        string                 `json:"id"`
	Type      EventType              `json:"type"`
	Timestamp time.Time              `json:"timestamp"`
	Data      map[string]interface{} `json:"data"`
}

AnalyticsEvent represents any analytics event

type AnalyticsFilters

type AnalyticsFilters struct {
	Platform  []Platform `json:"platform,omitempty"`
	Version   []string   `json:"version,omitempty"`
	Source    []string   `json:"source,omitempty"`
	Country   []string   `json:"country,omitempty"`
	StartDate *time.Time `json:"start_date,omitempty"`
	EndDate   *time.Time `json:"end_date,omitempty"`
	Limit     int        `json:"limit,omitempty"`
	Offset    int        `json:"offset,omitempty"`
}

type AnalyticsReport

type AnalyticsReport struct {
	ID                string             `json:"id"`
	Type              ReportType         `json:"type"`
	Period            TimePeriod         `json:"period"`
	GeneratedAt       time.Time          `json:"generated_at"`
	InstallationStats *InstallationStats `json:"installation_stats,omitempty"`
	UsageStats        *UsageStats        `json:"usage_stats,omitempty"`
	ErrorStats        *ErrorStats        `json:"error_stats,omitempty"`
	Summary           string             `json:"summary"`
	Recommendations   []string           `json:"recommendations"`
}

type AnalyticsStorage

type AnalyticsStorage interface {
	StoreEvent(ctx context.Context, event AnalyticsEvent) error
	GetEvents(ctx context.Context, filters AnalyticsFilters) ([]AnalyticsEvent, error)
	GetStats(ctx context.Context, filters AnalyticsFilters) (*StatsResult, error)
	Cleanup(ctx context.Context, olderThan time.Time) error
}

AnalyticsStorage interface for storing analytics data

func NewAnalyticsStorage

func NewAnalyticsStorage(config AnalyticsConfig, logger Logger) AnalyticsStorage

type Architecture

type Architecture string

Architecture represents target architectures

const (
	ArchAMD64 Architecture = "amd64"
	ArchARM64 Architecture = "arm64"
	ArchARM   Architecture = "arm"
	Arch386   Architecture = "386"
)

type ArtifactMetadata

type ArtifactMetadata struct {
	Name         string                 `json:"name"`
	Version      string                 `json:"version"`
	Platform     Platform               `json:"platform"`
	Architecture Architecture           `json:"architecture"`
	Size         int64                  `json:"size"`
	Checksum     map[string]string      `json:"checksum"`
	ContentType  string                 `json:"content_type"`
	CreatedAt    time.Time              `json:"created_at"`
	ModifiedAt   time.Time              `json:"modified_at"`
	Tags         map[string]string      `json:"tags"`
	Custom       map[string]interface{} `json:"custom"`
}

type ArtifactStorage

type ArtifactStorage interface {
	// Storage operations
	Store(ctx context.Context, artifact *BuildArtifact) (*StorageLocation, error)
	Retrieve(ctx context.Context, location *StorageLocation, writer io.Writer) error
	Delete(ctx context.Context, location *StorageLocation) error
	Exists(ctx context.Context, location *StorageLocation) (bool, error)

	// Metadata operations
	GetMetadata(ctx context.Context, location *StorageLocation) (*ArtifactMetadata, error)
	UpdateMetadata(ctx context.Context, location *StorageLocation, metadata *ArtifactMetadata) error

	// Query operations
	List(ctx context.Context, filters StorageFilters) ([]StorageLocation, error)
	Search(ctx context.Context, query string) ([]StorageLocation, error)

	// Cleanup operations
	Cleanup(ctx context.Context, retentionPolicy RetentionPolicy) error
	GetStorageUsage(ctx context.Context) (*StorageUsage, error)
}

ArtifactStorage interface for storing build artifacts

func NewArtifactStorage

func NewArtifactStorage(config ArtifactStorageConfig, logger Logger) ArtifactStorage

NewArtifactStorage creates a new artifact storage instance

type ArtifactStorageConfig

type ArtifactStorageConfig struct {
	Type        StorageType   `json:"type"`
	S3Config    S3Config      `json:"s3_config,omitempty"`
	GCSConfig   GCSConfig     `json:"gcs_config,omitempty"`
	LocalConfig LocalConfig   `json:"local_config,omitempty"`
	Retention   time.Duration `json:"retention"`
}

ArtifactStorageConfig defines where build artifacts are stored

type ArtifactType

type ArtifactType string
const (
	ArtifactTypeBinary  ArtifactType = "binary"
	ArtifactTypeArchive ArtifactType = "archive"
	ArtifactTypePackage ArtifactType = "package"
	ArtifactTypeImage   ArtifactType = "image"
)

type Asset

type Asset struct {
	ID           string            `json:"id"`
	Name         string            `json:"name"`
	ContentType  string            `json:"content_type"`
	Size         int64             `json:"size"`
	DownloadURL  string            `json:"download_url"`
	Checksum     map[string]string `json:"checksum"`
	Platform     Platform          `json:"platform"`
	Architecture Architecture      `json:"architecture"`
	CreatedAt    time.Time         `json:"created_at"`
}

type BuildArtifact

type BuildArtifact struct {
	ID           string                 `json:"id"`
	Name         string                 `json:"name"`
	Platform     Platform               `json:"platform"`
	Architecture Architecture           `json:"architecture"`
	Type         ArtifactType           `json:"type"`
	Size         int64                  `json:"size"`
	Checksum     map[string]string      `json:"checksum"`
	Signature    *Signature             `json:"signature,omitempty"`
	Location     *StorageLocation       `json:"location"`
	Metadata     map[string]interface{} `json:"metadata"`
	CreatedAt    time.Time              `json:"created_at"`
}

type BuildError

type BuildError struct {
	Target  BuildTarget            `json:"target"`
	Error   string                 `json:"error"`
	Stage   string                 `json:"stage"`
	Details map[string]interface{} `json:"details,omitempty"`
}

type BuildExecution

type BuildExecution struct {
	ID        string             `json:"id"`
	Version   string             `json:"version"`
	Targets   []BuildTarget      `json:"targets"`
	Status    BuildState         `json:"status"`
	Progress  int                `json:"progress"`
	StartTime time.Time          `json:"start_time"`
	EndTime   *time.Time         `json:"end_time,omitempty"`
	Artifacts []BuildArtifact    `json:"artifacts"`
	Logs      []BuildLogEntry    `json:"logs"`
	Errors    []BuildError       `json:"errors"`
	Context   context.Context    `json:"-"`
	Cancel    context.CancelFunc `json:"-"`
	Mutex     sync.RWMutex       `json:"-"`
}

BuildExecution tracks a build in progress

type BuildFilters

type BuildFilters struct {
	Status    []BuildState `json:"status,omitempty"`
	Platform  []Platform   `json:"platform,omitempty"`
	Version   string       `json:"version,omitempty"`
	StartDate *time.Time   `json:"start_date,omitempty"`
	EndDate   *time.Time   `json:"end_date,omitempty"`
	Limit     int          `json:"limit,omitempty"`
	Offset    int          `json:"offset,omitempty"`
}

type BuildInfo

type BuildInfo struct {
	BuildID   string        `json:"build_id"`
	Version   string        `json:"version"`
	Status    BuildState    `json:"status"`
	Targets   []BuildTarget `json:"targets"`
	StartTime time.Time     `json:"start_time"`
	Duration  time.Duration `json:"duration"`
}

type BuildLogEntry

type BuildLogEntry struct {
	Timestamp time.Time              `json:"timestamp"`
	Level     string                 `json:"level"`
	Target    string                 `json:"target,omitempty"`
	Message   string                 `json:"message"`
	Details   map[string]interface{} `json:"details,omitempty"`
}

BuildLogEntry represents a build log entry

type BuildPipeline

type BuildPipeline interface {
	Build(ctx context.Context, version string, targets []BuildTarget) (*BuildResult, error)
	GetBuildStatus(buildID string) (*BuildStatus, error)
	ListBuilds(ctx context.Context, filters BuildFilters) ([]BuildInfo, error)
	CleanupBuilds(ctx context.Context, olderThan time.Time) error
}

BuildPipeline interface for building cross-platform binaries

func NewBuildPipeline

func NewBuildPipeline(config *Config, logger Logger) BuildPipeline

NewBuildPipeline creates a new build pipeline

type BuildPipelineImpl

type BuildPipelineImpl struct {
	// contains filtered or unexported fields
}

BuildPipelineImpl implements the BuildPipeline interface

func (*BuildPipelineImpl) Build

func (bp *BuildPipelineImpl) Build(ctx context.Context, version string, targets []BuildTarget) (*BuildResult, error)

Build starts a new build for the specified targets

func (*BuildPipelineImpl) CleanupBuilds

func (bp *BuildPipelineImpl) CleanupBuilds(ctx context.Context, olderThan time.Time) error

CleanupBuilds removes old build records

func (*BuildPipelineImpl) GetBuildStatus

func (bp *BuildPipelineImpl) GetBuildStatus(buildID string) (*BuildStatus, error)

GetBuildStatus returns the current status of a build

func (*BuildPipelineImpl) ListBuilds

func (bp *BuildPipelineImpl) ListBuilds(ctx context.Context, filters BuildFilters) ([]BuildInfo, error)

ListBuilds returns a list of builds matching the filters

type BuildResult

type BuildResult struct {
	BuildID   string          `json:"build_id"`
	Version   string          `json:"version"`
	Artifacts []BuildArtifact `json:"artifacts"`
	StartTime time.Time       `json:"start_time"`
	EndTime   time.Time       `json:"end_time"`
	Duration  time.Duration   `json:"duration"`
	Status    BuildState      `json:"status"`
	LogsURL   string          `json:"logs_url"`
	Errors    []BuildError    `json:"errors,omitempty"`
}

Build-related types

type BuildState

type BuildState string
const (
	BuildStatePending   BuildState = "pending"
	BuildStateRunning   BuildState = "running"
	BuildStateCompleted BuildState = "completed"
	BuildStateFailed    BuildState = "failed"
	BuildStateCancelled BuildState = "cancelled"
)

type BuildStatus

type BuildStatus struct {
	BuildID   string     `json:"build_id"`
	Status    BuildState `json:"status"`
	Progress  int        `json:"progress"`
	Message   string     `json:"message"`
	UpdatedAt time.Time  `json:"updated_at"`
}

type BuildTarget

type BuildTarget struct {
	Platform     Platform     `json:"platform"`
	Architecture Architecture `json:"architecture"`
	GoOS         string       `json:"goos"`
	GoArch       string       `json:"goarch"`
	CGOEnabled   bool         `json:"cgo_enabled"`
	BuildFlags   []string     `json:"build_flags"`
	LDFlags      []string     `json:"ldflags"`
	OutputName   string       `json:"output_name"`
	Compress     bool         `json:"compress"`
	Notarize     bool         `json:"notarize"` // For macOS
}

BuildTarget defines a specific platform/architecture build target

type CertificateInfo

type CertificateInfo struct {
	Subject    string    `json:"subject"`
	Issuer     string    `json:"issuer"`
	NotBefore  time.Time `json:"not_before"`
	NotAfter   time.Time `json:"not_after"`
	Serial     string    `json:"serial"`
	Thumbprint string    `json:"thumbprint"`
}

CertificateInfo contains signing certificate information

type CertificateManager

type CertificateManager struct {
	// contains filtered or unexported fields
}

CertificateManager handles certificate operations

func NewCertificateManager

func NewCertificateManager(config VerificationConfig, logger Logger) *CertificateManager

func (*CertificateManager) CreateSelfSignedCertificate

func (cm *CertificateManager) CreateSelfSignedCertificate(privateKey *rsa.PrivateKey, subject string) (*x509.Certificate, error)

func (*CertificateManager) ExportCertificatePEM

func (cm *CertificateManager) ExportCertificatePEM(cert *x509.Certificate) []byte

func (*CertificateManager) ExportPrivateKeyPEM

func (cm *CertificateManager) ExportPrivateKeyPEM(privateKey *rsa.PrivateKey) ([]byte, error)

func (*CertificateManager) ExportPublicKeyPEM

func (cm *CertificateManager) ExportPublicKeyPEM(publicKey *rsa.PublicKey) ([]byte, error)

func (*CertificateManager) GenerateKeyPair

func (cm *CertificateManager) GenerateKeyPair() (*rsa.PrivateKey, *rsa.PublicKey, error)

type ChannelConfig

type ChannelConfig struct {
	Name       string                 `json:"name"`
	Type       ChannelType            `json:"type"`
	Enabled    bool                   `json:"enabled"`
	Priority   int                    `json:"priority"`
	Platforms  []Platform             `json:"platforms"`
	Config     map[string]interface{} `json:"config"`
	UpdateFreq time.Duration          `json:"update_frequency"`
}

ChannelConfig defines a distribution channel

type ChannelInfo

type ChannelInfo struct {
	Name       string        `json:"name"`
	Type       ChannelType   `json:"type"`
	Platforms  []Platform    `json:"platforms"`
	Priority   int           `json:"priority"`
	UpdateFreq time.Duration `json:"update_frequency"`
}

type ChannelType

type ChannelType string

ChannelType represents different distribution channels

const (
	ChannelTypeGitHub     ChannelType = "github"
	ChannelTypeGitLab     ChannelType = "gitlab"
	ChannelTypeHomebrew   ChannelType = "homebrew"
	ChannelTypeChocolatey ChannelType = "chocolatey"
	ChannelTypeAPT        ChannelType = "apt"
	ChannelTypeRPM        ChannelType = "rpm"
	ChannelTypeSnap       ChannelType = "snap"
	ChannelTypeFlatpak    ChannelType = "flatpak"
	ChannelTypeDockerHub  ChannelType = "dockerhub"
	ChannelTypeAUR        ChannelType = "aur"
	ChannelTypeWinget     ChannelType = "winget"
	ChannelTypeScoop      ChannelType = "scoop"
)

type ChocolateyManager

type ChocolateyManager struct {
	// contains filtered or unexported fields
}

ChocolateyManager implements PackageManager for Chocolatey

func (*ChocolateyManager) CreatePackage

func (cm *ChocolateyManager) CreatePackage(ctx context.Context, artifact *BuildArtifact, metadata PackageMetadata) (*Package, error)

func (*ChocolateyManager) DeletePackage

func (cm *ChocolateyManager) DeletePackage(ctx context.Context, packageName, version string) error

func (*ChocolateyManager) GetPackageInfo

func (cm *ChocolateyManager) GetPackageInfo(ctx context.Context, packageName string) (*PackageInfo, error)

func (*ChocolateyManager) GetSupportedPlatforms

func (cm *ChocolateyManager) GetSupportedPlatforms() []Platform

func (*ChocolateyManager) GetType

func (cm *ChocolateyManager) GetType() PackageManagerType

func (*ChocolateyManager) IsAvailable

func (cm *ChocolateyManager) IsAvailable() bool

func (*ChocolateyManager) ListPackages

func (cm *ChocolateyManager) ListPackages(ctx context.Context, filters PackageFilters) ([]PackageInfo, error)

func (*ChocolateyManager) PublishToRepository

func (cm *ChocolateyManager) PublishToRepository(ctx context.Context, pkg *Package) error

func (*ChocolateyManager) UpdatePackage

func (cm *ChocolateyManager) UpdatePackage(ctx context.Context, packageName string, artifact *BuildArtifact) error

func (*ChocolateyManager) Validate

func (cm *ChocolateyManager) Validate() error

type CodeSigner

type CodeSigner interface {
	Sign(ctx context.Context, artifact *BuildArtifact, config PlatformSigningConfig) error
	Verify(ctx context.Context, artifact *BuildArtifact) error
	GetCertificateInfo() (*CertificateInfo, error)
}

CodeSigner interface for signing artifacts

func NewCodeSigner

func NewCodeSigner(config SigningConfig, logger Logger) CodeSigner

NewCodeSigner creates a new code signer

type Config

type Config struct {
	// Build configuration
	BuildTargets    []BuildTarget         `json:"build_targets"`
	ArtifactStorage ArtifactStorageConfig `json:"artifact_storage"`
	SigningConfig   SigningConfig         `json:"signing_config"`

	// Distribution configuration
	Channels        []ChannelConfig        `json:"channels"`
	PackageManagers []PackageManagerConfig `json:"package_managers"`

	// Update configuration
	UpdateServer       UpdateServerConfig `json:"update_server"`
	VerificationConfig VerificationConfig `json:"verification_config"`

	// Analytics configuration
	Analytics AnalyticsConfig `json:"analytics"`

	// Release configuration
	ReleaseStrategy ReleaseStrategy `json:"release_strategy"`
	RollbackConfig  RollbackConfig  `json:"rollback_config"`
}

Config defines distribution configuration

type DefaultCodeSigner

type DefaultCodeSigner struct {
	// contains filtered or unexported fields
}

func (*DefaultCodeSigner) GetCertificateInfo

func (dcs *DefaultCodeSigner) GetCertificateInfo() (*CertificateInfo, error)

func (*DefaultCodeSigner) Sign

func (dcs *DefaultCodeSigner) Sign(ctx context.Context, artifact *BuildArtifact, config PlatformSigningConfig) error

func (*DefaultCodeSigner) Verify

func (dcs *DefaultCodeSigner) Verify(ctx context.Context, artifact *BuildArtifact) error

type Dependency

type Dependency struct {
	Name     string `json:"name"`
	Version  string `json:"version"`
	Optional bool   `json:"optional"`
	Platform string `json:"platform,omitempty"`
}

Dependency represents a package dependency

type DistributionChannel

type DistributionChannel interface {
	// Release operations
	CreateRelease(ctx context.Context, release *Release) error
	UpdateRelease(ctx context.Context, releaseID string, updates map[string]interface{}) error
	DeleteRelease(ctx context.Context, releaseID string) error

	// Asset operations
	UploadAsset(ctx context.Context, releaseID string, asset *Asset) error
	DownloadAsset(ctx context.Context, releaseID, assetName string, writer io.Writer) error
	DeleteAsset(ctx context.Context, releaseID, assetName string) error

	// Query operations
	GetRelease(ctx context.Context, releaseID string) (*Release, error)
	ListReleases(ctx context.Context, filters ReleaseFilters) ([]Release, error)
	GetLatestRelease(ctx context.Context) (*Release, error)

	// Channel metadata
	GetType() ChannelType
	GetSupportedPlatforms() []Platform
	IsAvailable() bool
	Validate() error
}

DistributionChannel interface for distribution channels

func NewDockerHubChannel

func NewDockerHubChannel(config ChannelConfig, logger Logger) DistributionChannel

func NewGitHubChannel

func NewGitHubChannel(config ChannelConfig, logger Logger) DistributionChannel

func NewGitLabChannel

func NewGitLabChannel(config ChannelConfig, logger Logger) DistributionChannel

type DistributionManager

type DistributionManager struct {
	// contains filtered or unexported fields
}

DistributionManager orchestrates cross-platform CLI distribution

func NewDistributionManager

func NewDistributionManager(config *Config, logger Logger) *DistributionManager

NewDistributionManager creates a new distribution manager

func (*DistributionManager) GetAvailableChannels

func (dm *DistributionManager) GetAvailableChannels() []ChannelInfo

GetAvailableChannels returns list of available distribution channels

func (*DistributionManager) GetCurrentPlatform

func (dm *DistributionManager) GetCurrentPlatform() PlatformInfo

GetCurrentPlatform returns information about the current platform

func (*DistributionManager) GetDistributionMatrix

func (dm *DistributionManager) GetDistributionMatrix() DistributionMatrix

GetDistributionMatrix returns the distribution matrix

func (*DistributionManager) GetPackageManagers

func (dm *DistributionManager) GetPackageManagers() []PackageManagerInfo

GetPackageManagers returns list of supported package managers

func (*DistributionManager) GetSupportedPlatforms

func (dm *DistributionManager) GetSupportedPlatforms() []PlatformInfo

GetSupportedPlatforms returns list of supported platforms

func (*DistributionManager) ValidateDistributionConfig

func (dm *DistributionManager) ValidateDistributionConfig() []ValidationError

ValidateDistributionConfig validates the distribution configuration

type DistributionMatrix

type DistributionMatrix struct {
	Platforms map[Platform][]Architecture       `json:"platforms"`
	Channels  map[ChannelType][]Platform        `json:"channels"`
	Packages  map[PackageManagerType][]Platform `json:"packages"`
}

type DockerHubChannel

type DockerHubChannel struct {
	// contains filtered or unexported fields
}

DockerHubChannel implements DistributionChannel for Docker Hub

func (*DockerHubChannel) CreateRelease

func (dh *DockerHubChannel) CreateRelease(ctx context.Context, release *Release) error

func (*DockerHubChannel) DeleteAsset

func (dh *DockerHubChannel) DeleteAsset(ctx context.Context, releaseID, assetName string) error

func (*DockerHubChannel) DeleteRelease

func (dh *DockerHubChannel) DeleteRelease(ctx context.Context, releaseID string) error

func (*DockerHubChannel) DownloadAsset

func (dh *DockerHubChannel) DownloadAsset(ctx context.Context, releaseID, assetName string, writer io.Writer) error

func (*DockerHubChannel) GetLatestRelease

func (dh *DockerHubChannel) GetLatestRelease(ctx context.Context) (*Release, error)

func (*DockerHubChannel) GetRelease

func (dh *DockerHubChannel) GetRelease(ctx context.Context, releaseID string) (*Release, error)

func (*DockerHubChannel) GetSupportedPlatforms

func (dh *DockerHubChannel) GetSupportedPlatforms() []Platform

func (*DockerHubChannel) GetType

func (dh *DockerHubChannel) GetType() ChannelType

func (*DockerHubChannel) IsAvailable

func (dh *DockerHubChannel) IsAvailable() bool

func (*DockerHubChannel) ListReleases

func (dh *DockerHubChannel) ListReleases(ctx context.Context, filters ReleaseFilters) ([]Release, error)

func (*DockerHubChannel) UpdateRelease

func (dh *DockerHubChannel) UpdateRelease(ctx context.Context, releaseID string, updates map[string]interface{}) error

func (*DockerHubChannel) UploadAsset

func (dh *DockerHubChannel) UploadAsset(ctx context.Context, releaseID string, asset *Asset) error

func (*DockerHubChannel) Validate

func (dh *DockerHubChannel) Validate() error

type ErrorEvent

type ErrorEvent struct {
	EventID      string                 `json:"event_id"`
	Timestamp    time.Time              `json:"timestamp"`
	Version      string                 `json:"version"`
	ErrorType    string                 `json:"error_type"`
	ErrorMessage string                 `json:"error_message"`
	StackTrace   string                 `json:"stack_trace,omitempty"`
	Context      map[string]interface{} `json:"context"`
	Platform     Platform               `json:"platform"`
	Architecture Architecture           `json:"architecture"`
	Metadata     map[string]interface{} `json:"metadata"`
}

type ErrorStats

type ErrorStats struct {
	TotalErrors int64            `json:"total_errors"`
	ByType      map[string]int64 `json:"by_type"`
	ByVersion   map[string]int64 `json:"by_version"`
	ErrorRate   float64          `json:"error_rate"`
	TopErrors   []ErrorSummary   `json:"top_errors"`
	Period      TimePeriod       `json:"period"`
}

type ErrorSummary

type ErrorSummary struct {
	ErrorType  string    `json:"error_type"`
	Count      int64     `json:"count"`
	Percentage float64   `json:"percentage"`
	FirstSeen  time.Time `json:"first_seen"`
	LastSeen   time.Time `json:"last_seen"`
}

type EventType

type EventType string
const (
	EventTypeInstallation EventType = "installation"
	EventTypeUpdate       EventType = "update"
	EventTypeUsage        EventType = "usage"
	EventTypeError        EventType = "error"
)

type ExportFormat

type ExportFormat string
const (
	ExportFormatJSON ExportFormat = "json"
	ExportFormatCSV  ExportFormat = "csv"
	ExportFormatXML  ExportFormat = "xml"
)

type GCSConfig

type GCSConfig struct {
	Bucket      string `json:"bucket"`
	ProjectID   string `json:"project_id"`
	Credentials string `json:"credentials"`
	Prefix      string `json:"prefix"`
}

type GCSStorage

type GCSStorage struct {
	// contains filtered or unexported fields
}

func (*GCSStorage) Cleanup

func (gcs *GCSStorage) Cleanup(ctx context.Context, retentionPolicy RetentionPolicy) error

func (*GCSStorage) Delete

func (gcs *GCSStorage) Delete(ctx context.Context, location *StorageLocation) error

func (*GCSStorage) Exists

func (gcs *GCSStorage) Exists(ctx context.Context, location *StorageLocation) (bool, error)

func (*GCSStorage) GetMetadata

func (gcs *GCSStorage) GetMetadata(ctx context.Context, location *StorageLocation) (*ArtifactMetadata, error)

func (*GCSStorage) GetStorageUsage

func (gcs *GCSStorage) GetStorageUsage(ctx context.Context) (*StorageUsage, error)

func (*GCSStorage) List

func (gcs *GCSStorage) List(ctx context.Context, filters StorageFilters) ([]StorageLocation, error)

func (*GCSStorage) Retrieve

func (gcs *GCSStorage) Retrieve(ctx context.Context, location *StorageLocation, writer io.Writer) error

func (*GCSStorage) Search

func (gcs *GCSStorage) Search(ctx context.Context, query string) ([]StorageLocation, error)

func (*GCSStorage) Store

func (gcs *GCSStorage) Store(ctx context.Context, artifact *BuildArtifact) (*StorageLocation, error)

func (*GCSStorage) UpdateMetadata

func (gcs *GCSStorage) UpdateMetadata(ctx context.Context, location *StorageLocation, metadata *ArtifactMetadata) error

type GitHubChannel

type GitHubChannel struct {
	// contains filtered or unexported fields
}

GitHubChannel implements DistributionChannel for GitHub Releases

func (*GitHubChannel) CreateRelease

func (gc *GitHubChannel) CreateRelease(ctx context.Context, release *Release) error

func (*GitHubChannel) DeleteAsset

func (gc *GitHubChannel) DeleteAsset(ctx context.Context, releaseID, assetName string) error

func (*GitHubChannel) DeleteRelease

func (gc *GitHubChannel) DeleteRelease(ctx context.Context, releaseID string) error

func (*GitHubChannel) DownloadAsset

func (gc *GitHubChannel) DownloadAsset(ctx context.Context, releaseID, assetName string, writer io.Writer) error

func (*GitHubChannel) GetLatestRelease

func (gc *GitHubChannel) GetLatestRelease(ctx context.Context) (*Release, error)

func (*GitHubChannel) GetRelease

func (gc *GitHubChannel) GetRelease(ctx context.Context, releaseID string) (*Release, error)

func (*GitHubChannel) GetSupportedPlatforms

func (gc *GitHubChannel) GetSupportedPlatforms() []Platform

func (*GitHubChannel) GetType

func (gc *GitHubChannel) GetType() ChannelType

func (*GitHubChannel) IsAvailable

func (gc *GitHubChannel) IsAvailable() bool

func (*GitHubChannel) ListReleases

func (gc *GitHubChannel) ListReleases(ctx context.Context, filters ReleaseFilters) ([]Release, error)

func (*GitHubChannel) UpdateRelease

func (gc *GitHubChannel) UpdateRelease(ctx context.Context, releaseID string, updates map[string]interface{}) error

func (*GitHubChannel) UploadAsset

func (gc *GitHubChannel) UploadAsset(ctx context.Context, releaseID string, asset *Asset) error

func (*GitHubChannel) Validate

func (gc *GitHubChannel) Validate() error

type GitHubClient

type GitHubClient interface {
	CreateRelease(ctx context.Context, release *Release) error
	UploadAsset(ctx context.Context, releaseID string, asset *Asset) error
	GetRelease(ctx context.Context, releaseID string) (*Release, error)
	ListReleases(ctx context.Context) ([]Release, error)
}

type GitLabChannel

type GitLabChannel struct {
	// contains filtered or unexported fields
}

GitLabChannel implements DistributionChannel for GitLab Releases

func (*GitLabChannel) CreateRelease

func (gl *GitLabChannel) CreateRelease(ctx context.Context, release *Release) error

func (*GitLabChannel) DeleteAsset

func (gl *GitLabChannel) DeleteAsset(ctx context.Context, releaseID, assetName string) error

func (*GitLabChannel) DeleteRelease

func (gl *GitLabChannel) DeleteRelease(ctx context.Context, releaseID string) error

func (*GitLabChannel) DownloadAsset

func (gl *GitLabChannel) DownloadAsset(ctx context.Context, releaseID, assetName string, writer io.Writer) error

func (*GitLabChannel) GetLatestRelease

func (gl *GitLabChannel) GetLatestRelease(ctx context.Context) (*Release, error)

func (*GitLabChannel) GetRelease

func (gl *GitLabChannel) GetRelease(ctx context.Context, releaseID string) (*Release, error)

func (*GitLabChannel) GetSupportedPlatforms

func (gl *GitLabChannel) GetSupportedPlatforms() []Platform

func (*GitLabChannel) GetType

func (gl *GitLabChannel) GetType() ChannelType

func (*GitLabChannel) IsAvailable

func (gl *GitLabChannel) IsAvailable() bool

func (*GitLabChannel) ListReleases

func (gl *GitLabChannel) ListReleases(ctx context.Context, filters ReleaseFilters) ([]Release, error)

func (*GitLabChannel) UpdateRelease

func (gl *GitLabChannel) UpdateRelease(ctx context.Context, releaseID string, updates map[string]interface{}) error

func (*GitLabChannel) UploadAsset

func (gl *GitLabChannel) UploadAsset(ctx context.Context, releaseID string, asset *Asset) error

func (*GitLabChannel) Validate

func (gl *GitLabChannel) Validate() error

type HealthCheck

type HealthCheck struct {
	Name      string        `json:"name"`
	Type      string        `json:"type"`
	Endpoint  string        `json:"endpoint"`
	Interval  time.Duration `json:"interval"`
	Timeout   time.Duration `json:"timeout"`
	Threshold int           `json:"threshold"`
	Required  bool          `json:"required"`
}

HealthCheck defines release health verification

type HealthCheckResult

type HealthCheckResult struct {
	Name      string                 `json:"name"`
	Status    HealthState            `json:"status"`
	Message   string                 `json:"message"`
	Duration  time.Duration          `json:"duration"`
	Timestamp time.Time              `json:"timestamp"`
	Metadata  map[string]interface{} `json:"metadata,omitempty"`
}

type HealthMonitor

type HealthMonitor struct {
	ReleaseID     string
	Checks        []HealthCheck
	Results       []HealthCheckResult
	Status        HealthState
	LastCheck     time.Time
	CheckInterval time.Duration
	// contains filtered or unexported fields
}

HealthMonitor tracks release health

type HealthState

type HealthState string
const (
	HealthStateHealthy   HealthState = "healthy"
	HealthStateUnhealthy HealthState = "unhealthy"
	HealthStateUnknown   HealthState = "unknown"
)

type HealthStatus

type HealthStatus struct {
	Overall   HealthState         `json:"overall"`
	Checks    []HealthCheckResult `json:"checks"`
	Score     float64             `json:"score"`
	UpdatedAt time.Time           `json:"updated_at"`
}

type HomebrewManager

type HomebrewManager struct {
	// contains filtered or unexported fields
}

HomebrewManager implements PackageManager for Homebrew

func (*HomebrewManager) CreatePackage

func (hm *HomebrewManager) CreatePackage(ctx context.Context, artifact *BuildArtifact, metadata PackageMetadata) (*Package, error)

func (*HomebrewManager) DeletePackage

func (hm *HomebrewManager) DeletePackage(ctx context.Context, packageName, version string) error

func (*HomebrewManager) GetPackageInfo

func (hm *HomebrewManager) GetPackageInfo(ctx context.Context, packageName string) (*PackageInfo, error)

func (*HomebrewManager) GetSupportedPlatforms

func (hm *HomebrewManager) GetSupportedPlatforms() []Platform

func (*HomebrewManager) GetType

func (hm *HomebrewManager) GetType() PackageManagerType

func (*HomebrewManager) IsAvailable

func (hm *HomebrewManager) IsAvailable() bool

func (*HomebrewManager) ListPackages

func (hm *HomebrewManager) ListPackages(ctx context.Context, filters PackageFilters) ([]PackageInfo, error)

func (*HomebrewManager) PublishToRepository

func (hm *HomebrewManager) PublishToRepository(ctx context.Context, pkg *Package) error

func (*HomebrewManager) UpdatePackage

func (hm *HomebrewManager) UpdatePackage(ctx context.Context, packageName string, artifact *BuildArtifact) error

func (*HomebrewManager) Validate

func (hm *HomebrewManager) Validate() error

type InstallationAnalytics

type InstallationAnalytics interface {
	// Event tracking
	TrackInstallation(ctx context.Context, event *InstallationEvent) error
	TrackUpdate(ctx context.Context, event *UpdateEvent) error
	TrackUsage(ctx context.Context, event *UsageEvent) error
	TrackError(ctx context.Context, event *ErrorEvent) error

	// Query operations
	GetInstallationStats(ctx context.Context, filters AnalyticsFilters) (*InstallationStats, error)
	GetUsageStats(ctx context.Context, filters AnalyticsFilters) (*UsageStats, error)
	GetErrorStats(ctx context.Context, filters AnalyticsFilters) (*ErrorStats, error)

	// Reports
	GenerateReport(ctx context.Context, reportType ReportType, period TimePeriod) (*AnalyticsReport, error)
	ExportData(ctx context.Context, format ExportFormat, filters AnalyticsFilters, writer io.Writer) error

	// Configuration
	IsEnabled() bool
	GetRetentionPeriod() time.Duration
}

InstallationAnalytics interface for tracking installations

func NewInstallationAnalytics

func NewInstallationAnalytics(config AnalyticsConfig, logger Logger) InstallationAnalytics

type InstallationAnalyticsImpl

type InstallationAnalyticsImpl struct {
	// contains filtered or unexported fields
}

InstallationAnalyticsImpl implements the InstallationAnalytics interface

func (*InstallationAnalyticsImpl) ExportData

func (ia *InstallationAnalyticsImpl) ExportData(ctx context.Context, format ExportFormat, filters AnalyticsFilters, writer io.Writer) error

func (*InstallationAnalyticsImpl) GenerateReport

func (ia *InstallationAnalyticsImpl) GenerateReport(ctx context.Context, reportType ReportType, period TimePeriod) (*AnalyticsReport, error)

func (*InstallationAnalyticsImpl) GetErrorStats

func (ia *InstallationAnalyticsImpl) GetErrorStats(ctx context.Context, filters AnalyticsFilters) (*ErrorStats, error)

func (*InstallationAnalyticsImpl) GetInstallationStats

func (ia *InstallationAnalyticsImpl) GetInstallationStats(ctx context.Context, filters AnalyticsFilters) (*InstallationStats, error)

func (*InstallationAnalyticsImpl) GetRetentionPeriod

func (ia *InstallationAnalyticsImpl) GetRetentionPeriod() time.Duration

func (*InstallationAnalyticsImpl) GetUsageStats

func (ia *InstallationAnalyticsImpl) GetUsageStats(ctx context.Context, filters AnalyticsFilters) (*UsageStats, error)

func (*InstallationAnalyticsImpl) IsEnabled

func (ia *InstallationAnalyticsImpl) IsEnabled() bool

func (*InstallationAnalyticsImpl) TrackError

func (ia *InstallationAnalyticsImpl) TrackError(ctx context.Context, event *ErrorEvent) error

func (*InstallationAnalyticsImpl) TrackInstallation

func (ia *InstallationAnalyticsImpl) TrackInstallation(ctx context.Context, event *InstallationEvent) error

func (*InstallationAnalyticsImpl) TrackUpdate

func (ia *InstallationAnalyticsImpl) TrackUpdate(ctx context.Context, event *UpdateEvent) error

func (*InstallationAnalyticsImpl) TrackUsage

func (ia *InstallationAnalyticsImpl) TrackUsage(ctx context.Context, event *UsageEvent) error

type InstallationEvent

type InstallationEvent struct {
	EventID      string                 `json:"event_id"`
	Timestamp    time.Time              `json:"timestamp"`
	Version      string                 `json:"version"`
	Platform     Platform               `json:"platform"`
	Architecture Architecture           `json:"architecture"`
	Source       string                 `json:"source"`
	UserAgent    string                 `json:"user_agent"`
	IPAddress    string                 `json:"ip_address"`
	Country      string                 `json:"country,omitempty"`
	Metadata     map[string]interface{} `json:"metadata"`
}

Analytics-related types

type InstallationStats

type InstallationStats struct {
	TotalInstalls  int64              `json:"total_installs"`
	UniqueInstalls int64              `json:"unique_installs"`
	ByPlatform     map[Platform]int64 `json:"by_platform"`
	ByVersion      map[string]int64   `json:"by_version"`
	BySource       map[string]int64   `json:"by_source"`
	ByCountry      map[string]int64   `json:"by_country"`
	GrowthRate     float64            `json:"growth_rate"`
	Period         TimePeriod         `json:"period"`
}

type LocalConfig

type LocalConfig struct {
	Path string `json:"path"`
}

type LocalStorage

type LocalStorage struct {
	// contains filtered or unexported fields
}

Simple storage implementations (mock)

func (*LocalStorage) Cleanup

func (ls *LocalStorage) Cleanup(ctx context.Context, retentionPolicy RetentionPolicy) error

func (*LocalStorage) Delete

func (ls *LocalStorage) Delete(ctx context.Context, location *StorageLocation) error

func (*LocalStorage) Exists

func (ls *LocalStorage) Exists(ctx context.Context, location *StorageLocation) (bool, error)

func (*LocalStorage) GetMetadata

func (ls *LocalStorage) GetMetadata(ctx context.Context, location *StorageLocation) (*ArtifactMetadata, error)

func (*LocalStorage) GetStorageUsage

func (ls *LocalStorage) GetStorageUsage(ctx context.Context) (*StorageUsage, error)

func (*LocalStorage) List

func (ls *LocalStorage) List(ctx context.Context, filters StorageFilters) ([]StorageLocation, error)

func (*LocalStorage) Retrieve

func (ls *LocalStorage) Retrieve(ctx context.Context, location *StorageLocation, writer io.Writer) error

func (*LocalStorage) Search

func (ls *LocalStorage) Search(ctx context.Context, query string) ([]StorageLocation, error)

func (*LocalStorage) Store

func (ls *LocalStorage) Store(ctx context.Context, artifact *BuildArtifact) (*StorageLocation, error)

func (*LocalStorage) UpdateMetadata

func (ls *LocalStorage) UpdateMetadata(ctx context.Context, location *StorageLocation, metadata *ArtifactMetadata) error

type Logger

type Logger interface {
	Info(msg string, keysAndValues ...interface{})
	Warn(msg string, keysAndValues ...interface{})
	Error(msg string, keysAndValues ...interface{})
	Debug(msg string, keysAndValues ...interface{})
}

Logger interface for logging distribution operations

type MockAnalyticsStorage

type MockAnalyticsStorage struct {
	// contains filtered or unexported fields
}

Mock analytics storage

func (*MockAnalyticsStorage) Cleanup

func (mas *MockAnalyticsStorage) Cleanup(ctx context.Context, olderThan time.Time) error

func (*MockAnalyticsStorage) GetEvents

func (mas *MockAnalyticsStorage) GetEvents(ctx context.Context, filters AnalyticsFilters) ([]AnalyticsEvent, error)

func (*MockAnalyticsStorage) GetStats

func (mas *MockAnalyticsStorage) GetStats(ctx context.Context, filters AnalyticsFilters) (*StatsResult, error)

func (*MockAnalyticsStorage) StoreEvent

func (mas *MockAnalyticsStorage) StoreEvent(ctx context.Context, event AnalyticsEvent) error

type MockGitHubClient

type MockGitHubClient struct {
	// contains filtered or unexported fields
}

Mock GitHub client for demonstration

func (*MockGitHubClient) CreateRelease

func (mgc *MockGitHubClient) CreateRelease(ctx context.Context, release *Release) error

func (*MockGitHubClient) GetRelease

func (mgc *MockGitHubClient) GetRelease(ctx context.Context, releaseID string) (*Release, error)

func (*MockGitHubClient) ListReleases

func (mgc *MockGitHubClient) ListReleases(ctx context.Context) ([]Release, error)

func (*MockGitHubClient) UploadAsset

func (mgc *MockGitHubClient) UploadAsset(ctx context.Context, releaseID string, asset *Asset) error

type NoOpSigner

type NoOpSigner struct{}

Code signing implementations

func (*NoOpSigner) GetCertificateInfo

func (nos *NoOpSigner) GetCertificateInfo() (*CertificateInfo, error)

func (*NoOpSigner) Sign

func (nos *NoOpSigner) Sign(ctx context.Context, artifact *BuildArtifact, config PlatformSigningConfig) error

func (*NoOpSigner) Verify

func (nos *NoOpSigner) Verify(ctx context.Context, artifact *BuildArtifact) error

type Package

type Package struct {
	ID        string           `json:"id"`
	Name      string           `json:"name"`
	Version   string           `json:"version"`
	Type      PackageType      `json:"type"`
	Platform  Platform         `json:"platform"`
	Arch      Architecture     `json:"architecture"`
	Metadata  PackageMetadata  `json:"metadata"`
	Artifact  *BuildArtifact   `json:"artifact"`
	Location  *StorageLocation `json:"location"`
	CreatedAt time.Time        `json:"created_at"`
}

Package-related types

type PackageFilters

type PackageFilters struct {
	Platform     []Platform `json:"platform,omitempty"`
	Version      string     `json:"version,omitempty"`
	UpdatedAfter *time.Time `json:"updated_after,omitempty"`
	Limit        int        `json:"limit,omitempty"`
	Offset       int        `json:"offset,omitempty"`
}

type PackageInfo

type PackageInfo struct {
	Name          string                 `json:"name"`
	Version       string                 `json:"version"`
	LatestVersion string                 `json:"latest_version"`
	Description   string                 `json:"description"`
	Homepage      string                 `json:"homepage"`
	License       string                 `json:"license"`
	Platforms     []Platform             `json:"platforms"`
	Downloads     int64                  `json:"downloads"`
	LastUpdated   time.Time              `json:"last_updated"`
	Repository    string                 `json:"repository"`
	Metadata      map[string]interface{} `json:"metadata"`
}

type PackageManager

type PackageManager interface {
	// Package operations
	CreatePackage(ctx context.Context, artifact *BuildArtifact, metadata PackageMetadata) (*Package, error)
	UpdatePackage(ctx context.Context, packageName string, artifact *BuildArtifact) error
	DeletePackage(ctx context.Context, packageName, version string) error

	// Repository operations
	PublishToRepository(ctx context.Context, pkg *Package) error
	GetPackageInfo(ctx context.Context, packageName string) (*PackageInfo, error)
	ListPackages(ctx context.Context, filters PackageFilters) ([]PackageInfo, error)

	// Metadata operations
	GetSupportedPlatforms() []Platform
	GetType() PackageManagerType
	IsAvailable() bool
	Validate() error
}

PackageManager interface for package manager integration

func NewAPTManager

func NewAPTManager(config PackageManagerConfig, logger Logger) PackageManager

func NewChocolateyManager

func NewChocolateyManager(config PackageManagerConfig, logger Logger) PackageManager

func NewHomebrewManager

func NewHomebrewManager(config PackageManagerConfig, logger Logger) PackageManager

func NewRPMManager

func NewRPMManager(config PackageManagerConfig, logger Logger) PackageManager

func NewScoopManager

func NewScoopManager(config PackageManagerConfig, logger Logger) PackageManager

func NewSnapManager

func NewSnapManager(config PackageManagerConfig, logger Logger) PackageManager

func NewWingetManager

func NewWingetManager(config PackageManagerConfig, logger Logger) PackageManager

type PackageManagerConfig

type PackageManagerConfig struct {
	Name        string             `json:"name"`
	Type        PackageManagerType `json:"type"`
	Enabled     bool               `json:"enabled"`
	Repository  string             `json:"repository"`
	Credentials map[string]string  `json:"credentials"`
	Metadata    PackageMetadata    `json:"metadata"`
	AutoUpdate  bool               `json:"auto_update"`
}

PackageManagerConfig defines package manager integration

type PackageManagerInfo

type PackageManagerInfo struct {
	Name       string             `json:"name"`
	Type       PackageManagerType `json:"type"`
	Repository string             `json:"repository"`
	AutoUpdate bool               `json:"auto_update"`
}

type PackageManagerType

type PackageManagerType string

PackageManagerType represents different package managers

const (
	PackageManagerHomebrew   PackageManagerType = "homebrew"
	PackageManagerChocolatey PackageManagerType = "chocolatey"
	PackageManagerAPT        PackageManagerType = "apt"
	PackageManagerRPM        PackageManagerType = "rpm"
	PackageManagerSnap       PackageManagerType = "snap"
	PackageManagerFlatpak    PackageManagerType = "flatpak"
	PackageManagerWinget     PackageManagerType = "winget"
	PackageManagerScoop      PackageManagerType = "scoop"
	PackageManagerAUR        PackageManagerType = "aur"
	PackageManagerNPM        PackageManagerType = "npm"
	PackageManagerPyPI       PackageManagerType = "pypi"
)

type PackageMetadata

type PackageMetadata struct {
	Name         string                 `json:"name"`
	Version      string                 `json:"version"`
	Description  string                 `json:"description"`
	Homepage     string                 `json:"homepage"`
	License      string                 `json:"license"`
	Authors      []string               `json:"authors"`
	Keywords     []string               `json:"keywords"`
	Categories   []string               `json:"categories"`
	Dependencies []Dependency           `json:"dependencies"`
	Conflicts    []string               `json:"conflicts"`
	Provides     []string               `json:"provides"`
	Replaces     []string               `json:"replaces"`
	Extras       map[string]interface{} `json:"extras"`
}

PackageMetadata defines package metadata

type PackageType

type PackageType string
const (
	PackageTypeDEB     PackageType = "deb"
	PackageTypeRPM     PackageType = "rpm"
	PackageTypeSnap    PackageType = "snap"
	PackageTypeFlatpak PackageType = "flatpak"
	PackageTypeMSI     PackageType = "msi"
	PackageTypeDMG     PackageType = "dmg"
	PackageTypePKG     PackageType = "pkg"
	PackageTypeTarball PackageType = "tarball"
	PackageTypeZip     PackageType = "zip"
)

type Platform

type Platform string

Platform represents target platforms

const (
	PlatformLinux   Platform = "linux"
	PlatformWindows Platform = "windows"
	PlatformMacOS   Platform = "darwin"
	PlatformFreeBSD Platform = "freebsd"
	PlatformOpenBSD Platform = "openbsd"
	PlatformNetBSD  Platform = "netbsd"
)

type PlatformInfo

type PlatformInfo struct {
	Platform     Platform     `json:"platform"`
	Architecture Architecture `json:"architecture"`
	GoOS         string       `json:"goos"`
	GoArch       string       `json:"goarch"`
	Available    bool         `json:"available"`
}

type PlatformSigningConfig

type PlatformSigningConfig struct {
	Enabled      bool   `json:"enabled"`
	Identity     string `json:"identity"`     // Code signing identity
	Entitlements string `json:"entitlements"` // macOS entitlements file
	BundleID     string `json:"bundle_id"`    // macOS bundle identifier
	TeamID       string `json:"team_id"`      // Apple Developer Team ID
}

PlatformSigningConfig defines platform-specific signing

type PublicKey

type PublicKey struct {
	ID          string     `json:"id"`
	Algorithm   string     `json:"algorithm"`
	Key         string     `json:"key"`
	Fingerprint string     `json:"fingerprint"`
	CreatedAt   time.Time  `json:"created_at"`
	ExpiresAt   *time.Time `json:"expires_at,omitempty"`
}

type RPMManager

type RPMManager struct {
	// contains filtered or unexported fields
}

RPMManager implements PackageManager for RPM (RedHat/CentOS/SUSE)

func (*RPMManager) CreatePackage

func (rm *RPMManager) CreatePackage(ctx context.Context, artifact *BuildArtifact, metadata PackageMetadata) (*Package, error)

func (*RPMManager) DeletePackage

func (rm *RPMManager) DeletePackage(ctx context.Context, packageName, version string) error

func (*RPMManager) GetPackageInfo

func (rm *RPMManager) GetPackageInfo(ctx context.Context, packageName string) (*PackageInfo, error)

func (*RPMManager) GetSupportedPlatforms

func (rm *RPMManager) GetSupportedPlatforms() []Platform

func (*RPMManager) GetType

func (rm *RPMManager) GetType() PackageManagerType

func (*RPMManager) IsAvailable

func (rm *RPMManager) IsAvailable() bool

func (*RPMManager) ListPackages

func (rm *RPMManager) ListPackages(ctx context.Context, filters PackageFilters) ([]PackageInfo, error)

func (*RPMManager) PublishToRepository

func (rm *RPMManager) PublishToRepository(ctx context.Context, pkg *Package) error

func (*RPMManager) UpdatePackage

func (rm *RPMManager) UpdatePackage(ctx context.Context, packageName string, artifact *BuildArtifact) error

func (*RPMManager) Validate

func (rm *RPMManager) Validate() error

type Release

type Release struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Version     string                 `json:"version"`
	Channel     ReleaseChannel         `json:"channel"`
	Description string                 `json:"description"`
	Assets      []Asset                `json:"assets"`
	CreatedAt   time.Time              `json:"created_at"`
	PublishedAt *time.Time             `json:"published_at,omitempty"`
	Status      ReleaseStatus          `json:"status"`
	Metadata    map[string]interface{} `json:"metadata"`
}

Release-related types

type ReleaseChannel

type ReleaseChannel struct {
	Name         string         `json:"name"`
	Stability    StabilityLevel `json:"stability"`
	Audience     string         `json:"audience"`
	Percentage   int            `json:"percentage"`
	Requirements []string       `json:"requirements"`
}

ReleaseChannel represents different release channels

type ReleaseDefinition

type ReleaseDefinition struct {
	Name         string                 `json:"name"`
	Version      string                 `json:"version"`
	Channel      ReleaseChannel         `json:"channel"`
	Artifacts    []BuildArtifact        `json:"artifacts"`
	Description  string                 `json:"description"`
	Changelog    string                 `json:"changelog"`
	Strategy     ReleaseStrategy        `json:"strategy"`
	HealthChecks []HealthCheck          `json:"health_checks"`
	Metadata     map[string]interface{} `json:"metadata"`
}

Release management types

type ReleaseExecution

type ReleaseExecution struct {
	ID           string                 `json:"id"`
	Definition   ReleaseDefinition      `json:"definition"`
	Status       ReleaseExecutionStatus `json:"status"`
	Progress     int                    `json:"progress"`
	StartedAt    time.Time              `json:"started_at"`
	CompletedAt  *time.Time             `json:"completed_at,omitempty"`
	Logs         []ReleaseLog           `json:"logs"`
	HealthStatus *HealthStatus          `json:"health_status,omitempty"`
}

type ReleaseExecutionStatus

type ReleaseExecutionStatus string
const (
	ReleaseExecutionStatusPending    ReleaseExecutionStatus = "pending"
	ReleaseExecutionStatusRunning    ReleaseExecutionStatus = "running"
	ReleaseExecutionStatusCompleted  ReleaseExecutionStatus = "completed"
	ReleaseExecutionStatusFailed     ReleaseExecutionStatus = "failed"
	ReleaseExecutionStatusCancelled  ReleaseExecutionStatus = "cancelled"
	ReleaseExecutionStatusRolledBack ReleaseExecutionStatus = "rolled_back"
)

type ReleaseFilters

type ReleaseFilters struct {
	Channel      []ReleaseChannel `json:"channel,omitempty"`
	Status       []ReleaseStatus  `json:"status,omitempty"`
	Version      string           `json:"version,omitempty"`
	CreatedAfter *time.Time       `json:"created_after,omitempty"`
	Limit        int              `json:"limit,omitempty"`
	Offset       int              `json:"offset,omitempty"`
}

type ReleaseInfo

type ReleaseInfo struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Version     string                 `json:"version"`
	Channel     ReleaseChannel         `json:"channel"`
	Status      ReleaseExecutionStatus `json:"status"`
	Progress    int                    `json:"progress"`
	StartedAt   time.Time              `json:"started_at"`
	CompletedAt *time.Time             `json:"completed_at,omitempty"`
}

type ReleaseLog

type ReleaseLog struct {
	Timestamp time.Time              `json:"timestamp"`
	Level     string                 `json:"level"`
	Message   string                 `json:"message"`
	Context   map[string]interface{} `json:"context,omitempty"`
}

type ReleaseManager

type ReleaseManager interface {
	// Release lifecycle
	CreateRelease(ctx context.Context, release *ReleaseDefinition) (*ReleaseExecution, error)
	PromoteRelease(ctx context.Context, releaseID string, targetChannel ReleaseChannel) error
	RollbackRelease(ctx context.Context, releaseID string) error
	CancelRelease(ctx context.Context, releaseID string) error

	// Health monitoring
	CheckReleaseHealth(ctx context.Context, releaseID string) (*HealthStatus, error)
	GetHealthChecks(ctx context.Context, releaseID string) ([]HealthCheckResult, error)

	// Strategy management
	GetStrategy() ReleaseStrategy
	UpdateStrategy(ctx context.Context, strategy ReleaseStrategy) error

	// Reporting
	GetReleaseStatus(ctx context.Context, releaseID string) (*ReleaseStatus, error)
	ListReleases(ctx context.Context, filters ReleaseFilters) ([]ReleaseInfo, error)
}

ReleaseManager interface for managing releases

func NewReleaseManager

func NewReleaseManager(strategy ReleaseStrategy, logger Logger) ReleaseManager

type ReleaseManagerImpl

type ReleaseManagerImpl struct {
	// contains filtered or unexported fields
}

ReleaseManagerImpl implements the ReleaseManager interface

func (*ReleaseManagerImpl) CancelRelease

func (rm *ReleaseManagerImpl) CancelRelease(ctx context.Context, releaseID string) error

func (*ReleaseManagerImpl) CheckReleaseHealth

func (rm *ReleaseManagerImpl) CheckReleaseHealth(ctx context.Context, releaseID string) (*HealthStatus, error)

func (*ReleaseManagerImpl) CreateRelease

func (rm *ReleaseManagerImpl) CreateRelease(ctx context.Context, release *ReleaseDefinition) (*ReleaseExecution, error)

func (*ReleaseManagerImpl) GetHealthChecks

func (rm *ReleaseManagerImpl) GetHealthChecks(ctx context.Context, releaseID string) ([]HealthCheckResult, error)

func (*ReleaseManagerImpl) GetReleaseStatus

func (rm *ReleaseManagerImpl) GetReleaseStatus(ctx context.Context, releaseID string) (*ReleaseStatus, error)

func (*ReleaseManagerImpl) GetStrategy

func (rm *ReleaseManagerImpl) GetStrategy() ReleaseStrategy

func (*ReleaseManagerImpl) ListReleases

func (rm *ReleaseManagerImpl) ListReleases(ctx context.Context, filters ReleaseFilters) ([]ReleaseInfo, error)

func (*ReleaseManagerImpl) PromoteRelease

func (rm *ReleaseManagerImpl) PromoteRelease(ctx context.Context, releaseID string, targetChannel ReleaseChannel) error

func (*ReleaseManagerImpl) RollbackRelease

func (rm *ReleaseManagerImpl) RollbackRelease(ctx context.Context, releaseID string) error

func (*ReleaseManagerImpl) UpdateStrategy

func (rm *ReleaseManagerImpl) UpdateStrategy(ctx context.Context, strategy ReleaseStrategy) error

type ReleaseStatus

type ReleaseStatus string
const (
	ReleaseStatusDraft     ReleaseStatus = "draft"
	ReleaseStatusPublished ReleaseStatus = "published"
	ReleaseStatusArchived  ReleaseStatus = "archived"
	ReleaseStatusDeleted   ReleaseStatus = "deleted"
)

type ReleaseStrategy

type ReleaseStrategy struct {
	Type           ReleaseType      `json:"type"`
	Channels       []ReleaseChannel `json:"channels"`
	RolloutPercent int              `json:"rollout_percent"`
	CanaryDuration time.Duration    `json:"canary_duration"`
	AutoPromote    bool             `json:"auto_promote"`
	HealthChecks   []HealthCheck    `json:"health_checks"`
}

ReleaseStrategy defines release management strategy

type ReleaseType

type ReleaseType string

ReleaseType represents different release strategies

const (
	ReleaseTypeImmediate ReleaseType = "immediate"
	ReleaseTypeStaged    ReleaseType = "staged"
	ReleaseTypeCanary    ReleaseType = "canary"
	ReleaseTypeBlueGreen ReleaseType = "blue_green"
)

type ReportType

type ReportType string
const (
	ReportTypeInstallation  ReportType = "installation"
	ReportTypeUsage         ReportType = "usage"
	ReportTypeError         ReportType = "error"
	ReportTypeComprehensive ReportType = "comprehensive"
)

type RetentionPolicy

type RetentionPolicy struct {
	MaxAge      time.Duration `json:"max_age"`
	MaxVersions int           `json:"max_versions"`
	MinVersions int           `json:"min_versions"`
	KeepLatest  bool          `json:"keep_latest"`
}

type RollbackConfig

type RollbackConfig struct {
	Enabled          bool          `json:"enabled"`
	AutoRollback     bool          `json:"auto_rollback"`
	TriggerThreshold float64       `json:"trigger_threshold"`
	MaxVersions      int           `json:"max_versions"`
	RollbackWindow   time.Duration `json:"rollback_window"`
}

RollbackConfig defines rollback configuration

type RollbackState

type RollbackState struct {
	ReleaseID       string
	PreviousVersion string
	RollbackReason  string
	InitiatedAt     time.Time
	CompletedAt     *time.Time
	Status          RollbackStatus
	Steps           []RollbackStep
}

RollbackState tracks rollback information

type RollbackStatus

type RollbackStatus string
const (
	RollbackStatusPending    RollbackStatus = "pending"
	RollbackStatusInProgress RollbackStatus = "in_progress"
	RollbackStatusCompleted  RollbackStatus = "completed"
	RollbackStatusFailed     RollbackStatus = "failed"
)

type RollbackStep

type RollbackStep struct {
	Name        string
	Status      RollbackStatus
	StartedAt   time.Time
	CompletedAt *time.Time
	Error       string
}

type S3Config

type S3Config struct {
	Bucket    string `json:"bucket"`
	Region    string `json:"region"`
	AccessKey string `json:"access_key"`
	SecretKey string `json:"secret_key"`
	Prefix    string `json:"prefix"`
}

Storage configurations

type S3Storage

type S3Storage struct {
	// contains filtered or unexported fields
}

func (*S3Storage) Cleanup

func (s3 *S3Storage) Cleanup(ctx context.Context, retentionPolicy RetentionPolicy) error

func (*S3Storage) Delete

func (s3 *S3Storage) Delete(ctx context.Context, location *StorageLocation) error

func (*S3Storage) Exists

func (s3 *S3Storage) Exists(ctx context.Context, location *StorageLocation) (bool, error)

func (*S3Storage) GetMetadata

func (s3 *S3Storage) GetMetadata(ctx context.Context, location *StorageLocation) (*ArtifactMetadata, error)

func (*S3Storage) GetStorageUsage

func (s3 *S3Storage) GetStorageUsage(ctx context.Context) (*StorageUsage, error)

func (*S3Storage) List

func (s3 *S3Storage) List(ctx context.Context, filters StorageFilters) ([]StorageLocation, error)

func (*S3Storage) Retrieve

func (s3 *S3Storage) Retrieve(ctx context.Context, location *StorageLocation, writer io.Writer) error

func (*S3Storage) Search

func (s3 *S3Storage) Search(ctx context.Context, query string) ([]StorageLocation, error)

func (*S3Storage) Store

func (s3 *S3Storage) Store(ctx context.Context, artifact *BuildArtifact) (*StorageLocation, error)

func (*S3Storage) UpdateMetadata

func (s3 *S3Storage) UpdateMetadata(ctx context.Context, location *StorageLocation, metadata *ArtifactMetadata) error

type ScoopManager

type ScoopManager struct {
	// contains filtered or unexported fields
}

ScoopManager implements PackageManager for Scoop

func (*ScoopManager) CreatePackage

func (sm *ScoopManager) CreatePackage(ctx context.Context, artifact *BuildArtifact, metadata PackageMetadata) (*Package, error)

func (*ScoopManager) DeletePackage

func (sm *ScoopManager) DeletePackage(ctx context.Context, packageName, version string) error

func (*ScoopManager) GetPackageInfo

func (sm *ScoopManager) GetPackageInfo(ctx context.Context, packageName string) (*PackageInfo, error)

func (*ScoopManager) GetSupportedPlatforms

func (sm *ScoopManager) GetSupportedPlatforms() []Platform

func (*ScoopManager) GetType

func (sm *ScoopManager) GetType() PackageManagerType

func (*ScoopManager) IsAvailable

func (sm *ScoopManager) IsAvailable() bool

func (*ScoopManager) ListPackages

func (sm *ScoopManager) ListPackages(ctx context.Context, filters PackageFilters) ([]PackageInfo, error)

func (*ScoopManager) PublishToRepository

func (sm *ScoopManager) PublishToRepository(ctx context.Context, pkg *Package) error

func (*ScoopManager) UpdatePackage

func (sm *ScoopManager) UpdatePackage(ctx context.Context, packageName string, artifact *BuildArtifact) error

func (*ScoopManager) Validate

func (sm *ScoopManager) Validate() error

type Signature

type Signature struct {
	Algorithm string    `json:"algorithm"`
	KeyID     string    `json:"key_id"`
	Signature string    `json:"signature"`
	Timestamp time.Time `json:"timestamp"`
}

Verification-related types

type SigningConfig

type SigningConfig struct {
	Enabled      bool                               `json:"enabled"`
	KeyPath      string                             `json:"key_path"`
	CertPath     string                             `json:"cert_path"`
	Algorithm    string                             `json:"algorithm"`
	Timestamping bool                               `json:"timestamping"`
	Platforms    map[Platform]PlatformSigningConfig `json:"platforms"`
}

SigningConfig defines code signing configuration

type SnapManager

type SnapManager struct {
	// contains filtered or unexported fields
}

SnapManager implements PackageManager for Snap

func (*SnapManager) CreatePackage

func (sm *SnapManager) CreatePackage(ctx context.Context, artifact *BuildArtifact, metadata PackageMetadata) (*Package, error)

func (*SnapManager) DeletePackage

func (sm *SnapManager) DeletePackage(ctx context.Context, packageName, version string) error

func (*SnapManager) GetPackageInfo

func (sm *SnapManager) GetPackageInfo(ctx context.Context, packageName string) (*PackageInfo, error)

func (*SnapManager) GetSupportedPlatforms

func (sm *SnapManager) GetSupportedPlatforms() []Platform

func (*SnapManager) GetType

func (sm *SnapManager) GetType() PackageManagerType

func (*SnapManager) IsAvailable

func (sm *SnapManager) IsAvailable() bool

func (*SnapManager) ListPackages

func (sm *SnapManager) ListPackages(ctx context.Context, filters PackageFilters) ([]PackageInfo, error)

func (*SnapManager) PublishToRepository

func (sm *SnapManager) PublishToRepository(ctx context.Context, pkg *Package) error

func (*SnapManager) UpdatePackage

func (sm *SnapManager) UpdatePackage(ctx context.Context, packageName string, artifact *BuildArtifact) error

func (*SnapManager) Validate

func (sm *SnapManager) Validate() error

type StabilityLevel

type StabilityLevel string

StabilityLevel represents release stability

const (
	StabilityAlpha  StabilityLevel = "alpha"
	StabilityBeta   StabilityLevel = "beta"
	StabilityRC     StabilityLevel = "rc"
	StabilityStable StabilityLevel = "stable"
)

type StatsResult

type StatsResult struct {
	InstallationStats *InstallationStats `json:"installation_stats,omitempty"`
	UsageStats        *UsageStats        `json:"usage_stats,omitempty"`
	ErrorStats        *ErrorStats        `json:"error_stats,omitempty"`
}

type StorageFilters

type StorageFilters struct {
	Platform      []Platform        `json:"platform,omitempty"`
	Architecture  []Architecture    `json:"architecture,omitempty"`
	Version       string            `json:"version,omitempty"`
	CreatedAfter  *time.Time        `json:"created_after,omitempty"`
	CreatedBefore *time.Time        `json:"created_before,omitempty"`
	Tags          map[string]string `json:"tags,omitempty"`
	Limit         int               `json:"limit,omitempty"`
	Offset        int               `json:"offset,omitempty"`
}

type StorageLocation

type StorageLocation struct {
	Provider string `json:"provider"`
	Bucket   string `json:"bucket,omitempty"`
	Key      string `json:"key"`
	URL      string `json:"url,omitempty"`
	Region   string `json:"region,omitempty"`
}

Storage-related types

type StorageType

type StorageType string

StorageType represents different storage backends

const (
	StorageTypeS3    StorageType = "s3"
	StorageTypeGCS   StorageType = "gcs"
	StorageTypeLocal StorageType = "local"
)

type StorageUsage

type StorageUsage struct {
	TotalSize   int64              `json:"total_size"`
	TotalFiles  int64              `json:"total_files"`
	ByPlatform  map[Platform]int64 `json:"by_platform"`
	ByVersion   map[string]int64   `json:"by_version"`
	LastUpdated time.Time          `json:"last_updated"`
}

type TimePeriod

type TimePeriod struct {
	Start time.Time `json:"start"`
	End   time.Time `json:"end"`
}

type UpdateEvent

type UpdateEvent struct {
	EventID      string                 `json:"event_id"`
	Timestamp    time.Time              `json:"timestamp"`
	FromVersion  string                 `json:"from_version"`
	ToVersion    string                 `json:"to_version"`
	Platform     Platform               `json:"platform"`
	Architecture Architecture           `json:"architecture"`
	UpdateMethod string                 `json:"update_method"`
	Success      bool                   `json:"success"`
	ErrorMessage string                 `json:"error_message,omitempty"`
	Duration     time.Duration          `json:"duration"`
	Metadata     map[string]interface{} `json:"metadata"`
}

type UpdateServerConfig

type UpdateServerConfig struct {
	Enabled    bool   `json:"enabled"`
	BaseURL    string `json:"base_url"`
	Port       int    `json:"port"`
	TLSEnabled bool   `json:"tls_enabled"`
	CertFile   string `json:"cert_file"`
	KeyFile    string `json:"key_file"`
	RateLimit  int    `json:"rate_limit"`
}

UpdateServerConfig defines update server configuration

type UpdateVerifier

type UpdateVerifier interface {
	// Verification operations
	VerifyChecksum(ctx context.Context, artifact *BuildArtifact) error
	VerifySignature(ctx context.Context, artifact *BuildArtifact) error
	VerifyChain(ctx context.Context, artifact *BuildArtifact) error

	// Key management
	AddTrustedKey(ctx context.Context, key *PublicKey) error
	RemoveTrustedKey(ctx context.Context, keyID string) error
	ListTrustedKeys(ctx context.Context) ([]PublicKey, error)

	// Configuration
	GetVerificationConfig() VerificationConfig
	UpdateConfig(ctx context.Context, config VerificationConfig) error
}

UpdateVerifier interface for verifying updates

func NewUpdateVerifier

func NewUpdateVerifier(config VerificationConfig, logger Logger) UpdateVerifier

type UpdateVerifierImpl

type UpdateVerifierImpl struct {
	// contains filtered or unexported fields
}

UpdateVerifierImpl implements the UpdateVerifier interface

func (*UpdateVerifierImpl) AddTrustedKey

func (uv *UpdateVerifierImpl) AddTrustedKey(ctx context.Context, key *PublicKey) error

func (*UpdateVerifierImpl) GetVerificationConfig

func (uv *UpdateVerifierImpl) GetVerificationConfig() VerificationConfig

func (*UpdateVerifierImpl) ListTrustedKeys

func (uv *UpdateVerifierImpl) ListTrustedKeys(ctx context.Context) ([]PublicKey, error)

func (*UpdateVerifierImpl) RemoveTrustedKey

func (uv *UpdateVerifierImpl) RemoveTrustedKey(ctx context.Context, keyID string) error

func (*UpdateVerifierImpl) UpdateConfig

func (uv *UpdateVerifierImpl) UpdateConfig(ctx context.Context, config VerificationConfig) error

func (*UpdateVerifierImpl) VerifyChain

func (uv *UpdateVerifierImpl) VerifyChain(ctx context.Context, artifact *BuildArtifact) error

func (*UpdateVerifierImpl) VerifyChecksum

func (uv *UpdateVerifierImpl) VerifyChecksum(ctx context.Context, artifact *BuildArtifact) error

func (*UpdateVerifierImpl) VerifySignature

func (uv *UpdateVerifierImpl) VerifySignature(ctx context.Context, artifact *BuildArtifact) error

type UsageEvent

type UsageEvent struct {
	EventID      string                 `json:"event_id"`
	Timestamp    time.Time              `json:"timestamp"`
	Version      string                 `json:"version"`
	Command      string                 `json:"command"`
	Args         []string               `json:"args"`
	Duration     time.Duration          `json:"duration"`
	Success      bool                   `json:"success"`
	ErrorCode    string                 `json:"error_code,omitempty"`
	Platform     Platform               `json:"platform"`
	Architecture Architecture           `json:"architecture"`
	Metadata     map[string]interface{} `json:"metadata"`
}

type UsageStats

type UsageStats struct {
	TotalSessions  int64            `json:"total_sessions"`
	ActiveUsers    int64            `json:"active_users"`
	ByCommand      map[string]int64 `json:"by_command"`
	ByVersion      map[string]int64 `json:"by_version"`
	AverageSession time.Duration    `json:"average_session"`
	SuccessRate    float64          `json:"success_rate"`
	Period         TimePeriod       `json:"period"`
}

type ValidationError

type ValidationError struct {
	Field   string `json:"field"`
	Message string `json:"message"`
}

type VerificationConfig

type VerificationConfig struct {
	Required      bool     `json:"required"`
	ChecksumAlgo  string   `json:"checksum_algorithm"`
	SignatureAlgo string   `json:"signature_algorithm"`
	TrustedKeys   []string `json:"trusted_keys"`
	CertPinning   bool     `json:"cert_pinning"`
	PinnedCerts   []string `json:"pinned_certs"`
}

VerificationConfig defines update verification settings

type WingetManager

type WingetManager struct {
	// contains filtered or unexported fields
}

WingetManager implements PackageManager for Windows Package Manager

func (*WingetManager) CreatePackage

func (wm *WingetManager) CreatePackage(ctx context.Context, artifact *BuildArtifact, metadata PackageMetadata) (*Package, error)

func (*WingetManager) DeletePackage

func (wm *WingetManager) DeletePackage(ctx context.Context, packageName, version string) error

func (*WingetManager) GetPackageInfo

func (wm *WingetManager) GetPackageInfo(ctx context.Context, packageName string) (*PackageInfo, error)

func (*WingetManager) GetSupportedPlatforms

func (wm *WingetManager) GetSupportedPlatforms() []Platform

func (*WingetManager) GetType

func (wm *WingetManager) GetType() PackageManagerType

func (*WingetManager) IsAvailable

func (wm *WingetManager) IsAvailable() bool

func (*WingetManager) ListPackages

func (wm *WingetManager) ListPackages(ctx context.Context, filters PackageFilters) ([]PackageInfo, error)

func (*WingetManager) PublishToRepository

func (wm *WingetManager) PublishToRepository(ctx context.Context, pkg *Package) error

func (*WingetManager) UpdatePackage

func (wm *WingetManager) UpdatePackage(ctx context.Context, packageName string, artifact *BuildArtifact) error

func (*WingetManager) Validate

func (wm *WingetManager) Validate() error

Jump to

Keyboard shortcuts

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