Documentation
¶
Overview ¶
Package bundle provides functionality for importing and exporting bundles
Package bundle provides functionality for importing and exporting bundles ¶
Package bundle provides functionality for importing and exporting bundles ¶
Package bundle provides functionality for importing and exporting bundles ¶
Package bundle provides functionality for importing and exporting bundles ¶
Package bundle provides functionality for importing and exporting bundles ¶
Package bundle provides functionality for importing and exporting bundles ¶
The enhanced import reporting system extends the basic reporting system to provide more detailed information about import operations. It includes:
1. ImportStatistics: Detailed statistics about the import operation 2. SystemImpact: Assessment of the impact of the import on the system 3. EnhancedImportReport: Combines the basic ImportReport with additional details
This system is designed to be used by the import system to generate comprehensive reports about import operations, with varying levels of detail based on the specified ReportLevel (from report.go).
Package bundle provides functionality for importing and exporting bundles ¶
Package bundle provides functionality for importing and exporting bundles ¶
Package bundle provides functionality for importing and exporting bundles ¶
Package bundle provides functionality for importing and exporting bundles ¶
Package bundle provides functionality for importing and exporting bundles ¶
The reporting system in this package is designed to provide a flexible and extensible way to generate reports about bundle import operations. The system consists of several components:
1. ReportLevel: Defines the level of detail in a report (Basic, Detailed, Verbose) 2. ImportResult: Contains the result of an import operation 3. ImportReport: Wraps an ImportResult with additional metadata 4. ReportManager: Manages the creation and storage of reports 5. ReportGenerator: Generates reports from import results
The reporting system is designed to be used by the import system to generate reports about import operations, but it can also be used independently.
Package bundle provides functionality for importing and exporting bundles ¶
Package bundle provides functionality for importing and exporting bundles ¶
Package bundle provides functionality for importing and exporting bundles ¶
Package bundle provides functionality for importing and exporting bundles ¶
Package bundle provides functionality for importing and exporting bundles ¶
Package bundle provides functionality for importing and exporting bundles
Index ¶
- Constants
- func ApplyOperations(ctx *UpdateContext, ops []Operation) error
- func CalculateFileChecksum(filePath string) (string, error)
- func CompressDelta(deltaPath string, outputPath string) error
- func CreateBundleStructure(bundlePath string, structure *BundleStructure) error
- func ExtractBundle(bundlePath, outputDir string) error
- func GenerateKeyFromPassword(password string, salt []byte) ([]byte, error)
- func GenerateKeyPair() ([]byte, []byte, error)
- func GenerateManifestKeyPair() (ed25519.PublicKey, ed25519.PrivateKey, error)
- func GenerateRandomPassword(length int) (string, error)
- func GetCurrentTime() time.Time
- func GetRecommendations(result *CompatibilityResult) []string
- func HashPassword(password string) (string, error)
- func LoadSchemaFromFile(schemaPath string) (map[string]interface{}, error)
- func RollbackUpdate(ctx *UpdateContext, backup *Backup) error
- func SaveBundle(bundle *Bundle) error
- func SaveExampleManifest(outputPath string) error
- func SaveSignature(bundlePath string, sig *BundleSignature) error
- func SignBundle(bundle *Bundle, privateKey []byte) error
- func UpdateBundleChecksums(bundle *Bundle) error
- func VerifyPassword(password, encodedHash string) bool
- type AESGCMHandler
- func (h *AESGCMHandler) Decrypt(ciphertext []byte, password string) ([]byte, error)
- func (h *AESGCMHandler) DecryptStream(src io.Reader, dst io.Writer, password string) error
- func (h *AESGCMHandler) Encrypt(plaintext []byte, password string) ([]byte, error)
- func (h *AESGCMHandler) EncryptStream(src io.Reader, dst io.Writer, password string) error
- type AddOperation
- type AuthInfo
- type Author
- type Backup
- type BackupManager
- type BackupMetadata
- type BehaviorOptions
- type BreakingChange
- type Bundle
- type BundleChecksums
- type BundleCompressor
- type BundleConverter
- type BundleExporter
- type BundleImporter
- type BundleManifest
- type BundleProgressReporter
- func (bpr *BundleProgressReporter) Complete()
- func (bpr *BundleProgressReporter) CompleteWithError(err error)
- func (bpr *BundleProgressReporter) ReportBundleCreation(totalTemplates int)
- func (bpr *BundleProgressReporter) ReportBundleVerification(checks int)
- func (bpr *BundleProgressReporter) ReportCompression(originalSize, compressedSize int64)
- func (bpr *BundleProgressReporter) ReportEncryption(algorithm string)
- func (bpr *BundleProgressReporter) ReportFileImported(fileName string, status string)
- func (bpr *BundleProgressReporter) ReportImportProgress(totalFiles int)
- func (bpr *BundleProgressReporter) ReportSignature(keyID string)
- func (bpr *BundleProgressReporter) ReportTemplateProcessed(templateName string)
- func (bpr *BundleProgressReporter) ReportVerificationCheck(checkName string, passed bool)
- type BundleSignature
- type BundleStructure
- func (s *BundleStructure) GetDocumentationPath(bundlePath, docType string) string
- func (s *BundleStructure) GetModulePath(bundlePath, moduleID, moduleType string) string
- func (s *BundleStructure) GetModuleType(moduleType string) string
- func (s *BundleStructure) GetPublicKeyPath(bundlePath string) string
- func (s *BundleStructure) GetSignaturePath(bundlePath, filePath string) string
- func (s *BundleStructure) GetTemplateCategory(templateType string) string
- func (s *BundleStructure) GetTemplatePath(bundlePath, templateID, templateType string) string
- type BundleStructureValidator
- type BundleType
- type BundleValidator
- type ChaCha20Handler
- func (h *ChaCha20Handler) Decrypt(ciphertext []byte, password string) ([]byte, error)
- func (h *ChaCha20Handler) DecryptStream(src io.Reader, dst io.Writer, password string) error
- func (h *ChaCha20Handler) Encrypt(plaintext []byte, password string) ([]byte, error)
- func (h *ChaCha20Handler) EncryptStream(src io.Reader, dst io.Writer, password string) error
- type ChangelogEntry
- type Checksums
- type ComparisonSummary
- type Compatibility
- type CompatibilityChecker
- type CompatibilityConfig
- type CompatibilityIssue
- type CompatibilityResult
- type ComplianceMapping
- type CompressOptions
- type CompressionFactory
- type CompressionHandler
- type CompressionType
- type Conflict
- type ConflictDetector
- type ConflictResolution
- type ConflictResolutionStrategy
- type ConflictResolver
- type ConflictType
- type ContentChange
- type ContentItem
- type ContentManifest
- type ContentSanitizer
- type ContentTransformer
- type ContentType
- type CreateRequest
- type CustomizationBuilder
- func (b *CustomizationBuilder) Build() *ExportCustomization
- func (b *CustomizationBuilder) WithBehavior(configure func(*BehaviorOptions)) *CustomizationBuilder
- func (b *CustomizationBuilder) WithDependencies(configure func(*DependencyHandling)) *CustomizationBuilder
- func (b *CustomizationBuilder) WithEnvironment(configure func(*EnvironmentConfig)) *CustomizationBuilder
- func (b *CustomizationBuilder) WithFileFilters(configure func(*FileFilterOptions)) *CustomizationBuilder
- func (b *CustomizationBuilder) WithHotfix(configure func(*HotfixOptions)) *CustomizationBuilder
- func (b *CustomizationBuilder) WithModuleFilters(configure func(*ModuleFilterOptions)) *CustomizationBuilder
- func (b *CustomizationBuilder) WithScope(configure func(*ScopeOptions)) *CustomizationBuilder
- func (b *CustomizationBuilder) WithTemplateFilters(configure func(*TemplateFilterOptions)) *CustomizationBuilder
- func (b *CustomizationBuilder) WithTransformations(configure func(*TransformationOptions)) *CustomizationBuilder
- type DateRange
- type DecompressOptions
- type DefaultBackupManager
- func (m *DefaultBackupManager) CreateBackup(ctx context.Context, sourceDir, backupDir, description string, tags []string) (string, error)
- func (m *DefaultBackupManager) CreateBundleBackup(ctx context.Context, sourceDir, backupDir string, bundle *Bundle) (string, error)
- func (m *DefaultBackupManager) DeleteBackup(ctx context.Context, backupPath string) error
- func (m *DefaultBackupManager) GetBackupMetadata(ctx context.Context, backupPath string) (*BackupMetadata, error)
- func (m *DefaultBackupManager) ListBackups(ctx context.Context, backupDir string) ([]BackupMetadata, error)
- func (m *DefaultBackupManager) PruneBackups(ctx context.Context, backupDir string, keepCount int) (int, error)
- func (m *DefaultBackupManager) RestoreBackup(ctx context.Context, backupPath, targetDir string) error
- type DefaultBundleImporter
- func (i *DefaultBundleImporter) CreateBackup(ctx context.Context, targetDir, backupDir string) (string, error)
- func (i *DefaultBundleImporter) Import(ctx context.Context, bundlePath string, options ImportOptions) (*ImportResult, error)
- func (i *DefaultBundleImporter) RestoreBackup(ctx context.Context, backupPath, targetDir string) error
- func (i *DefaultBundleImporter) ValidateBeforeImport(ctx context.Context, bundlePath string, level ValidationLevel) (*ValidationResult, error)
- type DefaultBundleValidator
- func (v *DefaultBundleValidator) Validate(bundle *Bundle, level ValidationLevel) (*ValidationResult, error)
- func (v *DefaultBundleValidator) ValidateChecksums(bundle *Bundle) (*ValidationResult, error)
- func (v *DefaultBundleValidator) ValidateCompatibility(bundle *Bundle, currentVersions map[string]*version.SemVersion) (*ValidationResult, error)
- func (v *DefaultBundleValidator) ValidateManifest(manifest *BundleManifest) (*ValidationResult, error)
- func (v *DefaultBundleValidator) ValidateSignature(bundle *Bundle, publicKey ed25519.PublicKey) (*ValidationResult, error)
- type DefaultConflictDetector
- func (d *DefaultConflictDetector) DetectConflicts(ctx context.Context, bundle *Bundle, targetDir string) ([]*Conflict, error)
- func (d *DefaultConflictDetector) DetectContentConflicts(ctx context.Context, bundle *Bundle, targetDir string) ([]*Conflict, error)
- func (d *DefaultConflictDetector) DetectVersionConflicts(ctx context.Context, bundle *Bundle, targetDir string) ([]*Conflict, error)
- type DefaultConflictResolver
- func (r *DefaultConflictResolver) GetDefaultStrategy(conflictType ConflictType) ConflictResolutionStrategy
- func (r *DefaultConflictResolver) ResolveConflict(ctx context.Context, conflict *Conflict) (*ConflictResolution, error)
- func (r *DefaultConflictResolver) ResolveConflicts(ctx context.Context, conflicts []*Conflict) ([]*ConflictResolution, error)
- func (r *DefaultConflictResolver) SetDefaultStrategy(conflictType ConflictType, strategy ConflictResolutionStrategy)
- type DefaultImportReportingSystem
- func (r *DefaultImportReportingSystem) AddPerformanceMetric(bundleID string, metricName string, value interface{})
- func (r *DefaultImportReportingSystem) AssessSystemImpact(result *ImportResult) *SystemImpactAssessment
- func (r *DefaultImportReportingSystem) CreateReport(result *ImportResult, level ReportLevel) (*EnhancedImportReport, error)
- func (r *DefaultImportReportingSystem) GenerateStatistics(result *ImportResult) *ImportStatistics
- func (r *DefaultImportReportingSystem) GenerateUserFriendlySummary(report *EnhancedImportReport) string
- func (r *DefaultImportReportingSystem) GetLogEntries(bundleID string) []string
- func (r *DefaultImportReportingSystem) LogImportEvent(bundleID, event string, args ...interface{})
- func (r *DefaultImportReportingSystem) SaveReport(report *EnhancedImportReport, path string) error
- type DefaultReportGenerator
- func (g *DefaultReportGenerator) GenerateReport(result *ImportResult, level ReportLevel, format ReportFormat) (*ImportReport, error)
- func (g *DefaultReportGenerator) SaveReport(report *ImportReport, path string) error
- func (g *DefaultReportGenerator) WriteReport(report *ImportReport, writer io.Writer) error
- type DefaultReportManager
- func (m *DefaultReportManager) CreateImportReport(result *ImportResult, level ReportLevel, format ReportFormat) (*ImportReport, error)
- func (m *DefaultReportManager) GetReportPath(bundleID string, format ReportFormat) string
- func (m *DefaultReportManager) ListReports(dir string) ([]string, error)
- func (m *DefaultReportManager) SaveImportReport(report *ImportReport, path string) error
- type DefaultRollbackManager
- func (m *DefaultRollbackManager) CreateRollbackPoint(ctx context.Context, targetDir, backupDir, description string) (string, error)
- func (m *DefaultRollbackManager) DeleteRollbackPoint(ctx context.Context, rollbackPointPath string) error
- func (m *DefaultRollbackManager) ListRollbackPoints(ctx context.Context, backupDir string) ([]BackupMetadata, error)
- func (m *DefaultRollbackManager) Rollback(ctx context.Context, rollbackPointPath, targetDir string) error
- type DefaultStagedImporter
- type DeleteOperation
- type DeltaBundle
- type DeltaDependencies
- type DeltaManifest
- type DeltaOperations
- type DeltaSize
- type DependencyHandling
- type DependencyInfo
- type DependencyStrategy
- type DeprecatedFeature
- type DirectorySpec
- type DocumentationMetadataExtractor
- type EncryptionFactory
- type EncryptionHandler
- type EncryptionHeader
- type EncryptionOptions
- type EnhancedBundleManifest
- type EnhancedImportReport
- type EnhancedManifestGenerator
- type EntityInfo
- type EntitySearchCriteria
- type EntitySummary
- type Environment
- type EnvironmentConfig
- type EnvironmentRequirement
- type ExportCustomization
- type ExportFilters
- type ExportFormat
- type ExportOptions
- type ExportPreview
- type ExportProgressHandler
- type ExportRequest
- type ExportScope
- type FileBackup
- type FileFilterFunc
- type FileFilterOptions
- type FileHash
- type FileInfo
- type GzipHandler
- type HotfixOptions
- type ImportConflict
- type ImportOptions
- type ImportReport
- type ImportReportingSystem
- type ImportRequest
- type ImportResult
- type ImportStatistics
- type Info
- type InteractiveProgressTracker
- func (ipt *InteractiveProgressTracker) CompleteOperation(operation string, message string)
- func (ipt *InteractiveProgressTracker) FailOperation(operation string, err error)
- func (ipt *InteractiveProgressTracker) IncrementProgress(operation string)
- func (ipt *InteractiveProgressTracker) LogMessage(level, message string)
- func (ipt *InteractiveProgressTracker) StartOperation(operation string, total int, description string)
- func (ipt *InteractiveProgressTracker) Summary(stats map[string]interface{})
- func (ipt *InteractiveProgressTracker) UpdateProgress(operation string, current int)
- type Manager
- type ManifestChanges
- type ManifestComparison
- type ManifestFormat
- type ManifestGenerator
- func (g *ManifestGenerator) AddComplianceMapping(manifest *EnhancedBundleManifest, contentID string, ...) error
- func (g *ManifestGenerator) AddContentItem(manifest *BundleManifest, path string, contentType ContentType, ...)
- func (g *ManifestGenerator) AddContentItemToEnhancedManifest(manifest *EnhancedBundleManifest, path string, contentType ContentType, ...)
- func (g *ManifestGenerator) AddDocumentation(manifest *EnhancedBundleManifest, docType, path string)
- func (g *ManifestGenerator) GenerateEnhancedManifest(name, description, version string, bundleType BundleType) *EnhancedBundleManifest
- func (g *ManifestGenerator) GenerateIncrementalManifest(baseManifest *EnhancedBundleManifest, newVersion string, changes []string) *EnhancedBundleManifest
- func (g *ManifestGenerator) GenerateManifest(name, description, version string, bundleType BundleType) *BundleManifest
- func (g *ManifestGenerator) SignEnhancedManifest(manifest *EnhancedBundleManifest) error
- func (g *ManifestGenerator) SignManifest(manifest *BundleManifest) error
- func (g *ManifestGenerator) UpdateChecksums(manifest *BundleManifest, contentDir string) error
- func (g *ManifestGenerator) UpdateChecksumsForEnhancedManifest(manifest *EnhancedBundleManifest, contentDir string) error
- func (g *ManifestGenerator) WriteEnhancedManifest(manifest *EnhancedBundleManifest, filePath string) error
- func (g *ManifestGenerator) WriteManifest(manifest *BundleManifest, filePath string) error
- type ManifestOptions
- type MetadataEnricher
- type MetadataExtractor
- type ModuleFilterFunc
- type ModuleFilterOptions
- type ModuleInfo
- type ModuleMetadataExtractor
- type ModuleType
- type NoCompressionHandler
- type OfflineBundle
- func CreateIncrementalBundle(baseBundle *OfflineBundle, newManifest EnhancedBundleManifest, ...) (*OfflineBundle, error)
- func CreateOfflineBundle(manifest EnhancedBundleManifest, contentDir, outputPath string) (*OfflineBundle, error)
- func MergeIncrementalBundle(baseBundle, incrementalBundle *OfflineBundle, outputPath string) (*OfflineBundle, error)
- func OpenOfflineBundle(path string) (*OfflineBundle, error)
- func (b *OfflineBundle) AddChangelogEntry(version string, changes []string)
- func (b *OfflineBundle) AddComplianceMapping(mapping ComplianceMapping) error
- func (b *OfflineBundle) AddDocumentation(docType, path string)
- func (b *OfflineBundle) GetComplianceMappings() []ComplianceMapping
- func (b *OfflineBundle) GetDocumentationPath(docType string) (string, error)
- type OfflineBundleCreator
- func (c *OfflineBundleCreator) AddComplianceMappingToOfflineBundle(bundle *OfflineBundle, contentID string, owaspCategories, isoControls []string) error
- func (c *OfflineBundleCreator) AddContentToOfflineBundle(bundle *OfflineBundle, sourcePath, targetPath string, contentType ContentType, ...) error
- func (c *OfflineBundleCreator) AddDocumentationToOfflineBundle(bundle *OfflineBundle, docType, sourcePath string) error
- func (c *OfflineBundleCreator) CreateIncrementalBundle(baseBundle *OfflineBundle, newVersion string, changes []string, ...) (*OfflineBundle, error)
- func (c *OfflineBundleCreator) CreateOfflineBundle(name, description, version string, bundleType BundleType, outputPath string) (*OfflineBundle, error)
- func (c *OfflineBundleCreator) ExportOfflineBundle(bundle *OfflineBundle, outputPath string) error
- func (c *OfflineBundleCreator) LoadOfflineBundle(bundlePath string) (*OfflineBundle, error)
- func (c *OfflineBundleCreator) ValidateOfflineBundle(bundle *OfflineBundle, level ValidationLevel) (*ValidationResult, error)
- type OfflineBundleFormat
- type OfflineBundleValidator
- func (v *OfflineBundleValidator) Validate(bundle *OfflineBundle, level ValidationLevel) (*ValidationResult, error)
- func (v *OfflineBundleValidator) ValidateChecksums(bundle *OfflineBundle) (*ValidationResult, error)
- func (v *OfflineBundleValidator) ValidateCompatibility(bundle *OfflineBundle, currentVersions map[string]version.Version) (*ValidationResult, error)
- func (v *OfflineBundleValidator) ValidateComplianceMappings(bundle *OfflineBundle) (*ValidationResult, error)
- func (v *OfflineBundleValidator) ValidateDirectoryStructure(bundle *OfflineBundle) (*ValidationResult, error)
- func (v *OfflineBundleValidator) ValidateEnhancedManifest(manifest *EnhancedBundleManifest, level ValidationLevel) (*ValidationResult, error)
- func (v *OfflineBundleValidator) ValidateIncrementalBundle(bundle *OfflineBundle) (*ValidationResult, error)
- func (v *OfflineBundleValidator) ValidateOfflineBundle(bundle *OfflineBundle, level ValidationLevel) (*ValidationResult, error)
- func (v *OfflineBundleValidator) ValidateSignature(bundle *OfflineBundle, publicKey ed25519.PublicKey) (*ValidationResult, error)
- type Operation
- type OperationResult
- type PartialBundleExporter
- type PartialExportOptions
- type PasswordStrengthChecker
- type PatchOperation
- type Platform
- type ProgressCallback
- type ProgressEvent
- type ProgressHandler
- type ProgressInfo
- type ProgressReader
- type ProgressStage
- type ProgressTracker
- func (p *ProgressTracker) AddHandler(handler ProgressHandler)
- func (p *ProgressTracker) Close()
- func (p *ProgressTracker) Complete()
- func (p *ProgressTracker) Fail(err error)
- func (p *ProgressTracker) SetCurrentFile(file string)
- func (p *ProgressTracker) SetMetadata(key string, value interface{})
- func (p *ProgressTracker) SetStage(stage ProgressStage, operation string)
- func (p *ProgressTracker) SetTotal(bytes int64, items int)
- func (p *ProgressTracker) UpdateBytes(bytes int64)
- func (p *ProgressTracker) UpdateItems(count int)
- type ProgressWriter
- type ReportFormat
- type ReportGenerator
- type ReportLevel
- type ReportManager
- type Requirement
- type RevisionControlConfig
- type RollbackInfo
- type RollbackManager
- type SchemaValidator
- type ScopeOptions
- type ScriptFormat
- type SecretHandlingType
- type SignatureAlgorithm
- type SignatureManager
- type SignatureMetadata
- type Signer
- type SigningKey
- type SpinnerProgress
- type StagedImportOptions
- type StagedImportPhase
- type StagedImportStatus
- type StagedImporter
- type StandardBundleValidator
- func (v *StandardBundleValidator) Validate(bundle *Bundle, level ValidationLevel) (*ValidationResult, error)
- func (v *StandardBundleValidator) ValidateChecksums(bundle *Bundle) (*ValidationResult, error)
- func (v *StandardBundleValidator) ValidateCompatibility(bundle *Bundle, currentVersions map[string]version.Version) (*ValidationResult, error)
- func (v *StandardBundleValidator) ValidateManifest(manifest *BundleManifest) (*ValidationResult, error)
- func (v *StandardBundleValidator) ValidateSignature(bundle *Bundle, publicKey ed25519.PublicKey) (*ValidationResult, error)
- type SystemImpactAssessment
- type TemplateFilterFunc
- type TemplateFilterOptions
- type TemplateInfo
- type TemplateMetadataExtractor
- type TransformationOptions
- type UpdateContext
- type UpdateOperation
- type UpdatePlan
- type UpdateProgress
- type UpgradePath
- type ValidationLevel
- type ValidationResult
- func ValidateBundle(bundle Bundle, level ValidationLevel, publicKey ed25519.PublicKey) (*ValidationResult, error)
- func ValidateOfflineBundle(bundle *OfflineBundle, level ValidationLevel, publicKey ed25519.PublicKey) (*ValidationResult, error)
- func VerifyBundle(bundle *Bundle, publicKey []byte) (*ValidationResult, error)
- func VerifyBundleChecksums(bundle *Bundle) (*ValidationResult, error)
- type VerificationResult
- type Verifier
- type VersionRange
- type ZstdHandler
Constants ¶
const SignatureVersion = "1.0"
SignatureVersion defines the current signature format version
const StructureValidationLevel = "structure"
StructureValidationLevel is a constant for structure validation level
Variables ¶
This section is empty.
Functions ¶
func ApplyOperations ¶
func ApplyOperations(ctx *UpdateContext, ops []Operation) error
ApplyOperations applies update operations
func CalculateFileChecksum ¶
CalculateFileChecksum calculates the SHA-256 checksum of a file
func CompressDelta ¶
CompressDelta compresses a delta bundle
func CreateBundleStructure ¶
func CreateBundleStructure(bundlePath string, structure *BundleStructure) error
CreateBundleStructure creates the directory structure for a new bundle
func ExtractBundle ¶
ExtractBundle extracts a bundle to the given directory
func GenerateKeyFromPassword ¶
GenerateKeyFromPassword generates an encryption key from a password
func GenerateKeyPair ¶
GenerateKeyPair generates a new key pair for signing and verification
func GenerateManifestKeyPair ¶
func GenerateManifestKeyPair() (ed25519.PublicKey, ed25519.PrivateKey, error)
GenerateManifestKeyPair generates a new Ed25519 key pair for manifest signing
func GenerateRandomPassword ¶
GenerateRandomPassword generates a secure random password
func GetRecommendations ¶
func GetRecommendations(result *CompatibilityResult) []string
GetRecommendations provides recommendations based on compatibility issues
func HashPassword ¶
HashPassword creates a secure hash of a password for storage
func LoadSchemaFromFile ¶
LoadSchemaFromFile loads a JSON schema from a file
func RollbackUpdate ¶
func RollbackUpdate(ctx *UpdateContext, backup *Backup) error
RollbackUpdate rolls back an update using a backup
func SaveBundle ¶
SaveBundle saves a bundle to the specified path
func SaveExampleManifest ¶
SaveExampleManifest saves an example manifest to a file
func SaveSignature ¶
func SaveSignature(bundlePath string, sig *BundleSignature) error
SaveSignature saves a signature to the bundle
func SignBundle ¶
SignBundle signs a bundle using the provided private key
func UpdateBundleChecksums ¶
UpdateBundleChecksums updates all checksums in a bundle
func VerifyPassword ¶
VerifyPassword verifies a password against a hash
Types ¶
type AESGCMHandler ¶
type AESGCMHandler struct{}
AESGCMHandler handles AES-256-GCM encryption
func (*AESGCMHandler) Decrypt ¶
func (h *AESGCMHandler) Decrypt(ciphertext []byte, password string) ([]byte, error)
func (*AESGCMHandler) DecryptStream ¶
func (*AESGCMHandler) Encrypt ¶
func (h *AESGCMHandler) Encrypt(plaintext []byte, password string) ([]byte, error)
func (*AESGCMHandler) EncryptStream ¶
type AddOperation ¶
type AddOperation struct {
Path string `json:"path"`
Type string `json:"type"`
Size int64 `json:"size"`
Hash string `json:"hash"`
Mode uint32 `json:"mode,omitempty"`
}
AddOperation represents a file addition
type AuthInfo ¶
type AuthInfo struct {
Username string `json:"username"`
Password string `json:"password"`
Token string `json:"token"`
KeyFile string `json:"keyFile"`
}
AuthInfo contains authentication details
type Author ¶
type Author struct {
Name string `json:"name"`
Email string `json:"email"`
URL string `json:"url,omitempty"`
KeyID string `json:"key_id,omitempty"`
}
Author represents the author of a bundle
type Backup ¶
type Backup struct {
Version string `json:"version"`
Timestamp time.Time `json:"timestamp"`
Files map[string]FileBackup `json:"files"`
}
Backup represents a backup of files before update
func CreateBackup ¶
func CreateBackup(ctx *UpdateContext) (*Backup, error)
CreateBackup creates a backup of files that will be modified
type BackupManager ¶
type BackupManager interface {
// CreateBackup creates a backup of the specified directory
CreateBackup(ctx context.Context, sourceDir, backupDir, description string, tags []string) (string, error)
// CreateBundleBackup creates a backup before importing a bundle
CreateBundleBackup(ctx context.Context, sourceDir, backupDir string, bundle *Bundle) (string, error)
// RestoreBackup restores a backup to the specified directory
RestoreBackup(ctx context.Context, backupPath, targetDir string) error
// ListBackups lists all backups in the specified directory
ListBackups(ctx context.Context, backupDir string) ([]BackupMetadata, error)
// GetBackupMetadata gets the metadata for a backup
GetBackupMetadata(ctx context.Context, backupPath string) (*BackupMetadata, error)
// DeleteBackup deletes a backup
DeleteBackup(ctx context.Context, backupPath string) error
// PruneBackups deletes old backups, keeping the specified number of most recent backups
PruneBackups(ctx context.Context, backupDir string, keepCount int) (int, error)
}
BackupManager defines the interface for backup management
func NewBackupManager ¶
func NewBackupManager(logger io.Writer) BackupManager
NewBackupManager creates a new backup manager
type BackupMetadata ¶
type BackupMetadata struct {
// ID is the unique identifier for the backup
ID string `json:"id"`
// CreatedAt is the time the backup was created
CreatedAt time.Time `json:"created_at"`
// Description is a human-readable description of the backup
Description string `json:"description"`
// BundleID is the ID of the bundle that was being imported when the backup was created
BundleID string `json:"bundle_id,omitempty"`
// BundleName is the name of the bundle that was being imported when the backup was created
BundleName string `json:"bundle_name,omitempty"`
// BundleVersion is the version of the bundle that was being imported when the backup was created
BundleVersion string `json:"bundle_version,omitempty"`
// ContentPaths contains the paths of the content items in the backup
ContentPaths []string `json:"content_paths,omitempty"`
// Tags contains tags for the backup
Tags []string `json:"tags,omitempty"`
// AutoGenerated indicates whether the backup was automatically generated
AutoGenerated bool `json:"auto_generated"`
}
BackupMetadata contains metadata about a backup
type BehaviorOptions ¶
type BehaviorOptions struct {
ContinueOnError bool // Continue export on non-fatal errors
ValidateContent bool // Validate content before export
GenerateChecksums bool // Generate checksums for all files
CreateBackup bool // Create backup before export
DryRun bool // Perform dry run only
Verbose bool // Verbose output
ParallelExport bool // Use parallel processing
MaxParallelJobs int // Maximum parallel jobs
}
BehaviorOptions defines export behavior customization
type BreakingChange ¶
type BreakingChange struct {
Version string `json:"version"`
Description string `json:"description"`
MigrationGuide string `json:"migrationGuide"`
}
BreakingChange represents a breaking change
type Bundle ¶
type Bundle struct {
Manifest BundleManifest
BundlePath string
IsVerified bool
}
Bundle represents a bundle for import/export
func CreateBundle ¶
func CreateBundle(manifest BundleManifest, contentDir, outputPath string) (*Bundle, error)
CreateBundle creates a new bundle with the given manifest and content
func CreateEmptyBundle ¶
func CreateEmptyBundle(bundlePath string, schemaVersion string, bundleID string, bundleType BundleType, name string, description string, version string) (*Bundle, error)
CreateEmptyBundle creates a new empty bundle
func LoadBundle ¶
LoadBundle loads a bundle from the specified path
func OpenBundle ¶
OpenBundle opens a bundle from the given path
func (*Bundle) GetContentItem ¶
func (b *Bundle) GetContentItem(id string) *ContentItem
GetContentItem returns a content item by ID
func (*Bundle) GetContentItemsByType ¶
func (b *Bundle) GetContentItemsByType(contentType ContentType) []ContentItem
GetContentItemsByType returns content items by type
func (*Bundle) GetContentPath ¶
GetContentPath returns the path to a content item in the bundle
type BundleChecksums ¶
type BundleChecksums struct {
Algorithm string `json:"algorithm"`
Manifest string `json:"manifest,omitempty"`
Content map[string]string `json:"content"`
}
BundleChecksums is an alias for Checksums for compatibility
type BundleCompressor ¶
type BundleCompressor struct {
// contains filtered or unexported fields
}
BundleCompressor handles bundle compression and encryption
func NewBundleCompressor ¶
func NewBundleCompressor() *BundleCompressor
NewBundleCompressor creates a new bundle compressor
func (*BundleCompressor) CompressBundle ¶
func (c *BundleCompressor) CompressBundle(bundlePath string, outputPath string, options CompressOptions) error
CompressBundle compresses a bundle directory
func (*BundleCompressor) DecompressBundle ¶
func (c *BundleCompressor) DecompressBundle(archivePath string, outputPath string, options DecompressOptions) error
DecompressBundle decompresses a bundle
type BundleConverter ¶
type BundleConverter struct {
// Creator is the offline bundle creator
Creator *OfflineBundleCreator
// Logger is the logger for conversion operations
Logger io.Writer
// AuditTrail is the audit trail manager for logging operations
AuditTrail *trail.AuditTrailManager
}
BundleConverter converts standard bundles to offline bundles
func NewBundleConverter ¶
func NewBundleConverter(creator *OfflineBundleCreator, logger io.Writer, auditTrail *trail.AuditTrailManager) *BundleConverter
NewBundleConverter creates a new bundle converter
func (*BundleConverter) AutoDetectComplianceForTemplates ¶
func (c *BundleConverter) AutoDetectComplianceForTemplates(offlineBundle *OfflineBundle) error
AutoDetectComplianceForTemplates automatically detects and adds compliance mappings for templates
func (*BundleConverter) ConvertToOfflineBundle ¶
func (c *BundleConverter) ConvertToOfflineBundle(bundle *Bundle, outputPath string) (*OfflineBundle, error)
ConvertToOfflineBundle converts a standard bundle to an offline bundle
type BundleExporter ¶
type BundleExporter struct {
// contains filtered or unexported fields
}
BundleExporter handles bundle export operations
func NewBundleExporter ¶
func NewBundleExporter(options ExportOptions) *BundleExporter
NewBundleExporter creates a new bundle exporter
func (*BundleExporter) Export ¶
func (e *BundleExporter) Export() error
Export creates a bundle with the specified options
type BundleImporter ¶
type BundleImporter interface {
// Import imports a bundle with the specified options
Import(context.Context, string, ImportOptions) (*ImportResult, error)
// ValidateBeforeImport validates a bundle before importing
ValidateBeforeImport(context.Context, string, ValidationLevel) (*ValidationResult, error)
// CreateBackup creates a backup of the target directory
CreateBackup(context.Context, string, string) (string, error)
// RestoreBackup restores a backup
RestoreBackup(context.Context, string, string) error
}
BundleImporter defines the interface for bundle import
func NewBundleImporter ¶
func NewBundleImporter(validator BundleValidator, reportManager ReportManager, logger io.Writer) BundleImporter
NewBundleImporter creates a new bundle importer
type BundleManifest ¶
type BundleManifest struct {
SchemaVersion string `json:"schema_version"`
ManifestVersion string `json:"manifest_version,omitempty"`
BundleID string `json:"bundle_id"`
BundleType BundleType `json:"bundle_type"`
Name string `json:"name"`
Description string `json:"description"`
Version string `json:"version"`
BundleVersion string `json:"bundle_version,omitempty"`
CreatedAt time.Time `json:"created_at"`
Author Author `json:"author"`
Content []ContentItem `json:"content"`
Checksums Checksums `json:"checksums"`
Compatibility Compatibility `json:"compatibility"`
Signature string `json:"signature,omitempty"`
Dependencies map[string][]string `json:"dependencies,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
BundleManifest represents the manifest of a bundle
func CreateBundleManifest ¶
func CreateBundleManifest(name, description, version string, bundleType BundleType, author Author) BundleManifest
CreateBundleManifest creates a new bundle manifest
func GenerateExampleManifest ¶
func GenerateExampleManifest() *BundleManifest
GenerateExampleManifest generates an example manifest based on the schema
func (*BundleManifest) AddContentItem ¶
func (m *BundleManifest) AddContentItem(path string, contentType ContentType, id, version, description string)
AddContentItem adds a content item to the manifest
type BundleProgressReporter ¶
type BundleProgressReporter struct {
// contains filtered or unexported fields
}
BundleProgressReporter provides specialized progress reporting for bundle operations
func NewBundleProgressReporter ¶
func NewBundleProgressReporter(writer io.Writer, verbose bool) *BundleProgressReporter
NewBundleProgressReporter creates a new bundle progress reporter
func (*BundleProgressReporter) Complete ¶
func (bpr *BundleProgressReporter) Complete()
Complete marks all operations as complete and shows summary
func (*BundleProgressReporter) CompleteWithError ¶
func (bpr *BundleProgressReporter) CompleteWithError(err error)
CompleteWithError marks operations as failed
func (*BundleProgressReporter) ReportBundleCreation ¶
func (bpr *BundleProgressReporter) ReportBundleCreation(totalTemplates int)
ReportBundleCreation reports progress for bundle creation
func (*BundleProgressReporter) ReportBundleVerification ¶
func (bpr *BundleProgressReporter) ReportBundleVerification(checks int)
ReportBundleVerification reports progress for bundle verification
func (*BundleProgressReporter) ReportCompression ¶
func (bpr *BundleProgressReporter) ReportCompression(originalSize, compressedSize int64)
ReportCompression reports compression progress
func (*BundleProgressReporter) ReportEncryption ¶
func (bpr *BundleProgressReporter) ReportEncryption(algorithm string)
ReportEncryption reports encryption status
func (*BundleProgressReporter) ReportFileImported ¶
func (bpr *BundleProgressReporter) ReportFileImported(fileName string, status string)
ReportFileImported reports a file has been imported
func (*BundleProgressReporter) ReportImportProgress ¶
func (bpr *BundleProgressReporter) ReportImportProgress(totalFiles int)
ReportImportProgress reports progress for bundle import
func (*BundleProgressReporter) ReportSignature ¶
func (bpr *BundleProgressReporter) ReportSignature(keyID string)
ReportSignature reports signature status
func (*BundleProgressReporter) ReportTemplateProcessed ¶
func (bpr *BundleProgressReporter) ReportTemplateProcessed(templateName string)
ReportTemplateProcessed reports a template has been processed
func (*BundleProgressReporter) ReportVerificationCheck ¶
func (bpr *BundleProgressReporter) ReportVerificationCheck(checkName string, passed bool)
ReportVerificationCheck reports a verification check completed
type BundleSignature ¶
type BundleSignature struct {
Version string `json:"version"`
Algorithm string `json:"algorithm"`
KeyID string `json:"keyId"`
Timestamp time.Time `json:"timestamp"`
ContentHash string `json:"contentHash"`
Signature string `json:"signature"`
Metadata SignatureMetadata `json:"metadata"`
}
BundleSignature represents a digital signature for a bundle
func LoadSignature ¶
func LoadSignature(bundlePath string) (*BundleSignature, error)
LoadSignature loads a signature from the bundle
type BundleStructure ¶
type BundleStructure struct {
// RootDirectories defines the directories that should exist in the bundle root
RootDirectories map[string]DirectorySpec
// FileNamingRules defines the rules for naming files in the bundle
FileNamingRules map[string][]string
// TemplateCategories defines the standard categories for organizing templates
TemplateCategories []string
// ModuleTypes defines the standard types for organizing modules
ModuleTypes []string
}
BundleStructure defines the structure of an offline bundle
func DefaultBundleStructure ¶
func DefaultBundleStructure() *BundleStructure
DefaultBundleStructure returns the default bundle structure specification
func (*BundleStructure) GetDocumentationPath ¶
func (s *BundleStructure) GetDocumentationPath(bundlePath, docType string) string
GetDocumentationPath returns the path for a documentation file within the bundle
func (*BundleStructure) GetModulePath ¶
func (s *BundleStructure) GetModulePath(bundlePath, moduleID, moduleType string) string
GetModulePath returns the path for a module within the bundle
func (*BundleStructure) GetModuleType ¶
func (s *BundleStructure) GetModuleType(moduleType string) string
GetModuleType returns the appropriate type for a module
func (*BundleStructure) GetPublicKeyPath ¶
func (s *BundleStructure) GetPublicKeyPath(bundlePath string) string
GetPublicKeyPath returns the path for the public key file within the bundle
func (*BundleStructure) GetSignaturePath ¶
func (s *BundleStructure) GetSignaturePath(bundlePath, filePath string) string
GetSignaturePath returns the path for a signature file within the bundle
func (*BundleStructure) GetTemplateCategory ¶
func (s *BundleStructure) GetTemplateCategory(templateType string) string
GetTemplateCategory returns the appropriate category for a template
func (*BundleStructure) GetTemplatePath ¶
func (s *BundleStructure) GetTemplatePath(bundlePath, templateID, templateType string) string
GetTemplatePath returns the path for a template within the bundle
type BundleStructureValidator ¶
type BundleStructureValidator struct {
// Structure is the bundle structure specification
Structure *BundleStructure
}
BundleStructureValidator validates the structure of a bundle
func NewBundleStructureValidator ¶
func NewBundleStructureValidator() *BundleStructureValidator
NewBundleStructureValidator creates a new bundle structure validator
func (*BundleStructureValidator) ValidateStructure ¶
func (v *BundleStructureValidator) ValidateStructure(bundlePath string) (*ValidationResult, error)
ValidateStructure validates the structure of a bundle
type BundleType ¶
type BundleType string
BundleType represents the type of bundle
const ( // TemplateBundleType represents a bundle containing templates TemplateBundleType BundleType = "templates" // ModuleBundleType represents a bundle containing modules ModuleBundleType BundleType = "modules" // MixedBundleType represents a bundle containing both templates and modules MixedBundleType BundleType = "mixed" )
type BundleValidator ¶
type BundleValidator interface {
// Validate validates a bundle with the specified validation level
Validate(bundle *Bundle, level ValidationLevel) (*ValidationResult, error)
// ValidateManifest validates a bundle manifest
ValidateManifest(manifest *BundleManifest) (*ValidationResult, error)
// ValidateSignature validates a bundle signature
ValidateSignature(bundle *Bundle, publicKey ed25519.PublicKey) (*ValidationResult, error)
// ValidateChecksums validates bundle checksums
ValidateChecksums(bundle *Bundle) (*ValidationResult, error)
// ValidateCompatibility validates bundle compatibility with current versions
ValidateCompatibility(bundle *Bundle, currentVersions map[string]*version.SemVersion) (*ValidationResult, error)
}
BundleValidator defines the interface for bundle validation
func NewBundleValidator ¶
func NewBundleValidator(logger io.Writer) BundleValidator
NewBundleValidator creates a new bundle validator
type ChaCha20Handler ¶
type ChaCha20Handler struct{}
ChaCha20Handler handles ChaCha20-Poly1305 encryption
func (*ChaCha20Handler) Decrypt ¶
func (h *ChaCha20Handler) Decrypt(ciphertext []byte, password string) ([]byte, error)
func (*ChaCha20Handler) DecryptStream ¶
func (*ChaCha20Handler) Encrypt ¶
func (h *ChaCha20Handler) Encrypt(plaintext []byte, password string) ([]byte, error)
func (*ChaCha20Handler) EncryptStream ¶
type ChangelogEntry ¶
type ChangelogEntry struct {
// Version is the version associated with this changelog entry
Version string `json:"version"`
// Date is when the version was released
Date time.Time `json:"date"`
// Changes is a list of changes in this version
Changes []string `json:"changes"`
}
ChangelogEntry represents an entry in the changelog
type Checksums ¶
type Checksums struct {
Manifest string `json:"manifest"`
Content map[string]string `json:"content"`
}
Checksums contains checksums for bundle components
type ComparisonSummary ¶
type ComparisonSummary struct {
TotalChanges int `json:"totalChanges"`
AddedCount int `json:"addedCount"`
RemovedCount int `json:"removedCount"`
ModifiedCount int `json:"modifiedCount"`
}
ComparisonSummary provides a summary of changes
type Compatibility ¶
type Compatibility struct {
MinVersion string `json:"min_version"`
MaxVersion string `json:"max_version,omitempty"`
Dependencies []string `json:"dependencies,omitempty"`
Incompatible []string `json:"incompatible,omitempty"`
}
Compatibility represents compatibility information for a bundle
type CompatibilityChecker ¶
type CompatibilityChecker struct {
// contains filtered or unexported fields
}
CompatibilityChecker performs compatibility verification
func NewCompatibilityChecker ¶
func NewCompatibilityChecker(current, target string, env *Environment, config *CompatibilityConfig) (*CompatibilityChecker, error)
NewCompatibilityChecker creates a new compatibility checker
func (*CompatibilityChecker) ApplyOverrides ¶
func (c *CompatibilityChecker) ApplyOverrides(overrides map[string]bool)
ApplyOverrides applies compatibility overrides
func (*CompatibilityChecker) VerifyCompatibility ¶
func (c *CompatibilityChecker) VerifyCompatibility() (*CompatibilityResult, error)
VerifyCompatibility performs all compatibility checks
type CompatibilityConfig ¶
type CompatibilityConfig struct {
EnforceStrict bool `json:"enforceStrict"`
AllowDowngrade bool `json:"allowDowngrade"`
AllowPrerelease bool `json:"allowPrerelease"`
CheckVersion bool `json:"checkVersion"`
CheckComponents bool `json:"checkComponents"`
CheckEnvironment bool `json:"checkEnvironment"`
UpgradePaths []UpgradePath `json:"upgradePaths"`
ComponentRequirements map[string]Requirement `json:"componentRequirements"`
EnvironmentReqs EnvironmentRequirement `json:"environmentRequirements"`
}
CompatibilityConfig defines compatibility checking configuration
func DefaultCompatibilityConfig ¶
func DefaultCompatibilityConfig() *CompatibilityConfig
DefaultCompatibilityConfig returns the default compatibility configuration
type CompatibilityIssue ¶
type CompatibilityIssue struct {
Type string `json:"type"`
Severity string `json:"severity"` // error, warning, info
Message string `json:"message"`
Component string `json:"component,omitempty"`
Action string `json:"action,omitempty"`
CanOverride bool `json:"canOverride"`
}
CompatibilityIssue represents a compatibility problem
type CompatibilityResult ¶
type CompatibilityResult struct {
Compatible bool `json:"compatible"`
Issues []CompatibilityIssue `json:"issues"`
Warnings []string `json:"warnings"`
Metadata map[string]interface{} `json:"metadata"`
}
CompatibilityResult contains the result of compatibility checks
type ComplianceMapping ¶
type ComplianceMapping struct {
// ContentID is the ID of the content item
ContentID string `json:"content_id"`
// OwaspLLMCategories lists the OWASP LLM Top 10 categories this item addresses
OwaspLLMCategories []string `json:"owasp_llm_categories,omitempty"`
// ISOIECControls lists the ISO/IEC 42001 controls this item addresses
ISOIECControls []string `json:"iso_iec_controls,omitempty"`
// Description provides additional context about the compliance mapping
Description string `json:"description,omitempty"`
}
ComplianceMapping represents a mapping between content items and compliance frameworks
type CompressOptions ¶
type CompressOptions struct {
Format ExportFormat
Compression CompressionType
Encryption *EncryptionOptions
Level int // Compression level
}
CompressOptions defines options for compression
type CompressionFactory ¶
type CompressionFactory struct {
// contains filtered or unexported fields
}
CompressionFactory creates compression handlers
func NewCompressionFactory ¶
func NewCompressionFactory() *CompressionFactory
NewCompressionFactory creates a new compression factory
func (*CompressionFactory) GetHandler ¶
func (f *CompressionFactory) GetHandler(compressionType CompressionType) (CompressionHandler, error)
GetHandler returns a compression handler for the given type
func (*CompressionFactory) RegisterHandler ¶
func (f *CompressionFactory) RegisterHandler(compressionType CompressionType, handler CompressionHandler)
RegisterHandler registers a compression handler
type CompressionHandler ¶
type CompressionHandler interface {
Compress(src io.Reader, dst io.Writer) error
Decompress(src io.Reader, dst io.Writer) error
GetExtension() string
}
CompressionHandler handles various compression algorithms
type CompressionType ¶
type CompressionType string
CompressionType defines compression options
const ( CompressionNone CompressionType = "none" CompressionGzip CompressionType = "gzip" CompressionZstd CompressionType = "zstd" CompressionBrotli CompressionType = "brotli" )
type Conflict ¶
type Conflict struct {
// Type is the type of conflict
Type ConflictType
// Path is the path of the conflicting item
Path string
// SourcePath is the path of the source item
SourcePath string
// TargetPath is the path of the target item
TargetPath string
// ContentItem is the content item from the bundle manifest
ContentItem *ContentItem
// Message is a human-readable message about the conflict
Message string
// ResolutionStrategy is the strategy for resolving the conflict
ResolutionStrategy ConflictResolutionStrategy
// ResolutionPath is the path where the item was resolved (if applicable)
ResolutionPath string
// Resolved indicates whether the conflict has been resolved
Resolved bool
}
Conflict represents a conflict during bundle import
type ConflictDetector ¶
type ConflictDetector interface {
// DetectConflicts detects conflicts between the bundle and the target directory
DetectConflicts(ctx context.Context, bundle *Bundle, targetDir string) ([]*Conflict, error)
// DetectContentConflicts detects content conflicts between the bundle and the target directory
DetectContentConflicts(ctx context.Context, bundle *Bundle, targetDir string) ([]*Conflict, error)
// DetectVersionConflicts detects version conflicts between the bundle and the target directory
DetectVersionConflicts(ctx context.Context, bundle *Bundle, targetDir string) ([]*Conflict, error)
}
ConflictDetector defines the interface for conflict detection
func NewConflictDetector ¶
func NewConflictDetector(logger io.Writer) ConflictDetector
NewConflictDetector creates a new conflict detector
type ConflictResolution ¶
type ConflictResolution struct {
// Conflict is the conflict being resolved
Conflict *Conflict
// Strategy is the strategy used to resolve the conflict
Strategy ConflictResolutionStrategy
// Path is the path where the item was resolved (if applicable)
Path string
// Success indicates whether the resolution was successful
Success bool
// Error is the error that occurred during resolution (if any)
Error error
}
ConflictResolution represents a resolution for a conflict
type ConflictResolutionStrategy ¶
type ConflictResolutionStrategy string
ConflictResolutionStrategy represents a strategy for resolving conflicts
const ( // SkipStrategy represents a strategy to skip conflicting items SkipStrategy ConflictResolutionStrategy = "skip" // OverwriteStrategy represents a strategy to overwrite conflicting items OverwriteStrategy ConflictResolutionStrategy = "overwrite" // MergeStrategy represents a strategy to merge conflicting items MergeStrategy ConflictResolutionStrategy = "merge" // RenameStrategy represents a strategy to rename conflicting items RenameStrategy ConflictResolutionStrategy = "rename" // KeepBothStrategy represents a strategy to keep both conflicting items KeepBothStrategy ConflictResolutionStrategy = "keep_both" // PromptStrategy represents a strategy to prompt the user for resolution PromptStrategy ConflictResolutionStrategy = "prompt" )
type ConflictResolver ¶
type ConflictResolver interface {
// ResolveConflict resolves a single conflict
ResolveConflict(ctx context.Context, conflict *Conflict) (*ConflictResolution, error)
// ResolveConflicts resolves multiple conflicts
ResolveConflicts(ctx context.Context, conflicts []*Conflict) ([]*ConflictResolution, error)
// GetDefaultStrategy gets the default resolution strategy for a conflict type
GetDefaultStrategy(conflictType ConflictType) ConflictResolutionStrategy
// SetDefaultStrategy sets the default resolution strategy for a conflict type
SetDefaultStrategy(conflictType ConflictType, strategy ConflictResolutionStrategy)
}
ConflictResolver defines the interface for conflict resolution
func NewConflictResolver ¶
func NewConflictResolver(logger io.Writer, auditLogger *errors.AuditLogger, promptCallback func(conflict *Conflict) (ConflictResolutionStrategy, error)) ConflictResolver
NewConflictResolver creates a new conflict resolver
type ConflictType ¶
type ConflictType string
ConflictType represents the type of conflict
const ( // FileExistsConflict represents a conflict where a file already exists FileExistsConflict ConflictType = "file_exists" // ContentConflict represents a conflict where file content differs ContentConflict ConflictType = "content_conflict" // VersionConflict represents a conflict where versions differ VersionConflict ConflictType = "version_conflict" // DependencyConflict represents a conflict where dependencies differ DependencyConflict ConflictType = "dependency_conflict" // PermissionConflict represents a conflict where permissions differ PermissionConflict ConflictType = "permission_conflict" )
type ContentChange ¶
type ContentChange struct {
Path string `json:"path"`
Type ContentType `json:"type"`
Size int64 `json:"size,omitempty"`
OldChecksum string `json:"oldChecksum,omitempty"`
NewChecksum string `json:"newChecksum,omitempty"`
SizeDelta int64 `json:"sizeDelta,omitempty"`
}
ContentChange represents a change to content
type ContentItem ¶
type ContentItem struct {
Path string `json:"path"`
Type ContentType `json:"type"`
ID string `json:"id,omitempty"`
Version string `json:"version,omitempty"`
Description string `json:"description,omitempty"`
Checksum string `json:"checksum"`
// BundleID is the ID of the bundle this item belongs to
BundleID string `json:"bundle_id,omitempty"`
// Metadata stores additional metadata for the item
Metadata map[string]interface{} `json:"metadata,omitempty"`
// Size is the file size in bytes
Size int64 `json:"size,omitempty"`
}
ContentItem represents an item in a bundle
type ContentManifest ¶
type ContentManifest struct {
Files []FileHash `json:"files"`
}
ContentManifest represents the content to be signed
type ContentSanitizer ¶
type ContentSanitizer interface {
Sanitize(path string, content []byte) ([]byte, error)
ShouldSanitize(path string) bool
}
ContentSanitizer sanitizes content
type ContentTransformer ¶
type ContentTransformer interface {
Transform(path string, content []byte) ([]byte, error)
ShouldTransform(path string) bool
}
ContentTransformer transforms file content
type ContentType ¶
type ContentType string
ContentType represents the type of content in a bundle
const ( // TemplateContentType represents template content TemplateContentType ContentType = "template" // ModuleContentType represents module content ModuleContentType ContentType = "module" // ConfigContentType represents configuration content ConfigContentType ContentType = "config" // ResourceContentType represents resource content (e.g., images, data files) ResourceContentType ContentType = "resource" )
type CreateRequest ¶
type CreateRequest struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Templates []string `json:"templates,omitempty"`
Categories []string `json:"categories,omitempty"`
Modules []string `json:"modules,omitempty"`
}
CreateRequest represents a request to create a bundle
type CustomizationBuilder ¶
type CustomizationBuilder struct {
// contains filtered or unexported fields
}
CustomizationBuilder provides a fluent API for building customizations
func NewCustomizationBuilder ¶
func NewCustomizationBuilder() *CustomizationBuilder
NewCustomizationBuilder creates a new customization builder
func (*CustomizationBuilder) Build ¶
func (b *CustomizationBuilder) Build() *ExportCustomization
Build returns the configured customization
func (*CustomizationBuilder) WithBehavior ¶
func (b *CustomizationBuilder) WithBehavior(configure func(*BehaviorOptions)) *CustomizationBuilder
WithBehavior configures behavior options
func (*CustomizationBuilder) WithDependencies ¶
func (b *CustomizationBuilder) WithDependencies(configure func(*DependencyHandling)) *CustomizationBuilder
WithDependencies configures dependency handling
func (*CustomizationBuilder) WithEnvironment ¶
func (b *CustomizationBuilder) WithEnvironment(configure func(*EnvironmentConfig)) *CustomizationBuilder
WithEnvironment configures environment options
func (*CustomizationBuilder) WithFileFilters ¶
func (b *CustomizationBuilder) WithFileFilters(configure func(*FileFilterOptions)) *CustomizationBuilder
WithFileFilters configures file filters
func (*CustomizationBuilder) WithHotfix ¶
func (b *CustomizationBuilder) WithHotfix(configure func(*HotfixOptions)) *CustomizationBuilder
WithHotfix configures hotfix options
func (*CustomizationBuilder) WithModuleFilters ¶
func (b *CustomizationBuilder) WithModuleFilters(configure func(*ModuleFilterOptions)) *CustomizationBuilder
WithModuleFilters configures module filters
func (*CustomizationBuilder) WithScope ¶
func (b *CustomizationBuilder) WithScope(configure func(*ScopeOptions)) *CustomizationBuilder
WithScope configures scope options
func (*CustomizationBuilder) WithTemplateFilters ¶
func (b *CustomizationBuilder) WithTemplateFilters(configure func(*TemplateFilterOptions)) *CustomizationBuilder
WithTemplateFilters configures template filters
func (*CustomizationBuilder) WithTransformations ¶
func (b *CustomizationBuilder) WithTransformations(configure func(*TransformationOptions)) *CustomizationBuilder
WithTransformations configures transformations
type DecompressOptions ¶
type DecompressOptions struct {
Password string
Validate bool // Validate checksums after decompression
}
DecompressOptions defines options for decompression
type DefaultBackupManager ¶
DefaultBackupManager is the default implementation of BackupManager
func (*DefaultBackupManager) CreateBackup ¶
func (m *DefaultBackupManager) CreateBackup(ctx context.Context, sourceDir, backupDir, description string, tags []string) (string, error)
CreateBackup creates a backup of the specified directory
func (*DefaultBackupManager) CreateBundleBackup ¶
func (m *DefaultBackupManager) CreateBundleBackup(ctx context.Context, sourceDir, backupDir string, bundle *Bundle) (string, error)
CreateBundleBackup creates a backup before importing a bundle
func (*DefaultBackupManager) DeleteBackup ¶
func (m *DefaultBackupManager) DeleteBackup(ctx context.Context, backupPath string) error
DeleteBackup deletes a backup
func (*DefaultBackupManager) GetBackupMetadata ¶
func (m *DefaultBackupManager) GetBackupMetadata(ctx context.Context, backupPath string) (*BackupMetadata, error)
GetBackupMetadata gets the metadata for a backup
func (*DefaultBackupManager) ListBackups ¶
func (m *DefaultBackupManager) ListBackups(ctx context.Context, backupDir string) ([]BackupMetadata, error)
ListBackups lists all backups in the specified directory
func (*DefaultBackupManager) PruneBackups ¶
func (m *DefaultBackupManager) PruneBackups(ctx context.Context, backupDir string, keepCount int) (int, error)
PruneBackups deletes old backups, keeping the specified number of most recent backups
func (*DefaultBackupManager) RestoreBackup ¶
func (m *DefaultBackupManager) RestoreBackup(ctx context.Context, backupPath, targetDir string) error
RestoreBackup restores a backup to the specified directory
type DefaultBundleImporter ¶
type DefaultBundleImporter struct {
// Validator is the validator for bundle validation
Validator BundleValidator
// ReportManager is the report manager for generating reports
ReportManager ReportManager
// ReportingSystem is the reporting system for generating reports
ReportingSystem ImportReportingSystem
// Logger is the logger for import operations
Logger io.Writer
// AuditLogger is the logger for audit events
AuditLogger *errors.AuditLogger
// ErrorHandler is the error handler for import operations
ErrorHandler errors.ErrorHandler
// EnhancedErrorHandler is the enhanced error handler for advanced error handling
EnhancedErrorHandler *errors.EnhancedErrorHandler
// RecoveryManager is the recovery manager for error recovery
RecoveryManager *errors.RecoveryManager
// ErrorReporter is the error reporter for error reporting
ErrorReporter errors.ErrorReporter
// CollectedErrors tracks errors that occurred during import
CollectedErrors []*errors.BundleError
}
DefaultBundleImporter is the default implementation of BundleImporter
func (*DefaultBundleImporter) CreateBackup ¶
func (i *DefaultBundleImporter) CreateBackup(ctx context.Context, targetDir, backupDir string) (string, error)
CreateBackup creates a backup of the target directory
func (*DefaultBundleImporter) Import ¶
func (i *DefaultBundleImporter) Import(ctx context.Context, bundlePath string, options ImportOptions) (*ImportResult, error)
Import imports a bundle with the specified options
func (*DefaultBundleImporter) RestoreBackup ¶
func (i *DefaultBundleImporter) RestoreBackup(ctx context.Context, backupPath, targetDir string) error
RestoreBackup restores a backup
func (*DefaultBundleImporter) ValidateBeforeImport ¶
func (i *DefaultBundleImporter) ValidateBeforeImport(ctx context.Context, bundlePath string, level ValidationLevel) (*ValidationResult, error)
ValidateBeforeImport validates a bundle before importing
type DefaultBundleValidator ¶
type DefaultBundleValidator struct {
// Logger is the logger for validation operations
Logger io.Writer
}
DefaultBundleValidator is the default implementation of BundleValidator
func (*DefaultBundleValidator) Validate ¶
func (v *DefaultBundleValidator) Validate(bundle *Bundle, level ValidationLevel) (*ValidationResult, error)
Validate validates a bundle with the specified validation level
func (*DefaultBundleValidator) ValidateChecksums ¶
func (v *DefaultBundleValidator) ValidateChecksums(bundle *Bundle) (*ValidationResult, error)
ValidateChecksums validates bundle checksums
func (*DefaultBundleValidator) ValidateCompatibility ¶
func (v *DefaultBundleValidator) ValidateCompatibility(bundle *Bundle, currentVersions map[string]*version.SemVersion) (*ValidationResult, error)
ValidateCompatibility validates bundle compatibility with current versions
func (*DefaultBundleValidator) ValidateManifest ¶
func (v *DefaultBundleValidator) ValidateManifest(manifest *BundleManifest) (*ValidationResult, error)
ValidateManifest validates a bundle manifest
func (*DefaultBundleValidator) ValidateSignature ¶
func (v *DefaultBundleValidator) ValidateSignature(bundle *Bundle, publicKey ed25519.PublicKey) (*ValidationResult, error)
ValidateSignature validates a bundle signature
type DefaultConflictDetector ¶
type DefaultConflictDetector struct {
// Logger is the logger for conflict detection operations
Logger io.Writer
}
DefaultConflictDetector is the default implementation of ConflictDetector
func (*DefaultConflictDetector) DetectConflicts ¶
func (d *DefaultConflictDetector) DetectConflicts(ctx context.Context, bundle *Bundle, targetDir string) ([]*Conflict, error)
DetectConflicts detects conflicts between the bundle and the target directory
func (*DefaultConflictDetector) DetectContentConflicts ¶
func (d *DefaultConflictDetector) DetectContentConflicts(ctx context.Context, bundle *Bundle, targetDir string) ([]*Conflict, error)
DetectContentConflicts detects content conflicts between the bundle and the target directory
func (*DefaultConflictDetector) DetectVersionConflicts ¶
func (d *DefaultConflictDetector) DetectVersionConflicts(ctx context.Context, bundle *Bundle, targetDir string) ([]*Conflict, error)
DetectVersionConflicts detects version conflicts between the bundle and the target directory
type DefaultConflictResolver ¶
type DefaultConflictResolver struct {
// Logger is the logger for conflict resolution operations
Logger io.Writer
// DefaultStrategies maps conflict types to default resolution strategies
DefaultStrategies map[ConflictType]ConflictResolutionStrategy
// PromptCallback is called when a conflict requires user input
PromptCallback func(conflict *Conflict) (ConflictResolutionStrategy, error)
// AuditLogger is used for logging audit events
AuditLogger *errors.AuditLogger
}
DefaultConflictResolver is the default implementation of ConflictResolver
func (*DefaultConflictResolver) GetDefaultStrategy ¶
func (r *DefaultConflictResolver) GetDefaultStrategy(conflictType ConflictType) ConflictResolutionStrategy
GetDefaultStrategy gets the default resolution strategy for a conflict type
func (*DefaultConflictResolver) ResolveConflict ¶
func (r *DefaultConflictResolver) ResolveConflict(ctx context.Context, conflict *Conflict) (*ConflictResolution, error)
ResolveConflict resolves a single conflict
func (*DefaultConflictResolver) ResolveConflicts ¶
func (r *DefaultConflictResolver) ResolveConflicts(ctx context.Context, conflicts []*Conflict) ([]*ConflictResolution, error)
ResolveConflicts resolves multiple conflicts
func (*DefaultConflictResolver) SetDefaultStrategy ¶
func (r *DefaultConflictResolver) SetDefaultStrategy(conflictType ConflictType, strategy ConflictResolutionStrategy)
SetDefaultStrategy sets the default resolution strategy for a conflict type
type DefaultImportReportingSystem ¶
type DefaultImportReportingSystem struct {
// ReportManager is the report manager
ReportManager ReportManager
// Logger is the logger for import operations
Logger io.Writer
// LogEntries stores log entries by bundle ID
LogEntries map[string][]string
// PerformanceMetrics stores performance metrics by bundle ID
PerformanceMetrics map[string]map[string]interface{}
// ReportsDir is the directory where reports are stored
ReportsDir string
}
DefaultImportReportingSystem is the default implementation of ImportReportingSystem
func (*DefaultImportReportingSystem) AddPerformanceMetric ¶
func (r *DefaultImportReportingSystem) AddPerformanceMetric(bundleID string, metricName string, value interface{})
AddPerformanceMetric adds a performance metric for an import
func (*DefaultImportReportingSystem) AssessSystemImpact ¶
func (r *DefaultImportReportingSystem) AssessSystemImpact(result *ImportResult) *SystemImpactAssessment
AssessSystemImpact assesses the impact of an import on the system
func (*DefaultImportReportingSystem) CreateReport ¶
func (r *DefaultImportReportingSystem) CreateReport(result *ImportResult, level ReportLevel) (*EnhancedImportReport, error)
CreateReport creates an enhanced report for an import operation. This method uses ReportLevel from report.go for consistency across the reporting system. The level parameter determines the amount of detail included in the report: - BasicReportLevel: Only includes the base import report - DetailedReportLevel: Adds statistics, validation details, and conflict details - VerboseReportLevel: Adds system impact assessment, performance metrics, and log entries
func (*DefaultImportReportingSystem) GenerateStatistics ¶
func (r *DefaultImportReportingSystem) GenerateStatistics(result *ImportResult) *ImportStatistics
GenerateStatistics generates statistics for an import operation
func (*DefaultImportReportingSystem) GenerateUserFriendlySummary ¶
func (r *DefaultImportReportingSystem) GenerateUserFriendlySummary(report *EnhancedImportReport) string
GenerateUserFriendlySummary creates a human-readable summary of an import operation This provides a clear, concise overview of the import results suitable for end users
func (*DefaultImportReportingSystem) GetLogEntries ¶
func (r *DefaultImportReportingSystem) GetLogEntries(bundleID string) []string
GetLogEntries gets the log entries for an import
func (*DefaultImportReportingSystem) LogImportEvent ¶
func (r *DefaultImportReportingSystem) LogImportEvent(bundleID, event string, args ...interface{})
LogImportEvent logs an event during the import process
func (*DefaultImportReportingSystem) SaveReport ¶
func (r *DefaultImportReportingSystem) SaveReport(report *EnhancedImportReport, path string) error
SaveReport saves a report to a file
type DefaultReportGenerator ¶
type DefaultReportGenerator struct {
// Logger is the logger for report generation operations
Logger io.Writer
}
DefaultReportGenerator is the default implementation of ReportGenerator
func (*DefaultReportGenerator) GenerateReport ¶
func (g *DefaultReportGenerator) GenerateReport(result *ImportResult, level ReportLevel, format ReportFormat) (*ImportReport, error)
GenerateReport generates a report of an import operation
func (*DefaultReportGenerator) SaveReport ¶
func (g *DefaultReportGenerator) SaveReport(report *ImportReport, path string) error
SaveReport saves a report to a file
func (*DefaultReportGenerator) WriteReport ¶
func (g *DefaultReportGenerator) WriteReport(report *ImportReport, writer io.Writer) error
WriteReport writes a report to a writer
type DefaultReportManager ¶
type DefaultReportManager struct {
// Generator is the report generator
Generator ReportGenerator
// ReportsDir is the directory where reports are stored
ReportsDir string
// Logger is the logger for report management operations
Logger io.Writer
}
DefaultReportManager is the default implementation of ReportManager
func (*DefaultReportManager) CreateImportReport ¶
func (m *DefaultReportManager) CreateImportReport(result *ImportResult, level ReportLevel, format ReportFormat) (*ImportReport, error)
CreateImportReport creates a report for an import operation
func (*DefaultReportManager) GetReportPath ¶
func (m *DefaultReportManager) GetReportPath(bundleID string, format ReportFormat) string
GetReportPath gets the path for a report
func (*DefaultReportManager) ListReports ¶
func (m *DefaultReportManager) ListReports(dir string) ([]string, error)
ListReports lists all reports in a directory
func (*DefaultReportManager) SaveImportReport ¶
func (m *DefaultReportManager) SaveImportReport(report *ImportReport, path string) error
SaveImportReport saves an import report to a file
type DefaultRollbackManager ¶
type DefaultRollbackManager struct {
// BackupManager is the backup manager to use for rollback operations
BackupManager BackupManager
}
DefaultRollbackManager is the default implementation of RollbackManager
func (*DefaultRollbackManager) CreateRollbackPoint ¶
func (m *DefaultRollbackManager) CreateRollbackPoint(ctx context.Context, targetDir, backupDir, description string) (string, error)
CreateRollbackPoint creates a rollback point
func (*DefaultRollbackManager) DeleteRollbackPoint ¶
func (m *DefaultRollbackManager) DeleteRollbackPoint(ctx context.Context, rollbackPointPath string) error
DeleteRollbackPoint deletes a rollback point
func (*DefaultRollbackManager) ListRollbackPoints ¶
func (m *DefaultRollbackManager) ListRollbackPoints(ctx context.Context, backupDir string) ([]BackupMetadata, error)
ListRollbackPoints lists all rollback points
type DefaultStagedImporter ¶
type DefaultStagedImporter struct {
// Importer is the bundle importer
Importer BundleImporter
// Status is the current status of the import
Status *StagedImportStatus
// CancelCh is a channel for cancellation
CancelCh chan struct{}
}
DefaultStagedImporter is the default implementation of StagedImporter
func (*DefaultStagedImporter) Cancel ¶
func (i *DefaultStagedImporter) Cancel() error
Cancel cancels the import
func (*DefaultStagedImporter) GetStatus ¶
func (i *DefaultStagedImporter) GetStatus() *StagedImportStatus
GetStatus returns the current status of the import
func (*DefaultStagedImporter) Import ¶
func (i *DefaultStagedImporter) Import(ctx context.Context, bundlePath string, options StagedImportOptions) (*ImportResult, error)
Import performs a staged import
type DeleteOperation ¶
DeleteOperation represents a file deletion
type DeltaBundle ¶
type DeltaBundle struct {
Path string
Manifest *DeltaManifest
}
DeltaBundle represents an incremental update bundle
func GenerateDelta ¶
func GenerateDelta(oldBundle, newBundle *Bundle) (*DeltaBundle, error)
GenerateDelta generates a delta bundle between two versions
func LoadDeltaBundle ¶
func LoadDeltaBundle(path string) (*DeltaBundle, error)
LoadDeltaBundle loads a delta bundle from disk
type DeltaDependencies ¶
type DeltaDependencies struct {
Required []string `json:"required"`
Compatible []string `json:"compatible"`
}
DeltaDependencies specifies version requirements
type DeltaManifest ¶
type DeltaManifest struct {
Version string `json:"version"`
DeltaType string `json:"deltaType"`
FromVersion string `json:"fromVersion"`
ToVersion string `json:"toVersion"`
Timestamp time.Time `json:"timestamp"`
Size DeltaSize `json:"size"`
Operations DeltaOperations `json:"operations"`
Dependencies DeltaDependencies `json:"dependencies"`
Rollback RollbackInfo `json:"rollback"`
}
DeltaManifest represents the manifest for an incremental update bundle
type DeltaOperations ¶
type DeltaOperations struct {
Add []AddOperation `json:"add"`
Update []UpdateOperation `json:"update"`
Delete []DeleteOperation `json:"delete"`
Patch []PatchOperation `json:"patch"`
}
DeltaOperations contains lists of operations by type
type DeltaSize ¶
type DeltaSize struct {
Compressed int64 `json:"compressed"`
Uncompressed int64 `json:"uncompressed"`
}
DeltaSize contains size information for the delta bundle
type DependencyHandling ¶
type DependencyHandling struct {
ResolutionStrategy DependencyStrategy // How to resolve dependencies
MaxDepth int // Maximum dependency depth
IncludeOptional bool // Include optional dependencies
IncludeDevDeps bool // Include development dependencies
ExcludePatterns []string // Patterns to exclude
ForceInclude []string // Force include specific dependencies
}
DependencyHandling defines how dependencies are handled
type DependencyInfo ¶
type DependencyInfo struct {
Type string `json:"type"` // hard, soft, optional
Required bool `json:"required"` // Is this dependency required
Version string `json:"version"` // Version constraint
Alternatives []string `json:"alternatives"` // Alternative dependencies
}
DependencyInfo contains dependency information
type DependencyStrategy ¶
type DependencyStrategy string
DependencyStrategy defines dependency resolution strategies
const ( DependencyAll DependencyStrategy = "all" // Include all dependencies DependencyDirect DependencyStrategy = "direct" // Only direct dependencies DependencyMinimal DependencyStrategy = "minimal" // Minimal required set DependencyCustom DependencyStrategy = "custom" // Custom strategy )
type DeprecatedFeature ¶
type DeprecatedFeature struct {
Name string `json:"name"`
DeprecatedIn string `json:"deprecatedIn"`
RemovalVersion string `json:"removalVersion"`
Alternative string `json:"alternative"`
}
DeprecatedFeature represents a deprecated feature
type DirectorySpec ¶
type DirectorySpec struct {
// Required indicates whether the directory is required
Required bool
// Description provides a description of the directory
Description string
// Subdirectories defines the subdirectories that should exist
Subdirectories map[string]DirectorySpec
// FileExtensions defines the allowed file extensions in this directory
FileExtensions []string
// NamingConvention defines the naming convention for files in this directory
NamingConvention string
}
DirectorySpec defines the specification for a directory in the bundle
type DocumentationMetadataExtractor ¶
type DocumentationMetadataExtractor struct{}
DocumentationMetadataExtractor extracts metadata from documentation files
func (*DocumentationMetadataExtractor) Extract ¶
func (e *DocumentationMetadataExtractor) Extract(path string) (map[string]interface{}, error)
func (*DocumentationMetadataExtractor) Supports ¶
func (e *DocumentationMetadataExtractor) Supports(path string) bool
type EncryptionFactory ¶
type EncryptionFactory struct {
// contains filtered or unexported fields
}
EncryptionFactory creates encryption handlers
func NewEncryptionFactory ¶
func NewEncryptionFactory() *EncryptionFactory
NewEncryptionFactory creates a new encryption factory
func (*EncryptionFactory) GetHandler ¶
func (f *EncryptionFactory) GetHandler(algorithm string) (EncryptionHandler, error)
GetHandler returns an encryption handler for the given algorithm
func (*EncryptionFactory) RegisterHandler ¶
func (f *EncryptionFactory) RegisterHandler(algorithm string, handler EncryptionHandler)
RegisterHandler registers an encryption handler
type EncryptionHandler ¶
type EncryptionHandler interface {
Encrypt(data []byte, password string) ([]byte, error)
Decrypt(data []byte, password string) ([]byte, error)
EncryptStream(src io.Reader, dst io.Writer, password string) error
DecryptStream(src io.Reader, dst io.Writer, password string) error
}
EncryptionHandler handles encryption operations
type EncryptionHeader ¶
type EncryptionHeader struct {
Algorithm string `json:"algorithm"`
HeaderSize int `json:"headerSize"`
Version string `json:"version"`
}
EncryptionHeader contains encryption metadata
type EncryptionOptions ¶
type EncryptionOptions struct {
Algorithm string // aes-256-gcm, chacha20-poly1305
Password string // Encryption password
KeyFile string // Path to key file
}
EncryptionOptions defines encryption settings
type EnhancedBundleManifest ¶
type EnhancedBundleManifest struct {
BundleManifest
// Compliance contains compliance mapping information
Compliance struct {
// OwaspLLMTop10 maps OWASP LLM Top 10 categories to content items
OwaspLLMTop10 map[string][]string `json:"owasp_llm_top10,omitempty"`
// ISOIEC42001 maps ISO/IEC 42001 controls to content items
ISOIEC42001 map[string][]string `json:"iso_iec_42001,omitempty"`
} `json:"compliance,omitempty"`
// Changelog contains version history information
Changelog []ChangelogEntry `json:"changelog,omitempty"`
// Documentation contains paths to documentation files
Documentation map[string]string `json:"documentation,omitempty"`
// IsIncremental indicates whether this is an incremental bundle
IsIncremental bool `json:"is_incremental,omitempty"`
// BaseVersion is the base version for incremental bundles
BaseVersion string `json:"base_version,omitempty"`
}
EnhancedBundleManifest extends BundleManifest with additional fields for offline bundles
type EnhancedImportReport ¶
type EnhancedImportReport struct {
// Base report information
*ImportReport `json:",inline"`
// Statistics contains statistics about the import operation
Statistics *ImportStatistics `json:"statistics,omitempty"`
// SystemImpact contains information about the impact of the import on the system
SystemImpact *SystemImpactAssessment `json:"system_impact,omitempty"`
// ValidationDetails contains detailed information about validation results
ValidationDetails map[string]interface{} `json:"validation_details,omitempty"`
// ConflictDetails contains detailed information about conflicts
ConflictDetails map[string]interface{} `json:"conflict_details,omitempty"`
// PerformanceMetrics contains detailed performance metrics
PerformanceMetrics map[string]interface{} `json:"performance_metrics,omitempty"`
// LogEntries contains log entries related to the import
LogEntries []string `json:"log_entries,omitempty"`
// ReportingLevel is the level of detail in the report
ReportingLevel ReportLevel `json:"reporting_level"` // Using ReportLevel from report.go for consistency
}
EnhancedImportReport extends ImportReport with additional detailed information
type EnhancedManifestGenerator ¶
type EnhancedManifestGenerator struct {
// contains filtered or unexported fields
}
EnhancedManifestGenerator handles comprehensive manifest generation with advanced features
func NewEnhancedManifestGenerator ¶
func NewEnhancedManifestGenerator(bundlePath string, options ManifestOptions) *EnhancedManifestGenerator
NewEnhancedManifestGenerator creates a new enhanced manifest generator
func (*EnhancedManifestGenerator) Generate ¶
func (g *EnhancedManifestGenerator) Generate() (*BundleManifest, error)
Generate creates a comprehensive manifest
func (*EnhancedManifestGenerator) GetErrors ¶
func (g *EnhancedManifestGenerator) GetErrors() []error
GetErrors returns any errors encountered during generation
func (*EnhancedManifestGenerator) WriteManifest ¶
func (g *EnhancedManifestGenerator) WriteManifest(manifest *BundleManifest, outputPath string) error
WriteManifest writes the manifest to a file
type EntityInfo ¶
type EntityInfo struct {
ID string `json:"id"`
Path string `json:"path"`
Type string `json:"type"`
Name string `json:"name"`
Version string `json:"version"`
Category string `json:"category"`
Tags []string `json:"tags"`
Dependencies []string `json:"dependencies"`
Size int64 `json:"size"`
Modified time.Time `json:"modified"`
Author string `json:"author"`
Metadata map[string]interface{} `json:"metadata"`
Selected bool `json:"selected"`
SelectionReason string `json:"selectionReason"`
}
EntityInfo represents an entity in the bundle
type EntitySearchCriteria ¶
type EntitySearchCriteria struct {
Query string // Search query
Type []string // Entity types to search
Category []string // Categories to include
Tags []string // Required tags
Author string // Filter by author
DateRange *DateRange // Created/modified date range
VersionRange *VersionRange // Version constraints
CustomFilters map[string]string // Additional filters
}
EntitySearchCriteria defines search parameters for entities
type EntitySummary ¶
type EntitySummary struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Size int64 `json:"size"`
Reason string `json:"reason"`
Selected bool `json:"selected"`
}
EntitySummary provides a summary of an entity
type Environment ¶
type Environment struct {
OS string
Arch string
Version string
AvailableDiskSpace int64
AvailableMemory int64
IsProduction bool
InstalledPackages map[string]string
}
Environment represents the current system environment
func DetectEnvironment ¶
func DetectEnvironment() *Environment
DetectEnvironment detects the current system environment
type EnvironmentConfig ¶
type EnvironmentConfig struct {
SourceEnvironment string // Source environment name
TargetEnvironment string // Target environment name
ConfigOverrides map[string]interface{} // Configuration overrides
SecretHandling SecretHandlingType // How to handle secrets
VariableMapping map[string]string // Environment variable mapping
}
EnvironmentConfig defines environment-specific configurations
type EnvironmentRequirement ¶
type EnvironmentRequirement struct {
Platforms []Platform `json:"platforms"`
MinDiskSpace int64 `json:"minDiskSpace"`
MinMemory int64 `json:"minMemory"`
RuntimeDeps map[string]string `json:"runtimeDeps"`
}
EnvironmentRequirement defines environment requirements
type ExportCustomization ¶
type ExportCustomization struct {
// Scope selection
ScopeOptions *ScopeOptions // Business object scope selection
EnvironmentConfig *EnvironmentConfig // Environment-specific configurations
DependencyHandling *DependencyHandling // How to handle dependencies
// Filtering options
TemplateFilters *TemplateFilterOptions // Template filtering
ModuleFilters *ModuleFilterOptions // Module filtering
FileFilters *FileFilterOptions // General file filtering
// Transformation options
Transformations *TransformationOptions // Content transformations
// Hotfix generation
HotfixOptions *HotfixOptions // Hotfix script generation
// Export behavior
BehaviorOptions *BehaviorOptions // Export behavior customization
}
ExportCustomization provides advanced customization options for bundle export
func (*ExportCustomization) ApplyFileFilter ¶
func (c *ExportCustomization) ApplyFileFilter(path string, info FileInfo) bool
ApplyFileFilter applies file filtering based on customization
func (*ExportCustomization) ApplyTemplateFilter ¶
func (c *ExportCustomization) ApplyTemplateFilter(template *TemplateInfo) bool
ApplyTemplateFilter applies template filtering based on customization
func (*ExportCustomization) Validate ¶
func (c *ExportCustomization) Validate() error
Validate validates the customization options
type ExportFilters ¶
type ExportFilters struct {
TemplateCategories []string // Filter templates by category
ModuleTypes []string // Filter modules by type
MinVersion string // Minimum version to include
MaxVersion string // Maximum version to include
CreatedAfter *time.Time // Include items created after this date
CreatedBefore *time.Time // Include items created before this date
Tags []string // Filter by tags
ExcludePatterns []string // Glob patterns to exclude
IncludeList []string // Explicit list of paths to include
ExcludeList []string // Explicit list of paths to exclude
}
ExportFilters defines filters for selective export
type ExportFormat ¶
type ExportFormat string
ExportFormat defines the bundle format
const ( FormatTarGz ExportFormat = "tar.gz" FormatZip ExportFormat = "zip" FormatTar ExportFormat = "tar" )
type ExportOptions ¶
type ExportOptions struct {
OutputPath string // Path to save the bundle
Format ExportFormat // Bundle format (tar.gz, zip, etc.)
IncludeBinary bool // Include the tool binary
IncludeTemplates bool // Include templates
IncludeModules bool // Include modules
IncludeDocs bool // Include documentation
Compression CompressionType // Compression type
Encryption *EncryptionOptions // Optional encryption
Filters *ExportFilters // Filters for selective export
ProgressHandler ExportProgressHandler // Progress callback
Metadata map[string]interface{} // Additional metadata
}
ExportOptions defines options for bundle export
type ExportPreview ¶
type ExportPreview struct {
TotalEntities int `json:"totalEntities"`
TotalSize int64 `json:"totalSize"`
EntityBreakdown map[string]int `json:"entityBreakdown"`
Entities []EntitySummary `json:"entities"`
DependencyGraph map[string][]string `json:"dependencyGraph"`
}
ExportPreview provides a preview of the export
type ExportProgressHandler ¶
type ExportProgressHandler func(progress ProgressInfo)
ExportProgressHandler is called to report export progress
type ExportRequest ¶
type ExportRequest struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Templates []string `json:"templates,omitempty"`
Categories []string `json:"categories,omitempty"`
Modules []string `json:"modules,omitempty"`
Format string `json:"format,omitempty"` // "zip", "tar.gz"
Compress bool `json:"compress,omitempty"`
}
ExportRequest represents a request to export a bundle
type ExportScope ¶
type ExportScope string
ExportScope defines what to include in partial export
const ( ScopeTemplatesOnly ExportScope = "templates" ScopeModulesOnly ExportScope = "modules" ScopeDocsOnly ExportScope = "documentation" ScopeCustom ExportScope = "custom" ScopeModifiedOnly ExportScope = "modified" ScopeDependencies ExportScope = "dependencies" )
type FileBackup ¶
type FileBackup struct {
Path string `json:"path"`
Hash string `json:"hash"`
Size int64 `json:"size"`
Mode uint32 `json:"mode"`
BackupPath string `json:"backupPath"`
}
FileBackup represents a backed up file
type FileFilterFunc ¶
FileFilterFunc is a custom file filter function
type FileFilterOptions ¶
type FileFilterOptions struct {
IncludePatterns []string // Include files matching these patterns
ExcludePatterns []string // Exclude files matching these patterns
MinSize int64 // Minimum file size
MaxSize int64 // Maximum file size (0 = no limit)
ModifiedAfter *time.Time // Files modified after this date
ModifiedBefore *time.Time // Files modified before this date
FileTypes []string // Include only these file types
ExcludeFileTypes []string // Exclude these file types
CustomFilter FileFilterFunc // Custom filter function
}
FileFilterOptions provides general file filtering
type FileHash ¶
type FileHash struct {
Path string `json:"path"`
Hash string `json:"hash"`
Size int64 `json:"size"`
Mode uint32 `json:"mode"`
}
FileHash represents a file and its hash
type FileInfo ¶
type FileInfo struct {
Path string
Size int64
Modified time.Time
IsDirectory bool
Permissions uint32
}
FileInfo contains file metadata for filtering
type GzipHandler ¶
type GzipHandler struct {
Level int
}
GzipHandler handles gzip compression
func (*GzipHandler) Decompress ¶
func (*GzipHandler) GetExtension ¶
func (h *GzipHandler) GetExtension() string
type HotfixOptions ¶
type HotfixOptions struct {
GenerateHotfix bool // Generate hotfix scripts
TargetPlatforms []string // Target platforms for scripts
ScriptFormat ScriptFormat // Script format
IncludeRollback bool // Include rollback scripts
TestMode bool // Generate in test mode
CustomTemplate string // Custom script template
}
HotfixOptions defines hotfix script generation options
type ImportConflict ¶
type ImportConflict struct {
// Path is the path to the conflicting file
Path string `json:"path"`
// BundleChecksum is the checksum of the file in the bundle
BundleChecksum string `json:"bundle_checksum,omitempty"`
// ExistingChecksum is the checksum of the existing file
ExistingChecksum string `json:"existing_checksum,omitempty"`
// Type is the type of conflict
Type string `json:"type,omitempty"`
}
ImportConflict represents a conflict between a bundle file and an existing file during import reporting
type ImportOptions ¶
type ImportOptions struct {
// ValidationLevel is the level of validation to perform
ValidationLevel ValidationLevel
// TargetDir is the directory to import the bundle to
TargetDir string
// BackupDir is the directory to store backups in
BackupDir string
// Force indicates whether to force import even if there are conflicts
Force bool
// Logger is the logger for import operations
Logger io.Writer
// VerboseReporting indicates whether to generate verbose reports
VerboseReporting bool
// ProgressCallback is called with progress updates
ProgressCallback ProgressCallback
// User is the user performing the import operation
User string
// AuditLogger is the logger for audit events
AuditLogger *errors.AuditLogger
}
ImportOptions represents options for importing a bundle
type ImportReport ¶
type ImportReport struct {
// ID is the unique identifier for the report
ID string `json:"id"`
// Result is the result of the import
Result *ImportResult `json:"result"`
// Level is the level of detail in the report
Level ReportLevel `json:"level"`
// Format is the format of the report
Format ReportFormat `json:"format"`
// GeneratedAt is the time the report was generated
GeneratedAt time.Time `json:"generated_at"`
}
ImportReport represents a report of an import operation
type ImportReportingSystem ¶
type ImportReportingSystem interface {
// CreateReport creates a report for an import operation
CreateReport(result *ImportResult, level ReportLevel) (*EnhancedImportReport, error)
// SaveReport saves a report to a file
SaveReport(report *EnhancedImportReport, path string) error
// GenerateStatistics generates statistics for an import operation
GenerateStatistics(result *ImportResult) *ImportStatistics
// AssessSystemImpact assesses the impact of an import on the system
AssessSystemImpact(result *ImportResult) *SystemImpactAssessment
// LogImportEvent logs an event during the import process
LogImportEvent(bundleID, event string, args ...interface{})
// GetLogEntries gets the log entries for an import
GetLogEntries(bundleID string) []string
// AddPerformanceMetric adds a performance metric for an import
AddPerformanceMetric(bundleID string, metricName string, value interface{})
// GenerateUserFriendlySummary creates a human-readable summary of an import operation
GenerateUserFriendlySummary(report *EnhancedImportReport) string
}
ImportReportingSystem defines the interface for the import reporting system
func NewImportReportingSystem ¶
func NewImportReportingSystem(reportManager ReportManager, reportsDir string, logger io.Writer) ImportReportingSystem
NewImportReportingSystem creates a new import reporting system
type ImportRequest ¶
type ImportRequest struct {
Source string `json:"source"` // file path or URL
ValidateOnly bool `json:"validate_only,omitempty"`
Overwrite bool `json:"overwrite,omitempty"`
SkipConflicts bool `json:"skip_conflicts,omitempty"`
}
ImportRequest represents a request to import a bundle
type ImportResult ¶
type ImportResult struct {
// Success indicates whether the import was successful
Success bool `json:"success"`
// Message contains a human-readable message about the import
Message string `json:"message"`
// BundleID is the ID of the imported bundle
BundleID string `json:"bundle_id"`
// BundleName is the name of the imported bundle
BundleName string `json:"bundle_name"`
// BundleVersion is the version of the imported bundle
BundleVersion string `json:"bundle_version"`
// BundleType is the type of the imported bundle
BundleType BundleType `json:"bundle_type"`
// ImportTime is the time the import was performed
ImportTime time.Time `json:"import_time,omitempty"`
// StartTime is the time the import started
StartTime time.Time `json:"start_time"`
// EndTime is the time the import ended
EndTime time.Time `json:"end_time"`
// Duration is the duration of the import
Duration time.Duration `json:"duration"`
// Errors contains any errors encountered during import
Errors []string `json:"errors,omitempty"`
// Warnings contains any warnings that occurred during import
Warnings []string `json:"warnings,omitempty"`
// ImportedItems contains the items that were imported
ImportedItems []ContentItem `json:"imported_items,omitempty"`
// ValidationResult contains the result of the validation
ValidationResult *ValidationResult `json:"validation_result,omitempty"`
// ValidationResults contains the results of validation
ValidationResults []*ValidationResult `json:"validation_results,omitempty"`
// ErrorReportPath is the path to the error report
ErrorReportPath string `json:"error_report_path,omitempty"`
// Conflicts contains the conflicts that were detected
Conflicts []*Conflict `json:"conflicts,omitempty"`
// ConflictResolutions contains the resolutions for conflicts
ConflictResolutions []*ConflictResolution `json:"conflict_resolutions,omitempty"`
// BackupID is the ID of the backup created during import
BackupID string `json:"backup_id,omitempty"`
// BackupPath is the path to the backup created during import
BackupPath string `json:"backup_path,omitempty"`
// ImportedFiles is a list of files that were imported
ImportedFiles []string `json:"imported_files,omitempty"`
// SkippedFiles is a list of files that were skipped
SkippedFiles []string `json:"skipped_files,omitempty"`
// ErrorMessage contains the error message if the import failed
ErrorMessage string `json:"error_message,omitempty"`
}
ImportResult represents the result of an import operation
type ImportStatistics ¶
type ImportStatistics struct {
// TotalFiles is the total number of files in the bundle
TotalFiles int `json:"total_files"`
// ImportedFiles is the number of files that were imported
ImportedFiles int `json:"imported_files"`
// SkippedFiles is the number of files that were skipped
SkippedFiles int `json:"skipped_files"`
// ConflictFiles is the number of files that had conflicts
ConflictFiles int `json:"conflict_files"`
// ResolvedConflicts is the number of conflicts that were resolved
ResolvedConflicts int `json:"resolved_conflicts"`
// ValidationErrors is the number of validation errors
ValidationErrors int `json:"validation_errors"`
// ValidationWarnings is the number of validation warnings
ValidationWarnings int `json:"validation_warnings"`
// TotalSize is the total size of the imported files in bytes
TotalSize int64 `json:"total_size"`
// ProcessingTime is the time spent processing the import
ProcessingTime time.Duration `json:"processing_time"`
// ValidationTime is the time spent validating the bundle
ValidationTime time.Duration `json:"validation_time"`
// ExtractionTime is the time spent extracting the bundle
ExtractionTime time.Duration `json:"extraction_time"`
// InstallationTime is the time spent installing the bundle
InstallationTime time.Duration `json:"installation_time"`
}
ImportStatistics contains statistics about an import operation
type Info ¶
type Info struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Version string `json:"version"`
Author string `json:"author"`
Tags []string `json:"tags,omitempty"`
Templates []string `json:"templates"`
Modules []string `json:"modules,omitempty"`
Size int64 `json:"size"`
Checksum string `json:"checksum"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
Info represents metadata about a bundle
type InteractiveProgressTracker ¶
type InteractiveProgressTracker struct {
// contains filtered or unexported fields
}
InteractiveProgressTracker provides enhanced progress tracking with visual feedback
func NewInteractiveProgressTracker ¶
func NewInteractiveProgressTracker(writer io.Writer, verbose bool) *InteractiveProgressTracker
NewInteractiveProgressTracker creates a new interactive progress tracker
func (*InteractiveProgressTracker) CompleteOperation ¶
func (ipt *InteractiveProgressTracker) CompleteOperation(operation string, message string)
CompleteOperation marks an operation as complete
func (*InteractiveProgressTracker) FailOperation ¶
func (ipt *InteractiveProgressTracker) FailOperation(operation string, err error)
FailOperation marks an operation as failed
func (*InteractiveProgressTracker) IncrementProgress ¶
func (ipt *InteractiveProgressTracker) IncrementProgress(operation string)
IncrementProgress increments progress by 1
func (*InteractiveProgressTracker) LogMessage ¶
func (ipt *InteractiveProgressTracker) LogMessage(level, message string)
LogMessage logs a message without affecting progress bars
func (*InteractiveProgressTracker) StartOperation ¶
func (ipt *InteractiveProgressTracker) StartOperation(operation string, total int, description string)
StartOperation starts tracking a new operation with a progress bar
func (*InteractiveProgressTracker) Summary ¶
func (ipt *InteractiveProgressTracker) Summary(stats map[string]interface{})
Summary prints a summary of the operation
func (*InteractiveProgressTracker) UpdateProgress ¶
func (ipt *InteractiveProgressTracker) UpdateProgress(operation string, current int)
UpdateProgress updates the progress for an operation
type Manager ¶
type Manager interface {
ListBundles() ([]Info, error)
GetBundle(id string) (*Info, error)
CreateBundle(request CreateRequest) (*Info, error)
DeleteBundle(id string) error
ExportBundle(request ExportRequest) (*OperationResult, error)
ImportBundle(request ImportRequest) (*OperationResult, error)
}
Manager interface for bundle operations
type ManifestChanges ¶
type ManifestChanges struct {
Added []ContentChange `json:"added"`
Removed []ContentChange `json:"removed"`
Modified []ContentChange `json:"modified"`
}
ManifestChanges contains lists of changes
type ManifestComparison ¶
type ManifestComparison struct {
OldVersion string `json:"oldVersion"`
NewVersion string `json:"newVersion"`
Changes ManifestChanges `json:"changes"`
Summary ComparisonSummary `json:"summary"`
}
ManifestComparison contains the comparison results
func GenerateComparisonReport ¶
func GenerateComparisonReport(oldManifest, newManifest *BundleManifest) *ManifestComparison
GenerateComparisonReport generates a comparison between two manifests
type ManifestFormat ¶
type ManifestFormat string
ManifestFormat defines the output format
const ( ManifestFormatJSON ManifestFormat = "json" ManifestFormatYAML ManifestFormat = "yaml" ManifestFormatXML ManifestFormat = "xml" )
type ManifestGenerator ¶
type ManifestGenerator struct {
// SigningKey is the key used to sign bundles
SigningKey ed25519.PrivateKey
// Author is the default author for generated manifests
Author Author
}
ManifestGenerator generates bundle manifests
func NewManifestGenerator ¶
func NewManifestGenerator(signingKey ed25519.PrivateKey, author Author) *ManifestGenerator
NewManifestGenerator creates a new manifest generator
func (*ManifestGenerator) AddComplianceMapping ¶
func (g *ManifestGenerator) AddComplianceMapping(manifest *EnhancedBundleManifest, contentID string, owaspCategories, isoControls []string) error
AddComplianceMapping adds a compliance mapping to an enhanced manifest
func (*ManifestGenerator) AddContentItem ¶
func (g *ManifestGenerator) AddContentItem(manifest *BundleManifest, path string, contentType ContentType, id, version, description string)
AddContentItem adds a content item to a manifest
func (*ManifestGenerator) AddContentItemToEnhancedManifest ¶
func (g *ManifestGenerator) AddContentItemToEnhancedManifest(manifest *EnhancedBundleManifest, path string, contentType ContentType, id, version, description string)
AddContentItemToEnhancedManifest adds a content item to an enhanced manifest
func (*ManifestGenerator) AddDocumentation ¶
func (g *ManifestGenerator) AddDocumentation(manifest *EnhancedBundleManifest, docType, path string)
AddDocumentation adds a documentation file to an enhanced manifest
func (*ManifestGenerator) GenerateEnhancedManifest ¶
func (g *ManifestGenerator) GenerateEnhancedManifest(name, description, version string, bundleType BundleType) *EnhancedBundleManifest
GenerateEnhancedManifest generates an enhanced bundle manifest for offline bundles
func (*ManifestGenerator) GenerateIncrementalManifest ¶
func (g *ManifestGenerator) GenerateIncrementalManifest(baseManifest *EnhancedBundleManifest, newVersion string, changes []string) *EnhancedBundleManifest
GenerateIncrementalManifest generates an incremental bundle manifest
func (*ManifestGenerator) GenerateManifest ¶
func (g *ManifestGenerator) GenerateManifest(name, description, version string, bundleType BundleType) *BundleManifest
GenerateManifest generates a bundle manifest
func (*ManifestGenerator) SignEnhancedManifest ¶
func (g *ManifestGenerator) SignEnhancedManifest(manifest *EnhancedBundleManifest) error
SignEnhancedManifest signs an enhanced manifest
func (*ManifestGenerator) SignManifest ¶
func (g *ManifestGenerator) SignManifest(manifest *BundleManifest) error
SignManifest signs a manifest using the signing key
func (*ManifestGenerator) UpdateChecksums ¶
func (g *ManifestGenerator) UpdateChecksums(manifest *BundleManifest, contentDir string) error
UpdateChecksums updates the checksums in a manifest based on content in a directory
func (*ManifestGenerator) UpdateChecksumsForEnhancedManifest ¶
func (g *ManifestGenerator) UpdateChecksumsForEnhancedManifest(manifest *EnhancedBundleManifest, contentDir string) error
UpdateChecksumsForEnhancedManifest updates the checksums in an enhanced manifest
func (*ManifestGenerator) WriteEnhancedManifest ¶
func (g *ManifestGenerator) WriteEnhancedManifest(manifest *EnhancedBundleManifest, filePath string) error
WriteEnhancedManifest writes an enhanced manifest to a file
func (*ManifestGenerator) WriteManifest ¶
func (g *ManifestGenerator) WriteManifest(manifest *BundleManifest, filePath string) error
WriteManifest writes a manifest to a file
type ManifestOptions ¶
type ManifestOptions struct {
IncludeChecksums bool // Include file checksums
ChecksumAlgorithms []string // Checksum algorithms to use
IncludePermissions bool // Include file permissions
IncludeTimestamps bool // Include modification timestamps
IncludeSize bool // Include file sizes
ResolveDependencies bool // Analyze and include dependencies
IncludeMetadata bool // Extract and include metadata
CustomFields map[string]interface{} // Custom fields to add
PrettyPrint bool // Format output for readability
Format ManifestFormat // Output format
}
ManifestOptions defines options for manifest generation
type MetadataEnricher ¶
type MetadataEnricher interface {
EnrichMetadata(path string, existing map[string]interface{}) map[string]interface{}
}
MetadataEnricher adds metadata to files
type MetadataExtractor ¶
type MetadataExtractor interface {
Extract(path string) (map[string]interface{}, error)
Supports(path string) bool
}
MetadataExtractor extracts metadata from different file types
type ModuleFilterFunc ¶
type ModuleFilterFunc func(module *ModuleInfo) bool
ModuleFilterFunc is a custom module filter function
type ModuleFilterOptions ¶
type ModuleFilterOptions struct {
Types []ModuleType // Include only these module types
ExcludeTypes []ModuleType // Exclude these module types
Providers []string // Include modules from these providers
ExcludeProviders []string // Exclude modules from these providers
MinVersion string // Minimum module version
MaxVersion string // Maximum module version
Platforms []string // Target platforms
Architectures []string // Target architectures
CustomFilter ModuleFilterFunc // Custom filter function
}
ModuleFilterOptions provides module-specific filtering
type ModuleInfo ¶
type ModuleInfo struct {
Name string
Type ModuleType
Version string
Provider string
Platform string
Architecture string
Dependencies []string
}
ModuleInfo contains module metadata for filtering
type ModuleMetadataExtractor ¶
type ModuleMetadataExtractor struct{}
ModuleMetadataExtractor extracts metadata from module files
func (*ModuleMetadataExtractor) Extract ¶
func (e *ModuleMetadataExtractor) Extract(path string) (map[string]interface{}, error)
func (*ModuleMetadataExtractor) Supports ¶
func (e *ModuleMetadataExtractor) Supports(path string) bool
type ModuleType ¶
type ModuleType string
ModuleType defines types of modules
const ( ModuleProvider ModuleType = "provider" // Provider modules ModuleDetector ModuleType = "detector" // Detector modules ModuleProcessor ModuleType = "processor" // Processor modules ModuleUtility ModuleType = "utility" // Utility modules )
type NoCompressionHandler ¶
type NoCompressionHandler struct{}
NoCompressionHandler handles no compression (passthrough)
func (*NoCompressionHandler) Decompress ¶
func (*NoCompressionHandler) GetExtension ¶
func (h *NoCompressionHandler) GetExtension() string
type OfflineBundle ¶
type OfflineBundle struct {
Bundle
// EnhancedManifest contains the enhanced manifest information
EnhancedManifest EnhancedBundleManifest
// Format is the format specification for this bundle
Format *OfflineBundleFormat
// IsIncremental indicates whether this is an incremental bundle
IsIncremental bool
// ComplianceMappings contains detailed compliance mapping information
ComplianceMappings []ComplianceMapping
}
OfflineBundle extends Bundle with additional functionality for offline bundles
func CreateIncrementalBundle ¶
func CreateIncrementalBundle(baseBundle *OfflineBundle, newManifest EnhancedBundleManifest, contentDir, outputPath string) (*OfflineBundle, error)
CreateIncrementalBundle creates an incremental bundle based on a base bundle
func CreateOfflineBundle ¶
func CreateOfflineBundle(manifest EnhancedBundleManifest, contentDir, outputPath string) (*OfflineBundle, error)
CreateOfflineBundle creates a new offline bundle
func MergeIncrementalBundle ¶
func MergeIncrementalBundle(baseBundle, incrementalBundle *OfflineBundle, outputPath string) (*OfflineBundle, error)
MergeIncrementalBundle merges an incremental bundle into a base bundle
func OpenOfflineBundle ¶
func OpenOfflineBundle(path string) (*OfflineBundle, error)
OpenOfflineBundle opens an offline bundle from the given path
func (*OfflineBundle) AddChangelogEntry ¶
func (b *OfflineBundle) AddChangelogEntry(version string, changes []string)
AddChangelogEntry adds a changelog entry to the bundle
func (*OfflineBundle) AddComplianceMapping ¶
func (b *OfflineBundle) AddComplianceMapping(mapping ComplianceMapping) error
AddComplianceMapping adds a compliance mapping to the bundle
func (*OfflineBundle) AddDocumentation ¶
func (b *OfflineBundle) AddDocumentation(docType, path string)
AddDocumentation adds a documentation file to the bundle
func (*OfflineBundle) GetComplianceMappings ¶
func (b *OfflineBundle) GetComplianceMappings() []ComplianceMapping
GetComplianceMappings returns the compliance mappings for a bundle
func (*OfflineBundle) GetDocumentationPath ¶
func (b *OfflineBundle) GetDocumentationPath(docType string) (string, error)
GetDocumentationPath returns the path to a documentation file
type OfflineBundleCreator ¶
type OfflineBundleCreator struct {
// Generator is the manifest generator
Generator *ManifestGenerator
// Validator is the offline bundle validator
Validator *OfflineBundleValidator
// Format is the offline bundle format
Format *OfflineBundleFormat
// Logger is the logger for bundle creation operations
Logger io.Writer
// AuditTrail is the audit trail manager for logging operations
AuditTrail *trail.AuditTrailManager
}
OfflineBundleCreator creates offline bundles
func NewOfflineBundleCreator ¶
func NewOfflineBundleCreator(signingKey ed25519.PrivateKey, author Author, logger io.Writer, auditTrail *trail.AuditTrailManager) *OfflineBundleCreator
NewOfflineBundleCreator creates a new offline bundle creator
func (*OfflineBundleCreator) AddComplianceMappingToOfflineBundle ¶
func (c *OfflineBundleCreator) AddComplianceMappingToOfflineBundle(bundle *OfflineBundle, contentID string, owaspCategories, isoControls []string) error
AddComplianceMappingToOfflineBundle adds a compliance mapping to an offline bundle
func (*OfflineBundleCreator) AddContentToOfflineBundle ¶
func (c *OfflineBundleCreator) AddContentToOfflineBundle(bundle *OfflineBundle, sourcePath, targetPath string, contentType ContentType, id, version, description string) error
AddContentToOfflineBundle adds content to an offline bundle
func (*OfflineBundleCreator) AddDocumentationToOfflineBundle ¶
func (c *OfflineBundleCreator) AddDocumentationToOfflineBundle(bundle *OfflineBundle, docType, sourcePath string) error
AddDocumentationToOfflineBundle adds documentation to an offline bundle
func (*OfflineBundleCreator) CreateIncrementalBundle ¶
func (c *OfflineBundleCreator) CreateIncrementalBundle(baseBundle *OfflineBundle, newVersion string, changes []string, outputPath string) (*OfflineBundle, error)
CreateIncrementalBundle creates an incremental bundle based on an existing bundle
func (*OfflineBundleCreator) CreateOfflineBundle ¶
func (c *OfflineBundleCreator) CreateOfflineBundle(name, description, version string, bundleType BundleType, outputPath string) (*OfflineBundle, error)
CreateOfflineBundle creates a new offline bundle
func (*OfflineBundleCreator) ExportOfflineBundle ¶
func (c *OfflineBundleCreator) ExportOfflineBundle(bundle *OfflineBundle, outputPath string) error
ExportOfflineBundle exports an offline bundle to a zip file
func (*OfflineBundleCreator) LoadOfflineBundle ¶
func (c *OfflineBundleCreator) LoadOfflineBundle(bundlePath string) (*OfflineBundle, error)
LoadOfflineBundle loads an offline bundle from a directory
func (*OfflineBundleCreator) ValidateOfflineBundle ¶
func (c *OfflineBundleCreator) ValidateOfflineBundle(bundle *OfflineBundle, level ValidationLevel) (*ValidationResult, error)
ValidateOfflineBundle validates an offline bundle
type OfflineBundleFormat ¶
type OfflineBundleFormat struct {
// SchemaVersion is the version of the bundle schema
SchemaVersion string `json:"schema_version"`
// FormatVersion is the version of the offline bundle format
FormatVersion string `json:"format_version"`
// SupportedTypes lists the supported bundle types
SupportedTypes []BundleType `json:"supported_types"`
// RequiredDirectories lists the required directories in the bundle
RequiredDirectories []string `json:"required_directories"`
// OptionalDirectories lists the optional directories in the bundle
OptionalDirectories []string `json:"optional_directories"`
// ManifestSchema defines the schema for the manifest file
ManifestSchema map[string]interface{} `json:"manifest_schema"`
// ValidationLevels lists the supported validation levels
ValidationLevels []ValidationLevel `json:"validation_levels"`
// SignatureAlgorithm specifies the algorithm used for signatures
SignatureAlgorithm string `json:"signature_algorithm"`
// ChecksumAlgorithm specifies the algorithm used for checksums
ChecksumAlgorithm string `json:"checksum_algorithm"`
// UpdatedAt is the timestamp when the format was last updated
UpdatedAt time.Time `json:"updated_at"`
}
OfflineBundleFormat represents the format specification for offline bundles
func DefaultOfflineBundleFormat ¶
func DefaultOfflineBundleFormat() *OfflineBundleFormat
DefaultOfflineBundleFormat returns the default offline bundle format specification
type OfflineBundleValidator ¶
type OfflineBundleValidator struct {
// BaseValidator is the underlying bundle validator
BaseValidator BundleValidator
// Logger is the logger for validation operations
Logger io.Writer
}
OfflineBundleValidator is a validator for offline bundles
func NewOfflineBundleValidator ¶
func NewOfflineBundleValidator(logger io.Writer) *OfflineBundleValidator
NewOfflineBundleValidator creates a new offline bundle validator
func (*OfflineBundleValidator) Validate ¶
func (v *OfflineBundleValidator) Validate(bundle *OfflineBundle, level ValidationLevel) (*ValidationResult, error)
Validate validates an offline bundle
func (*OfflineBundleValidator) ValidateChecksums ¶
func (v *OfflineBundleValidator) ValidateChecksums(bundle *OfflineBundle) (*ValidationResult, error)
ValidateChecksums validates the checksums of an offline bundle
func (*OfflineBundleValidator) ValidateCompatibility ¶
func (v *OfflineBundleValidator) ValidateCompatibility(bundle *OfflineBundle, currentVersions map[string]version.Version) (*ValidationResult, error)
ValidateCompatibility validates the compatibility of an offline bundle
func (*OfflineBundleValidator) ValidateComplianceMappings ¶
func (v *OfflineBundleValidator) ValidateComplianceMappings(bundle *OfflineBundle) (*ValidationResult, error)
ValidateComplianceMappings validates the compliance mappings of an offline bundle
func (*OfflineBundleValidator) ValidateDirectoryStructure ¶
func (v *OfflineBundleValidator) ValidateDirectoryStructure(bundle *OfflineBundle) (*ValidationResult, error)
ValidateDirectoryStructure validates the directory structure of an offline bundle
func (*OfflineBundleValidator) ValidateEnhancedManifest ¶
func (v *OfflineBundleValidator) ValidateEnhancedManifest(manifest *EnhancedBundleManifest, level ValidationLevel) (*ValidationResult, error)
ValidateEnhancedManifest validates an enhanced bundle manifest
func (*OfflineBundleValidator) ValidateIncrementalBundle ¶
func (v *OfflineBundleValidator) ValidateIncrementalBundle(bundle *OfflineBundle) (*ValidationResult, error)
ValidateIncrementalBundle validates an incremental bundle
func (*OfflineBundleValidator) ValidateOfflineBundle ¶
func (v *OfflineBundleValidator) ValidateOfflineBundle(bundle *OfflineBundle, level ValidationLevel) (*ValidationResult, error)
ValidateOfflineBundle validates an offline bundle
func (*OfflineBundleValidator) ValidateSignature ¶
func (v *OfflineBundleValidator) ValidateSignature(bundle *OfflineBundle, publicKey ed25519.PublicKey) (*ValidationResult, error)
ValidateSignature validates the signature of an offline bundle
type Operation ¶
type Operation struct {
Type string `json:"type"`
Path string `json:"path"`
Details interface{} `json:"details"`
Completed bool `json:"completed"`
}
Operation represents a single update operation
type OperationResult ¶
type OperationResult struct {
BundleID string `json:"bundle_id,omitempty"`
Status string `json:"status"`
Message string `json:"message,omitempty"`
Templates []string `json:"templates,omitempty"`
Modules []string `json:"modules,omitempty"`
Conflicts []string `json:"conflicts,omitempty"`
Errors []string `json:"errors,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
}
OperationResult represents the result of a bundle operation
type PartialBundleExporter ¶
type PartialBundleExporter struct {
*BundleExporter
// contains filtered or unexported fields
}
PartialBundleExporter extends BundleExporter for selective exports
func NewPartialBundleExporter ¶
func NewPartialBundleExporter(options ExportOptions, partialOptions *PartialExportOptions) *PartialBundleExporter
NewPartialBundleExporter creates a new partial bundle exporter
func (*PartialBundleExporter) AddEntity ¶
func (e *PartialBundleExporter) AddEntity(entityID string) error
AddEntity adds a single entity to the export
func (*PartialBundleExporter) Export ¶
func (e *PartialBundleExporter) Export() error
Export performs the partial bundle export
func (*PartialBundleExporter) GetExportPreview ¶
func (e *PartialBundleExporter) GetExportPreview() ExportPreview
GetExportPreview returns a preview of what will be exported
func (*PartialBundleExporter) RemoveEntity ¶
func (e *PartialBundleExporter) RemoveEntity(entityID string) error
RemoveEntity removes an entity from the export
func (*PartialBundleExporter) SelectEntities ¶
func (e *PartialBundleExporter) SelectEntities() error
SelectEntities performs entity selection based on criteria
type PartialExportOptions ¶
type PartialExportOptions struct {
// Entity selection methods
EntitySearch *EntitySearchCriteria // Search-based selection
EntityCSV string // CSV file with entity list
EntityList []string // Direct list of entities
RevisionControl *RevisionControlConfig // Git/SVN integration
// Export scope
ExportScope ExportScope // What to export
IncludeDependencies bool // Include entity dependencies
ResolveReferences bool // Resolve cross-references
// Selection state
PendingEntities []EntityInfo // Entities pending addition
IncludedEntities map[string]EntityInfo // Currently included entities
ExcludedEntities map[string]EntityInfo // Explicitly excluded entities
}
PartialExportOptions defines options for selective export
type PasswordStrengthChecker ¶
type PasswordStrengthChecker struct {
MinLength int
RequireUpper bool
RequireLower bool
RequireNumbers bool
RequireSpecial bool
}
PasswordStrengthChecker checks password strength
func (*PasswordStrengthChecker) CheckPassword ¶
func (p *PasswordStrengthChecker) CheckPassword(password string) error
CheckPassword validates password strength
type PatchOperation ¶
type PatchOperation struct {
Path string `json:"path"`
Type string `json:"type"`
PatchFile string `json:"patchFile"`
Algorithm string `json:"algorithm"`
}
PatchOperation represents a patch to be applied
type ProgressCallback ¶
ProgressCallback is a function that is called to report progress
type ProgressEvent ¶
type ProgressEvent struct {
Stage ProgressStage // Current stage of operation
Operation string // Current operation description
Current int64 // Current progress value
Total int64 // Total expected value
Percentage float64 // Percentage complete (0-100)
BytesProcessed int64 // Bytes processed so far
BytesTotal int64 // Total bytes to process
ItemsProcessed int // Number of items processed
ItemsTotal int // Total number of items
TimeElapsed time.Duration // Time elapsed since start
TimeRemaining time.Duration // Estimated time remaining
Speed float64 // Processing speed (bytes/sec)
CurrentFile string // Current file being processed
Error error // Error if any
Metadata map[string]interface{} // Additional metadata
}
ProgressEvent represents a progress update
type ProgressHandler ¶
type ProgressHandler func(event ProgressEvent)
ProgressHandler is a callback for progress updates
func ConsoleProgressHandler ¶
func ConsoleProgressHandler() ProgressHandler
ConsoleProgressHandler creates a console progress handler
func JSONProgressHandler ¶
func JSONProgressHandler(writer io.Writer) ProgressHandler
JSONProgressHandler creates a JSON progress handler
type ProgressInfo ¶
type ProgressInfo struct {
Stage string // Current stage
Current int // Current item
Total int // Total items
Percentage float64 // Completion percentage
CurrentFile string // Current file being processed
BytesProcessed int64 // Bytes processed
TotalBytes int64 // Total bytes to process
TimeElapsed time.Duration
TimeRemaining time.Duration
Message string // Status message
}
ProgressInfo contains progress information
type ProgressReader ¶
type ProgressReader struct {
// contains filtered or unexported fields
}
ProgressReader wraps a reader to track reading progress
func NewProgressReader ¶
func NewProgressReader(reader io.Reader, tracker *ProgressTracker) *ProgressReader
NewProgressReader creates a new progress reader
type ProgressStage ¶
type ProgressStage string
ProgressStage represents different stages of bundle operations
const ( StageInitializing ProgressStage = "initializing" StageValidating ProgressStage = "validating" StageCollecting ProgressStage = "collecting" StageCompressing ProgressStage = "compressing" StageEncrypting ProgressStage = "encrypting" StageWriting ProgressStage = "writing" StageVerifying ProgressStage = "verifying" StageFinalizing ProgressStage = "finalizing" StageCompleted ProgressStage = "completed" StageFailed ProgressStage = "failed" )
type ProgressTracker ¶
type ProgressTracker struct {
// contains filtered or unexported fields
}
ProgressTracker tracks progress of bundle operations
func NewProgressTracker ¶
func NewProgressTracker(ctx context.Context) *ProgressTracker
NewProgressTracker creates a new progress tracker
func (*ProgressTracker) AddHandler ¶
func (p *ProgressTracker) AddHandler(handler ProgressHandler)
AddHandler adds a progress handler
func (*ProgressTracker) Complete ¶
func (p *ProgressTracker) Complete()
Complete marks the operation as completed
func (*ProgressTracker) Fail ¶
func (p *ProgressTracker) Fail(err error)
Fail marks the operation as failed
func (*ProgressTracker) SetCurrentFile ¶
func (p *ProgressTracker) SetCurrentFile(file string)
SetCurrentFile sets the current file being processed
func (*ProgressTracker) SetMetadata ¶
func (p *ProgressTracker) SetMetadata(key string, value interface{})
SetMetadata sets custom metadata
func (*ProgressTracker) SetStage ¶
func (p *ProgressTracker) SetStage(stage ProgressStage, operation string)
SetStage updates the current stage
func (*ProgressTracker) SetTotal ¶
func (p *ProgressTracker) SetTotal(bytes int64, items int)
SetTotal sets the total bytes and items
func (*ProgressTracker) UpdateBytes ¶
func (p *ProgressTracker) UpdateBytes(bytes int64)
UpdateBytes updates bytes processed
func (*ProgressTracker) UpdateItems ¶
func (p *ProgressTracker) UpdateItems(count int)
UpdateItems updates items processed
type ProgressWriter ¶
type ProgressWriter struct {
// contains filtered or unexported fields
}
ProgressWriter wraps a writer to track writing progress
func NewProgressWriter ¶
func NewProgressWriter(writer io.Writer, tracker *ProgressTracker) *ProgressWriter
NewProgressWriter creates a new progress writer
type ReportFormat ¶
type ReportFormat string
ReportFormat represents the format of a report
const ( // JSONReportFormat represents a JSON report JSONReportFormat ReportFormat = "json" // TextReportFormat represents a plain text report TextReportFormat ReportFormat = "text" // MarkdownReportFormat represents a markdown report MarkdownReportFormat ReportFormat = "markdown" )
type ReportGenerator ¶
type ReportGenerator interface {
// GenerateReport generates a report of an import operation
GenerateReport(result *ImportResult, level ReportLevel, format ReportFormat) (*ImportReport, error)
// WriteReport writes a report to a writer
WriteReport(report *ImportReport, writer io.Writer) error
// SaveReport saves a report to a file
SaveReport(report *ImportReport, path string) error
}
ReportGenerator defines the interface for generating reports
func NewReportGenerator ¶
func NewReportGenerator(logger io.Writer) ReportGenerator
NewReportGenerator creates a new report generator
type ReportLevel ¶
type ReportLevel string
ReportLevel represents the level of detail in a report
const ( // BasicReportLevel provides basic information about the import BasicReportLevel ReportLevel = "basic" // DetailedReportLevel provides detailed information about the import DetailedReportLevel ReportLevel = "detailed" // VerboseReportLevel provides verbose information about the import VerboseReportLevel ReportLevel = "verbose" )
type ReportManager ¶
type ReportManager interface {
// CreateImportReport creates a report for an import operation
CreateImportReport(result *ImportResult, level ReportLevel, format ReportFormat) (*ImportReport, error)
// SaveImportReport saves an import report to a file
SaveImportReport(report *ImportReport, path string) error
// GetReportPath gets the path for a report
GetReportPath(bundleID string, format ReportFormat) string
// ListReports lists all reports in a directory
ListReports(dir string) ([]string, error)
}
ReportManager defines the interface for managing reports
func NewReportManager ¶
func NewReportManager(reportsDir string, logger io.Writer) ReportManager
NewReportManager creates a new report manager
type Requirement ¶
type Requirement struct {
MinVersion string `json:"minVersion"`
MaxVersion string `json:"maxVersion,omitempty"`
Required bool `json:"required"`
}
Requirement defines version requirements for a component
type RevisionControlConfig ¶
type RevisionControlConfig struct {
Type string // git, svn, mercurial
Repository string // Repository URL
Branch string // Branch/tag to use
CommitRange string // Commit range (e.g., HEAD~10..HEAD)
IncludeModified bool // Include uncommitted changes
AuthConfig *AuthInfo // Authentication details
}
RevisionControlConfig defines VCS integration settings
type RollbackInfo ¶
type RollbackInfo struct {
Supported bool `json:"supported"`
SnapshotRequired bool `json:"snapshotRequired"`
}
RollbackInfo contains rollback configuration
type RollbackManager ¶
type RollbackManager interface {
// CreateRollbackPoint creates a rollback point
CreateRollbackPoint(ctx context.Context, targetDir, backupDir, description string) (string, error)
// Rollback rolls back to a rollback point
Rollback(ctx context.Context, rollbackPointPath, targetDir string) error
// ListRollbackPoints lists all rollback points
ListRollbackPoints(ctx context.Context, backupDir string) ([]BackupMetadata, error)
// DeleteRollbackPoint deletes a rollback point
DeleteRollbackPoint(ctx context.Context, rollbackPointPath string) error
}
RollbackManager defines the interface for rollback management
func NewRollbackManager ¶
func NewRollbackManager(backupManager BackupManager) RollbackManager
NewRollbackManager creates a new rollback manager
type SchemaValidator ¶
type SchemaValidator struct {
// contains filtered or unexported fields
}
SchemaValidator provides functionality for validating bundle manifests against a schema
func NewDefaultSchemaValidator ¶
func NewDefaultSchemaValidator() (*SchemaValidator, error)
NewDefaultSchemaValidator creates a new schema validator with the default schema path
func NewSchemaValidator ¶
func NewSchemaValidator(schemaPath string) (*SchemaValidator, error)
NewSchemaValidator creates a new schema validator with the specified schema path
func (*SchemaValidator) ValidateManifestFile ¶
func (v *SchemaValidator) ValidateManifestFile(manifestPath string) (*ValidationResult, error)
ValidateManifestFile validates a manifest file against the schema
func (*SchemaValidator) ValidateManifestJSON ¶
func (v *SchemaValidator) ValidateManifestJSON(manifestJSON string) (*ValidationResult, error)
ValidateManifestJSON validates a manifest JSON string against the schema
func (*SchemaValidator) ValidateManifestStruct ¶
func (v *SchemaValidator) ValidateManifestStruct(manifest *BundleManifest) (*ValidationResult, error)
ValidateManifestStruct validates a manifest struct against the schema
type ScopeOptions ¶
type ScopeOptions struct {
IncludeScopes []string // Scopes to include
ExcludeScopes []string // Scopes to exclude
ScopeDepth int // Maximum scope traversal depth
IncludeOrphaned bool // Include orphaned objects
IncludeDeprecated bool // Include deprecated objects
}
ScopeOptions defines business object scope selection
type ScriptFormat ¶
type ScriptFormat string
ScriptFormat defines hotfix script formats
const ( ScriptBash ScriptFormat = "bash" // Bash script ScriptPowerShell ScriptFormat = "powershell" // PowerShell script ScriptPython ScriptFormat = "python" // Python script ScriptCustom ScriptFormat = "custom" // Custom format )
type SecretHandlingType ¶
type SecretHandlingType string
SecretHandlingType defines how secrets are handled during export
const ( SecretExclude SecretHandlingType = "exclude" // Exclude secrets SecretPlaceholder SecretHandlingType = "placeholder" // Replace with placeholders SecretEncrypt SecretHandlingType = "encrypt" // Encrypt secrets SecretInclude SecretHandlingType = "include" // Include as-is (dangerous) )
type SignatureAlgorithm ¶
type SignatureAlgorithm string
SignatureAlgorithm represents the algorithm used for digital signatures
const ( // Ed25519Algorithm represents the Ed25519 signature algorithm Ed25519Algorithm SignatureAlgorithm = "ed25519" // RSAAlgorithm represents the RSA signature algorithm RSAAlgorithm SignatureAlgorithm = "rsa" // ECDSAAlgorithm represents the ECDSA signature algorithm ECDSAAlgorithm SignatureAlgorithm = "ecdsa" )
type SignatureManager ¶
type SignatureManager struct {
// Algorithm is the signature algorithm used
Algorithm SignatureAlgorithm
// Generator is the signature generator
Generator *update.SignatureGenerator
// PublicKey is the public key used for verification
PublicKey ed25519.PublicKey
}
SignatureManager handles the generation and verification of digital signatures
func NewSignatureManager ¶
func NewSignatureManager(algorithm SignatureAlgorithm, privateKey []byte, publicKey []byte) (*SignatureManager, error)
NewSignatureManager creates a new SignatureManager with the specified algorithm
func (*SignatureManager) CalculateManifestSignature ¶
func (sm *SignatureManager) CalculateManifestSignature(manifest *BundleManifest) (string, error)
CalculateManifestSignature calculates a signature for a bundle manifest
func (*SignatureManager) VerifyManifestSignature ¶
func (sm *SignatureManager) VerifyManifestSignature(manifest *BundleManifest) (bool, error)
VerifyManifestSignature verifies the signature of a bundle manifest
type SignatureMetadata ¶
type SignatureMetadata struct {
Signer string `json:"signer"`
Environment string `json:"environment"`
BuildID string `json:"buildId"`
Tags []string `json:"tags"`
}
SignatureMetadata contains additional signature information
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer handles bundle signing operations
func NewSigner ¶
func NewSigner(privateKey ed25519.PrivateKey, keyID string, metadata SignatureMetadata) *Signer
NewSigner creates a new bundle signer
func (*Signer) SignBundle ¶
func (s *Signer) SignBundle(bundlePath string) (*BundleSignature, error)
SignBundle creates a digital signature for the bundle
type SigningKey ¶
type SigningKey struct {
KeyID string `json:"keyId"`
Algorithm string `json:"algorithm"`
PublicKey string `json:"publicKey"`
PrivateKey string `json:"privateKey,omitempty"`
Created time.Time `json:"created"`
Expires time.Time `json:"expires"`
Usage []string `json:"usage"`
}
SigningKey represents a key used for signing
func GenerateSigningKeyPair ¶
func GenerateSigningKeyPair(keyID string) (*SigningKey, error)
GenerateSigningKeyPair generates a new Ed25519 key pair for signing
type SpinnerProgress ¶
type SpinnerProgress struct {
// contains filtered or unexported fields
}
SpinnerProgress provides a simple spinner for indeterminate progress
func NewSpinnerProgress ¶
func NewSpinnerProgress(message string, writer io.Writer) *SpinnerProgress
NewSpinnerProgress creates a new spinner progress indicator
func (*SpinnerProgress) StopWithMessage ¶
func (sp *SpinnerProgress) StopWithMessage(success bool, message string)
StopWithMessage stops the spinner and displays a message
type StagedImportOptions ¶
type StagedImportOptions struct {
// ValidationLevel is the level of validation to perform
ValidationLevel ValidationLevel
// TargetDir is the directory to import the bundle to
TargetDir string
// BackupDir is the directory to store backups in
BackupDir string
// TempDir is the directory to use for temporary files
TempDir string
// Force indicates whether to force import even if there are conflicts
Force bool
// KeepBackup indicates whether to keep the backup after successful import
KeepBackup bool
// Logger is the logger for import operations
Logger io.Writer
// ProgressCallback is called with progress updates
ProgressCallback func(phase StagedImportPhase, progress float64, message string)
}
StagedImportOptions represents options for staged import
type StagedImportPhase ¶
type StagedImportPhase string
StagedImportPhase represents a phase in the staged import process
const ( // ValidationPhase represents the validation phase ValidationPhase StagedImportPhase = "validation" // ExtractionPhase represents the extraction phase ExtractionPhase StagedImportPhase = "extraction" // BackupPhase represents the backup phase BackupPhase StagedImportPhase = "backup" // VerificationPhase represents the verification phase VerificationPhase StagedImportPhase = "verification" // InstallationPhase represents the installation phase InstallationPhase StagedImportPhase = "installation" // CleanupPhase represents the cleanup phase CleanupPhase StagedImportPhase = "cleanup" )
type StagedImportStatus ¶
type StagedImportStatus struct {
// Phase is the current phase of the import
Phase StagedImportPhase
// Progress is the progress of the current phase (0-100)
Progress float64
// Message is a human-readable message about the current status
Message string
// StartTime is the time the import started
StartTime time.Time
// CurrentPhaseStartTime is the time the current phase started
CurrentPhaseStartTime time.Time
// EndTime is the time the import ended (if completed)
EndTime time.Time
// Success indicates whether the import was successful (if completed)
Success bool
// Error is the error that occurred (if any)
Error error
// ValidationResult is the result of the validation phase
ValidationResult *ValidationResult
// BackupPath is the path to the backup (if created)
BackupPath string
// ImportedItems are the items that were imported
ImportedItems []ContentItem
}
StagedImportStatus represents the status of a staged import
type StagedImporter ¶
type StagedImporter interface {
// Import performs a staged import
Import(ctx context.Context, bundlePath string, options StagedImportOptions) (*ImportResult, error)
// GetStatus returns the current status of the import
GetStatus() *StagedImportStatus
// Cancel cancels the import
Cancel() error
}
StagedImporter defines the interface for staged import
func NewStagedImporter ¶
func NewStagedImporter(importer BundleImporter) StagedImporter
NewStagedImporter creates a new staged importer
type StandardBundleValidator ¶
type StandardBundleValidator struct {
// Logger is the logger for validation operations
Logger io.Writer
}
StandardBundleValidator is a standard implementation of BundleValidator
func NewStandardBundleValidator ¶
func NewStandardBundleValidator(logger io.Writer) *StandardBundleValidator
NewStandardBundleValidator creates a new standard bundle validator
func (*StandardBundleValidator) Validate ¶
func (v *StandardBundleValidator) Validate(bundle *Bundle, level ValidationLevel) (*ValidationResult, error)
Validate validates a bundle with the specified validation level
func (*StandardBundleValidator) ValidateChecksums ¶
func (v *StandardBundleValidator) ValidateChecksums(bundle *Bundle) (*ValidationResult, error)
ValidateChecksums validates bundle checksums
func (*StandardBundleValidator) ValidateCompatibility ¶
func (v *StandardBundleValidator) ValidateCompatibility(bundle *Bundle, currentVersions map[string]version.Version) (*ValidationResult, error)
ValidateCompatibility validates bundle compatibility with current versions
func (*StandardBundleValidator) ValidateManifest ¶
func (v *StandardBundleValidator) ValidateManifest(manifest *BundleManifest) (*ValidationResult, error)
ValidateManifest validates a bundle manifest
func (*StandardBundleValidator) ValidateSignature ¶
func (v *StandardBundleValidator) ValidateSignature(bundle *Bundle, publicKey ed25519.PublicKey) (*ValidationResult, error)
ValidateSignature validates a bundle signature
type SystemImpactAssessment ¶
type SystemImpactAssessment struct {
// DiskSpaceUsed is the amount of disk space used by the import in bytes
DiskSpaceUsed int64 `json:"disk_space_used"`
// DiskSpaceAvailable is the amount of disk space available after the import in bytes
DiskSpaceAvailable int64 `json:"disk_space_available"`
// MemoryUsage is the amount of memory used during the import in bytes
MemoryUsage int64 `json:"memory_usage"`
// CPUUsage is the CPU usage during the import as a percentage
CPUUsage float64 `json:"cpu_usage"`
// BackupSize is the size of the backup in bytes
BackupSize int64 `json:"backup_size"`
// ConfigChanges is the number of configuration changes made
ConfigChanges int `json:"config_changes"`
// SecurityImpact contains information about the security impact of the import
SecurityImpact string `json:"security_impact"`
}
SystemImpactAssessment contains information about the impact of an import on the system
type TemplateFilterFunc ¶
type TemplateFilterFunc func(template *TemplateInfo) bool
TemplateFilterFunc is a custom template filter function
type TemplateFilterOptions ¶
type TemplateFilterOptions struct {
Categories []string // Include only these categories
ExcludeCategories []string // Exclude these categories
Tags []string // Include templates with these tags
ExcludeTags []string // Exclude templates with these tags
MinVersion string // Minimum template version
MaxVersion string // Maximum template version
ModifiedAfter *time.Time // Templates modified after this date
ModifiedBefore *time.Time // Templates modified before this date
AuthorFilter string // Filter by author
CustomFilter TemplateFilterFunc // Custom filter function
}
TemplateFilterOptions provides template-specific filtering
type TemplateInfo ¶
type TemplateInfo struct {
Name string
Category string
Version string
Tags []string
Author string
Modified time.Time
Description string
Dependencies []string
}
TemplateInfo contains template metadata for filtering
type TemplateMetadataExtractor ¶
type TemplateMetadataExtractor struct{}
TemplateMetadataExtractor extracts metadata from template files
func (*TemplateMetadataExtractor) Extract ¶
func (e *TemplateMetadataExtractor) Extract(path string) (map[string]interface{}, error)
func (*TemplateMetadataExtractor) Supports ¶
func (e *TemplateMetadataExtractor) Supports(path string) bool
type TransformationOptions ¶
type TransformationOptions struct {
PathTransformations map[string]string // Path remapping
ContentTransformers []ContentTransformer // Content transformation functions
MetadataEnrichment MetadataEnricher // Add metadata to files
Sanitizers []ContentSanitizer // Content sanitization
}
TransformationOptions defines content transformations
type UpdateContext ¶
type UpdateContext struct {
CurrentVersion string
TargetVersion string
BundlePath string
BackupPath string
DeltaPath string
DryRun bool
Plan *UpdatePlan
AppliedOperations []Operation
Progress *UpdateProgress
}
UpdateContext holds the context for an update operation
func (*UpdateContext) Update ¶
func (uc *UpdateContext) Update() error
Update applies an update to the bundle
type UpdateOperation ¶
type UpdateOperation struct {
Path string `json:"path"`
Type string `json:"type"`
OldHash string `json:"oldHash"`
NewHash string `json:"newHash"`
PatchAvailable bool `json:"patchAvailable"`
PatchSize int64 `json:"patchSize,omitempty"`
}
UpdateOperation represents a file update
type UpdatePlan ¶
type UpdatePlan struct {
Operations []Operation `json:"operations"`
SpaceRequired int64 `json:"spaceRequired"`
BackupSize int64 `json:"backupSize"`
EstimatedTime int `json:"estimatedTime"`
}
UpdatePlan represents a planned update
func PrepareUpdate ¶
func PrepareUpdate(ctx *UpdateContext) (*UpdatePlan, error)
PrepareUpdate prepares an update plan
type UpdateProgress ¶
type UpdateProgress struct {
TotalOperations int
CompletedOperations int
CurrentOperation string
BytesProcessed int64
TotalBytes int64
}
UpdateProgress tracks update progress
type UpgradePath ¶
type UpgradePath struct {
From string `json:"from"`
To string `json:"to"`
Direct bool `json:"direct"`
Intermediate string `json:"intermediate,omitempty"`
}
UpgradePath defines a supported upgrade path
type ValidationLevel ¶
type ValidationLevel string
ValidationLevel represents the level of validation to perform
const ( // BasicValidation represents basic validation (manifest integrity, signature) BasicValidation ValidationLevel = "basic" // StandardValidation represents standard validation (basic + content integrity) StandardValidation ValidationLevel = "standard" // StrictValidation represents strict validation (standard + compatibility) StrictValidation ValidationLevel = "strict" // ManifestValidationLevel represents manifest validation ManifestValidationLevel ValidationLevel = "manifest" // ChecksumValidationLevel represents checksum validation ChecksumValidationLevel ValidationLevel = "checksum" // SignatureValidationLevel represents signature validation SignatureValidationLevel ValidationLevel = "signature" // CompatibilityValidationLevel represents compatibility validation CompatibilityValidationLevel ValidationLevel = "compatibility" )
type ValidationResult ¶
type ValidationResult struct {
// Valid indicates whether the validation was successful
Valid bool
// IsValid is an alias for Valid for compatibility with reporting
IsValid bool
// Level is the validation level that was performed
Level ValidationLevel
// Message contains a human-readable message about the validation
Message string
// Errors contains any errors encountered during validation
Errors []string
// Error is the primary error that occurred during validation
Error error
// Warnings contains any warnings encountered during validation
Warnings []string
// Details contains additional details about the validation
Details map[string]interface{}
// Timestamp is when the validation was performed
Timestamp time.Time
}
ValidationResult represents the result of a validation operation
func ValidateBundle ¶
func ValidateBundle(bundle Bundle, level ValidationLevel, publicKey ed25519.PublicKey) (*ValidationResult, error)
ValidateBundle validates a bundle with the specified validation level
func ValidateOfflineBundle ¶
func ValidateOfflineBundle(bundle *OfflineBundle, level ValidationLevel, publicKey ed25519.PublicKey) (*ValidationResult, error)
ValidateOfflineBundle validates an offline bundle with enhanced validation
func VerifyBundle ¶
func VerifyBundle(bundle *Bundle, publicKey []byte) (*ValidationResult, error)
VerifyBundle verifies a bundle's signature and checksums
func VerifyBundleChecksums ¶
func VerifyBundleChecksums(bundle *Bundle) (*ValidationResult, error)
VerifyBundleChecksums verifies all checksums in a bundle
type VerificationResult ¶
type VerificationResult struct {
Valid bool `json:"valid"`
Timestamp time.Time `json:"timestamp"`
KeyID string `json:"keyId"`
Signer string `json:"signer"`
Errors []string `json:"errors,omitempty"`
Warnings []string `json:"warnings,omitempty"`
Details map[string]interface{} `json:"details"`
}
VerificationResult contains the result of signature verification
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier handles bundle verification operations
func (*Verifier) AddPublicKey ¶
AddPublicKey adds a public key for verification
func (*Verifier) VerifyBundle ¶
func (v *Verifier) VerifyBundle(bundlePath string) (*VerificationResult, error)
VerifyBundle verifies a bundle's signature
type VersionRange ¶
VersionRange defines a version range constraint
type ZstdHandler ¶
type ZstdHandler struct {
Level int
}
ZstdHandler handles Zstandard compression
func (*ZstdHandler) Decompress ¶
func (*ZstdHandler) GetExtension ¶
func (h *ZstdHandler) GetExtension() string
Source Files
¶
- backup.go
- bundle.go
- compatibility.go
- compression.go
- conflict.go
- converter.go
- customization.go
- delta.go
- export.go
- format_specification.go
- import.go
- import_reporting.go
- import_reporting_unix.go
- interactive_progress.go
- interfaces.go
- loader.go
- manifest_enhanced.go
- manifest_generator.go
- offline_bundle_creator.go
- offline_validator.go
- partial_export.go
- progress.go
- report.go
- schema.go
- signature.go
- signature_enhanced.go
- staged_import.go
- structure.go
- types.go
- utils.go
- validator.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cli provides command-line interfaces for bundle operations
|
Package cli provides command-line interfaces for bundle operations |
|
Package errors provides error handling functionality for bundle operations
|
Package errors provides error handling functionality for bundle operations |