Documentation
¶
Index ¶
- Constants
- func Bytes(bytes int64) string
- func CleanResultsToJSON(results map[string]domain.CleanResult, duration time.Duration, dryRun bool, ...) ([]byte, error)
- func Date(t time.Time) string
- func DateTime(t time.Time) string
- func Duration(d time.Duration) string
- func Number(n int64) string
- func Size(bytes int64) string
- type CleanerResult
- type JSONOutput
Constants ¶
View Source
const (
// NanosecondsPerMillisecond is the number of nanoseconds in a millisecond.
NanosecondsPerMillisecond = 1e6
)
Duration formatting constants.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CleanerResult ¶
type CleanerResult struct {
Name string `json:"name"`
ItemsRemoved uint `json:"items_removed"`
ItemsFailed uint `json:"items_failed"`
FreedBytes uint64 `json:"freed_bytes"`
FreedHuman string `json:"freed_human"`
Status string `json:"status"` // "success", "skipped", "failed"
Error string `json:"error,omitempty"`
}
CleanerResult represents individual cleaner results in JSON output.
type JSONOutput ¶
type JSONOutput struct {
Success bool `json:"success"`
CleanedAt time.Time `json:"cleaned_at"`
DurationMs int64 `json:"duration_ms"`
ItemsRemoved uint `json:"items_removed"`
ItemsFailed uint `json:"items_failed"`
FreedBytes uint64 `json:"freed_bytes"`
FreedHuman string `json:"freed_human"`
Cleaners []CleanerResult `json:"cleaners"`
DryRun bool `json:"dry_run,omitempty"`
Errors []string `json:"errors,omitempty"`
}
JSONOutput represents the JSON structure for clean command output.
Click to show internal directories.
Click to hide internal directories.