cache

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChartEntryPath

func ChartEntryPath(root, kind, key string) string

func ChartKindRoot

func ChartKindRoot(root, kind string) string

func GitEntryPath

func GitEntryPath(root, key string) string

func MetadataPath

func MetadataPath(entryPath string) string

func RedactedTarget

func RedactedTarget(raw string) string

func RemoteEntryPath

func RemoteEntryPath(root, key string) string

func RemoteGitRepoPath

func RemoteGitRepoPath(root, key string) string

func RemoteHTTPFilePath

func RemoteHTTPFilePath(root, key string) string

func WriteMetadata

func WriteMetadata(entryPath string, metadata Metadata) error

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"`
	// contains filtered or unexported fields
}

func List

func List(opts Options) ([]Entry, error)

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"`
}

func ReadMetadata

func ReadMetadata(entryPath string, expected Source, expectedKind, expectedKey string) (*Metadata, error)

type OperationOptions

type OperationOptions struct {
	Options
	OlderThan time.Duration
	DryRun    bool
	Yes       bool
	Source    Source
	Kind      string
	Key       string
	All       bool
}

type OperationResult

type OperationResult struct {
	Entries      []Entry `json:"entries" yaml:"entries"`
	RemovedCount int     `json:"removedCount" yaml:"removedCount"`
	DryRun       bool    `json:"dryRun" yaml:"dryRun"`
}

func Delete

func Delete(opts OperationOptions) (OperationResult, error)

func Prune

func Prune(opts OperationOptions) (OperationResult, error)

type Options

type Options struct {
	GitCacheDir    string
	ChartCacheDir  string
	RemoteCacheDir string
	Sources        []Source
	ForbiddenRoots []string
}

type Source

type Source string
const (
	SourceGit    Source = "git"
	SourceChart  Source = "chart"
	SourceRemote Source = "remote"
)

Jump to

Keyboard shortcuts

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