cache

package
v0.0.49 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRoutes

func RegisterRoutes(e *echo.Echo, h *Handler, authMiddleware *auth.Middleware)

RegisterRoutes registers cache management routes on the given echo instance. GET /cache requires config:read; POST /cache/:id/clear requires config:write.

Types

type ClearResponse

type ClearResponse struct {
	ClearedBytes int64 `json:"cleared_bytes"`
	ClearedFiles int   `json:"cleared_files"`
}

ClearResponse is returned from POST /cache/:id/clear.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler exposes HTTP endpoints for cache management.

func NewHandler

func NewHandler(downloads, cbzPages, pdfPages Provider) *Handler

NewHandler returns a new cache management handler.

type Info

type Info struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	SizeBytes   int64  `json:"size_bytes"`
	FileCount   int    `json:"file_count"`
}

Info describes a single cache in the list response. The type name avoids stuttering (cache.Info instead of cache.CacheInfo).

type ListResponse

type ListResponse struct {
	Caches []Info `json:"caches"`
}

ListResponse is returned from GET /cache.

type Provider

type Provider interface {
	SizeBytes() (int64, int, error)
	Clear() error
}

Provider is the minimal interface a cache must implement to be managed.

Jump to

Keyboard shortcuts

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