Documentation
¶
Index ¶
- type DeletionRequest
- type DeletionResult
- type DeletionService
- func (ds *DeletionService) DeleteAll(exportFirst string, force bool) (*DeletionResult, error)
- func (ds *DeletionService) DeletePattern(pattern string, dryRun bool, force bool) (*DeletionResult, error)
- func (ds *DeletionService) DeleteRecord(recordID int64, force bool) (*DeletionResult, error)
- func (ds *DeletionService) ExecuteDeletion(req *DeletionRequest) (*DeletionResult, error)
- func (ds *DeletionService) GetDeletionStats(req *DeletionRequest) (*DeletionStats, error)
- func (ds *DeletionService) ValidatePattern(pattern string) error
- type DeletionStats
- type DeletionType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeletionRequest ¶
type DeletionRequest struct {
// Operation type
Type DeletionType
// Single deletion
RecordID int64
// Pattern deletion
Pattern string
// Options
DryRun bool
Force bool // Skip confirmations
ExportFirst string // Export path before deletion
}
DeletionRequest represents a deletion operation request
type DeletionResult ¶
type DeletionResult struct {
DeletedCount int64
MatchedRecords []*storage.CommandRecord // For dry-run preview
Duration time.Duration
ExportedTo string
Errors []error
}
DeletionResult contains the results of a deletion operation
type DeletionService ¶
type DeletionService struct {
// contains filtered or unexported fields
}
DeletionService handles all command deletion operations
func NewDeletionService ¶
func NewDeletionService( storage *securestorage.SecureStorage, cache *cache.Cache, searchService *search.SearchService, authManager *auth.AuthManager, config *config.Config, ) *DeletionService
NewDeletionService creates a new deletion service
func (*DeletionService) DeleteAll ¶
func (ds *DeletionService) DeleteAll(exportFirst string, force bool) (*DeletionResult, error)
DeleteAll deletes all command history
func (*DeletionService) DeletePattern ¶
func (ds *DeletionService) DeletePattern(pattern string, dryRun bool, force bool) (*DeletionResult, error)
DeletePattern deletes all records matching a pattern
func (*DeletionService) DeleteRecord ¶
func (ds *DeletionService) DeleteRecord(recordID int64, force bool) (*DeletionResult, error)
DeleteRecord deletes a single command record by ID
func (*DeletionService) ExecuteDeletion ¶
func (ds *DeletionService) ExecuteDeletion(req *DeletionRequest) (*DeletionResult, error)
ExecuteDeletion executes a deletion request
func (*DeletionService) GetDeletionStats ¶
func (ds *DeletionService) GetDeletionStats(req *DeletionRequest) (*DeletionStats, error)
GetDeletionStats returns statistics about what would be deleted
func (*DeletionService) ValidatePattern ¶
func (ds *DeletionService) ValidatePattern(pattern string) error
ValidatePattern validates a deletion pattern for safety
type DeletionStats ¶
type DeletionStats struct {
TotalMatches int64
OldestRecord time.Time
NewestRecord time.Time
Patterns map[string]int // Command patterns and their counts
}
DeletionStats provides statistics about a deletion operation
type DeletionType ¶
type DeletionType int
DeletionType represents the type of deletion operation
const ( DeleteSingle DeletionType = iota DeletePattern DeleteAll )