cache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package cache provides commands for managing the scafctl cache.

Index

Constants

This section is empty.

Variables

View Source
var ValidKinds = []string{string(KindAll), string(KindHTTP)}

ValidKinds lists all valid cache kinds.

Functions

func CommandCache

func CommandCache(cliParams *settings.Run, ioStreams *terminal.IOStreams, path string) *cobra.Command

CommandCache creates the cache command group.

func CommandClear

func CommandClear(cliParams *settings.Run, ioStreams *terminal.IOStreams, _ string) *cobra.Command

CommandClear creates the clear command.

func CommandInfo

func CommandInfo(cliParams *settings.Run, ioStreams *terminal.IOStreams, _ string) *cobra.Command

CommandInfo creates the info command.

Types

type ClearOptions

type ClearOptions struct {
	CliParams *settings.Run
	IOStreams *terminal.IOStreams
	Kind      string
	Name      string
	Force     bool
	flags.KvxOutputFlags
}

ClearOptions holds options for the clear command.

type ClearOutput

type ClearOutput struct {
	RemovedFiles int64  `json:"removedFiles" yaml:"removedFiles"`
	RemovedBytes int64  `json:"removedBytes" yaml:"removedBytes"`
	RemovedHuman string `json:"reclaimedHuman" yaml:"reclaimedHuman"`
	Kind         string `json:"kind,omitempty" yaml:"kind,omitempty"`
	Name         string `json:"name,omitempty" yaml:"name,omitempty"`
}

ClearOutput represents the clear command output.

type Info

type Info struct {
	Name        string `json:"name" yaml:"name"`
	Path        string `json:"path" yaml:"path"`
	Size        int64  `json:"size" yaml:"size"`
	SizeHuman   string `json:"sizeHuman" yaml:"sizeHuman"`
	FileCount   int64  `json:"fileCount" yaml:"fileCount"`
	Description string `json:"description" yaml:"description"`
}

Info represents information about a cache directory.

type InfoOptions

type InfoOptions struct {
	CliParams *settings.Run
	IOStreams *terminal.IOStreams
	flags.KvxOutputFlags
}

InfoOptions holds options for the info command.

type InfoOutput

type InfoOutput struct {
	Caches     []Info `json:"caches" yaml:"caches"`
	TotalSize  int64  `json:"totalSize" yaml:"totalSize"`
	TotalHuman string `json:"totalHuman" yaml:"totalHuman"`
	TotalFiles int64  `json:"totalFiles" yaml:"totalFiles"`
}

InfoOutput represents the info command output.

type Kind

type Kind string

Kind represents the type of cache to clear.

const (
	// KindAll clears all caches.
	KindAll Kind = "all"
	// KindHTTP clears the HTTP response cache.
	KindHTTP Kind = "http"
)

Jump to

Keyboard shortcuts

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