Documentation
¶
Index ¶
- func ChartEntryPath(root, kind, key string) string
- func ChartKindRoot(root, kind string) string
- func GitEntryPath(root, key string) string
- func MetadataPath(entryPath string) string
- func OCIEntryPath(root, key string) string
- func RedactedTarget(raw string) string
- func RemoteEntryPath(root, key string) string
- func RemoteGitRepoPath(root, key string) string
- func RemoteHTTPFilePath(root, key string) string
- func WriteMetadata(entryPath string, metadata Metadata) error
- type Entry
- type Metadata
- type OperationOptions
- type OperationResult
- type Options
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChartEntryPath ¶
func ChartKindRoot ¶
func GitEntryPath ¶
func MetadataPath ¶
func OCIEntryPath ¶ added in v0.2.7
func RedactedTarget ¶
func RemoteEntryPath ¶
func RemoteGitRepoPath ¶
func RemoteHTTPFilePath ¶
func WriteMetadata ¶
Types ¶
type Entry ¶
type Entry struct {
Source Source `json:"source" yaml:"source"`
Kind string `json:"kind" yaml:"kind"`
Key string `json:"key" yaml:"key"`
Path string `json:"path" yaml:"path"`
MetadataPath string `json:"metadataPath,omitempty" yaml:"metadataPath,omitempty"`
SizeBytes int64 `json:"sizeBytes" yaml:"sizeBytes"`
ModifiedAt time.Time `json:"modifiedAt" yaml:"modifiedAt"`
Legacy bool `json:"legacy" yaml:"legacy"`
Metadata *Metadata `json:"metadata,omitempty" yaml:"metadata,omitempty"`
// PruneReason is set to "age" or "size" only on entries selected for removal
// by Prune(). Zero value is omitted from JSON/YAML output so that cache list
// output remains byte-identical to pre-prune output.
PruneReason string `json:"pruneReason,omitempty" yaml:"pruneReason,omitempty"`
// contains filtered or unexported fields
}
type Metadata ¶
type Metadata struct {
SchemaVersion int `json:"schemaVersion" yaml:"schemaVersion"`
Source Source `json:"source" yaml:"source"`
Kind string `json:"kind" yaml:"kind"`
Key string `json:"key" yaml:"key"`
Target string `json:"target,omitempty" yaml:"target,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Version string `json:"version,omitempty" yaml:"version,omitempty"`
Revision string `json:"revision,omitempty" yaml:"revision,omitempty"`
Path string `json:"path,omitempty" yaml:"path,omitempty"`
CreatedAt time.Time `json:"createdAt" yaml:"createdAt"`
UpdatedAt time.Time `json:"updatedAt" yaml:"updatedAt"`
}
type OperationOptions ¶
type OperationOptions struct {
Options
OlderThan time.Duration
DryRun bool
Yes bool
Source Source
Kind string
Key string
All bool
RenderCacheMaxBytes int64
// MaxBytes caps the summed SizeBytes of the entries selected by the source/kind
// filters. Evicts least-recently-used (oldest entryAgeTime) entries until the
// total is at or below this cap. 0 disables the size phase. Named to parallel
// RenderCacheMaxBytes.
MaxBytes int64
}
type OperationResult ¶
type OperationResult struct {
Entries []Entry `json:"entries" yaml:"entries"`
RemovedCount int `json:"removedCount" yaml:"removedCount"`
DryRun bool `json:"dryRun" yaml:"dryRun"`
RenderSweep *rendercache.SweepResult `json:"renderSweep,omitempty" yaml:"renderSweep,omitempty"`
// SizeEvictedBytes is the sum of SizeBytes for all entries removed by the size
// phase. Populated on both dry-run and real runs. Always present in JSON/YAML
// output (not omitempty) for a consistent numeric summary.
SizeEvictedBytes int64 `json:"sizeEvictedBytes" yaml:"sizeEvictedBytes"`
// TotalSizeBytes is the selected-set total after both age and size phases,
// BEFORE the render sweep. The sweep (which runs after removals on real runs,
// never on dry-run) can trim renders further; its effect is reported separately
// in RenderSweep. Always present in JSON/YAML output (not omitempty).
TotalSizeBytes int64 `json:"totalSizeBytes" yaml:"totalSizeBytes"`
}
func Delete ¶
func Delete(opts OperationOptions) (OperationResult, error)
func Prune ¶
func Prune(opts OperationOptions) (OperationResult, error)
type Source ¶
type Source string
const ( SourceGit Source = "git" SourceChart Source = "chart" SourceRemote Source = "remote" SourceRender Source = "render" // SourceOCI is the first-class OCI artifact image cache. The name does not // collide with the chart cache's "oci" repository kind: Source and Kind are // distinct fields on entries and metadata, and chart "oci" only appears as // a Kind under SourceChart (listChartEntries below). SourceOCI Source = "oci" )
Click to show internal directories.
Click to hide internal directories.