Documentation
¶
Index ¶
- func NewHandler(service Service, cacheDir string, opts ServeOptions) http.Handler
- func ParseOlderDuration(value string) (time.Duration, error)
- func ValidRoot(root string) bool
- type CacheMirrorStatus
- type CacheScanOptions
- type CleanOptions
- type CleanResult
- type CleanSkip
- type Entry
- type Kind
- type KindSummary
- type ListFile
- type ListOptions
- type ListResult
- type Manifest
- type ManifestCache
- type ManifestFile
- type ManifestServer
- type ServeOptions
- type Service
- func (s Service) ApplyClean(preview CleanResult) (CleanResult, error)
- func (s Service) Clean(cacheDir string, opts CleanOptions) (CleanResult, error)
- func (s Service) List(cacheDir string, opts ListOptions) (ListResult, error)
- func (s Service) PreviewClean(cacheDir string, opts CleanOptions) (CleanResult, error)
- func (s Service) ResolveCacheDir() (string, error)
- func (s Service) Scan(cacheDir string, opts CacheScanOptions) ([]Entry, error)
- func (s Service) Status(cacheDir string) (StatusResult, error)
- type StatusResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(service Service, cacheDir string, opts ServeOptions) http.Handler
Types ¶
type CacheMirrorStatus ¶ added in v1.7.5
type CacheScanOptions ¶
type CleanOptions ¶
type CleanResult ¶
type CleanResult struct {
CacheDir string `json:"cache_dir"`
MatchedFiles int `json:"matched_files"`
RemovedFiles int `json:"removed_files"`
MatchedSize int64 `json:"matched_size"`
RemovedSize int64 `json:"removed_size"`
KeptLatestFiles int `json:"kept_latest_files"`
UnrecognizedFiles int `json:"unrecognized_files"`
Skipped []CleanSkip `json:"skipped"`
// contains filtered or unexported fields
}
func (CleanResult) NeedsConfirmation ¶
func (r CleanResult) NeedsConfirmation() bool
type KindSummary ¶ added in v1.7.5
type ListOptions ¶ added in v1.7.5
type ListOptions struct {
Root string
}
type ListResult ¶ added in v1.7.5
type Manifest ¶
type Manifest struct {
Schema int `json:"schema"`
Server ManifestServer `json:"server"`
Cache ManifestCache `json:"cache"`
Files []ManifestFile `json:"files"`
}
type ManifestCache ¶
type ManifestFile ¶
type ManifestServer ¶
type ServeOptions ¶
type Service ¶
func (Service) ApplyClean ¶ added in v1.9.0
func (s Service) ApplyClean(preview CleanResult) (CleanResult, error)
ApplyClean removes only unchanged files captured by PreviewClean.
func (Service) Clean ¶
func (s Service) Clean(cacheDir string, opts CleanOptions) (CleanResult, error)
func (Service) List ¶ added in v1.7.5
func (s Service) List(cacheDir string, opts ListOptions) (ListResult, error)
func (Service) PreviewClean ¶
func (s Service) PreviewClean(cacheDir string, opts CleanOptions) (CleanResult, error)
func (Service) ResolveCacheDir ¶
type StatusResult ¶ added in v1.7.5
type StatusResult struct {
CacheDir string `json:"cache_dir"`
GeneratedAt time.Time `json:"generated_at"`
TotalFiles int `json:"total_files"`
TotalSize int64 `json:"total_size"`
Kinds map[string]KindSummary `json:"kinds"`
ServeCommand string `json:"serve_command"`
CacheMirror CacheMirrorStatus `json:"cache_mirror"`
}
Click to show internal directories.
Click to hide internal directories.